What does Drift Control for Multi-Window Writing conclude, in numbers, about “Style Drift: Gates for Sentence Length, Lexical Diversity, Stock Phrases and Paragraph Openers”?

Answer: The two passages are of similar size, 271 Chinese characters for A and 233 for B, yet they separate on almost every line. The coefficient of variation of sentence length is 0.670 for A and only 0.371 for B; the share of sentences within three characters of the median is 0.267 for A and 0.455 for B. A mixes long and short: a sentence of eight characters about how quickly a number can be corrected sits right next to a forty-character explanation. B's sentences nearly all crowd around twenty characters. The type-token ratio is 0.590 for A and 0.322 for B; MTLD is 128.1 for A and falls to 44.5 for B. Stock-phrase hits run at zero per thousand characters in A and 128.8 in B. Four of B's six paragraphs share one four-character opener, and the share of character 8-grams that occur more than once is 0.000 in A against 0.199 in B.

Scope of the numbers: Every error rate without a source is an assumed parameter or a measurement on synthetic data; the book is not legal advice and recommends no writing tool or model. Marked boxes separate published evidence, runnable calculations, sources and the author's hypotheses, each stating what would refute it.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.000, 0.199, 0.267, 0.322, 0.371, 0.455

metrictext Atext B
CJK characters271233
paragraphs66
sentences1511
sentence length mean18.0721.18
sentence length sd12.117.86
coefficient of variation0.6700.371
share within 3 of median0.2670.455
type-token ratio0.5900.322
MTLD (threshold 0.72)128.144.5
template hits per 10000.0128.8
paragraphs w/ shared opener04
most common opener count14
8-gram repeat share0.0000.199
Show the full program
# Chapter 6. p60: Style profile of two fictional passages on the same topic, one healthy, one degraded.
# Tokens are CJK characters (punctuation and digits dropped). Sentences end at a full stop, "!" or "?".
# Metrics: sentence-length mean / sd / coefficient of variation, share of sentences within 3 chars
# of the median, type-token ratio, MTLD (factor threshold 0.72, mean of forward and backward runs,
# McCarthy & Jarvis 2010), template phrases per 1000 characters, paragraph openers shared with
# another paragraph (first 4 characters), and the share of character 8-grams that occur twice or more.
import math
import re
import statistics
from collections import Counter

TEXT_A = """周三夜里,第三卷的校样回到了工作室。林蔚先翻数字:第二章说锁的租约是九十秒,第五章写成了两分钟。\
错不在谁偷懒,是两个窗口各自记住了不同的草稿。
她没有直接改。先查程序输出,九十秒是对的;再查第五章的上下文,原来那段讲的是心跳间隔,作者把两个参数挤进了同一句。
改一个数只要十秒。查清它为什么错,花了四十分钟。
第二件事是引文。某篇论文的年份在第一卷写作一九九七,在第三卷写作一九九八,标题却一字不差。\
台账里存着原刊目录页的扫描件,一九九七对。
凌晨一点,她把两处改动记进勘误表,每条写明出处页码、改前、改后、依据。明天合伙人复核,签字后才算数。
校书慢吗?慢。可是一个错数字印进三千本书,再追回来,比今晚多坐一小时贵得多。"""

TEXT_B = """值得注意的是,在多窗口写作的过程中,数字的一致性是至关重要的。我们需要认真核对每一个数字。
值得注意的是,在校对的过程中,我们需要认真核对每一个参数。总的来说,参数的一致性是不可或缺的。
总的来说,在引文核对的过程中,我们需要认真核对每一个出处。出处的准确性是至关重要的。
值得注意的是,在勘误的过程中,我们需要认真记录每一处改动。记录的完整性是不可或缺的。
值得注意的是,在复核的过程中,合伙人的签字是不可或缺的。我们需要认真对待每一次复核。
综上所述,校对工作是至关重要的,我们需要认真对待每一个细节,不断提升校对的质量。"""

TEMPLATES = ["值得注意的是", "总的来说", "综上所述", "至关重要", "不可或缺", "众所周知", "不难发现",
             "毋庸置疑", "在当今", "的过程中", "我们需要", "不断提升", "认真对待", "认真核对"]
FACTOR = 0.72


def cjk(s):
    return re.findall(r"[一-鿿]", s)


def sentences(text):
    return [s for s in re.split(r"[。!?]", text) if cjk(s)]


def mtld_one(tokens):
    factors, types, n = 0.0, set(), 0
    for t in tokens:
        types.add(t)
        n += 1
        if len(types) / n <= FACTOR:
            factors += 1
            types, n = set(), 0
    if n:
        factors += (1 - len(types) / n) / (1 - FACTOR)
    return len(tokens) / factors if factors else float("inf")


def mtld(tokens):
    return (mtld_one(tokens) + mtld_one(tokens[::-1])) / 2


def profile(text):
    paras = [p for p in text.split("\n") if p.strip()]
    lens = [len(cjk(s)) for s in sentences(text)]
    toks = cjk(text)
    med = statistics.median(lens)
    mean = math.fsum(lens) / len(lens)
    sd = statistics.pstdev(lens)
    heads = Counter("".join(cjk(p))[:4] for p in paras)
    shared = sum(c for c in heads.values() if c > 1)
    hits = sum(text.count(t) for t in TEMPLATES)
    grams = Counter("".join(toks)[i:i + 8] for i in range(len(toks) - 7))
    rep = sum(c for c in grams.values() if c > 1) / max(1, sum(grams.values()))
    return {"chars": len(toks), "paragraphs": len(paras), "sentences": len(lens), "mean": mean,
            "sd": sd, "cv": sd / mean, "near_median": sum(abs(x - med) <= 3 for x in lens) / len(lens),
            "ttr": len(set(toks)) / len(toks), "mtld": mtld(toks), "tpl_per_1000": 1000 * hits / len(toks),
            "shared_openers": shared, "top_opener": heads.most_common(1)[0][1], "rep8": rep}


if __name__ == "__main__":
    a, b = profile(TEXT_A), profile(TEXT_B)
    print("   metric                      text A    text B")
    rows = [("CJK characters", "chars", "{:d}"), ("paragraphs", "paragraphs", "{:d}"),
            ("sentences", "sentences", "{:d}"), ("sentence length mean", "mean", "{:.2f}"),
            ("sentence length sd", "sd", "{:.2f}"), ("coefficient of variation", "cv", "{:.3f}"),
            ("share within 3 of median", "near_median", "{:.3f}"), ("type-token ratio", "ttr", "{:.3f}"),
            ("MTLD (threshold 0.72)", "mtld", "{:.1f}"), ("template hits per 1000", "tpl_per_1000", "{:.1f}"),
            ("paragraphs w/ shared opener", "shared_openers", "{:d}"),
            ("most common opener count", "top_opener", "{:d}"), ("8-gram repeat share", "rep8", "{:.3f}")]
    for label, key, fmt in rows:
        print("   {:<27s} {:>8s}  {:>8s}".format(label, fmt.format(a[key]), fmt.format(b[key])))

Single source and citation

Fan, Y. (2026). Drift Control for Parallel Multi-Window Book Writing, Cross-Volume Terminology Graph Audits and Zero-Hallucination Citation Verifiers (Version 0.1.0), Chapter 6: Style Drift: Gates for Sentence Length, Lexical Diversity, Stock Phrases and Paragraph Openers. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-152 · v0.1.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026152,
  author    = {Fan, Yafu},
  title     = {Drift Control for Parallel Multi-Window Book Writing, Cross-Volume Terminology Graph Audits and Zero-Hallucination Citation Verifiers},
  year      = {2026},
  publisher = {5D Library},
  edition   = {0.1.0},
  note      = {DOI pending}
}

Other chapter answers in this book