What does Drift Control for Multi-Window Writing conclude, in numbers, about “Number Parity and Duplicate Sentences: Bilingual Agreement, Program Reconciliation and Near-Duplicate Detection”?
Answer: Number reconciliation checks two things: the sets of checkable numbers in the Chinese and English drafts are equal, and every checkable number in the prose can be found in a program's output or source. Its blind spots come from its own definition: digits glued to Chinese characters are invisible, comma-less integers in the year band are never checked, 386.5 and 386.50 count as two numbers, and 1,032 with a comma cannot be found in an output that prints it without one. The patches are conventions: spaces around numerals, thousands commas on every non-year large integer, and programs printing exactly the format the prose will copy. Duplicate detection has two layers. Verbatim repeats of 20 characters or more use a dictionary or 64-bit fingerprints, with normalisation limited to NFKC, whitespace removal and dropping the closing mark. Reworded near-duplicates use 2- to 3-character shingles, MinHash signatures and banded candidates, closed by an exact Jaccard check. Splits and thresholds are not copied from elsewhere but set from the cost ratio of misses to false alarms; under this chapter's assumptions, 64×2 with a threshold of 0.35 has the lowest expected cost per book.
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: 1032, 386.5, 386.50
| output tokens | 0.027 0.418 2384 386.50 dropped as year band: 1032 |
| zh tokens | 2384 386.5 2.7% 0.418 |
| zh year band, not checked | 2019 1999 |
| reconcile | 2384 -> exact |
| reconcile | 386.5 -> MISSING |
| reconcile | 2.7% -> as 0.027 |
| reconcile | 0.418 -> exact |
| en tokens | 2348 386.5 2.7% 0.418 1032 |
| en year band, not checked | 2019 1998 |
| reconcile | 2348 -> MISSING |
| reconcile | 386.5 -> MISSING |
| reconcile | 2.7% -> as 0.027 |
| reconcile | 0.418 -> exact |
| reconcile | 1032 -> MISSING |
| parity only zh: ['2384'] only en: ['1032', '2348'] | |
| year band only zh: ['1999'] only en: ['1998'] (invisible to the rule) | |
| zh numbers glued to a CJK character: ['1,032'] | |
| written as | 1999: checked = False |
| written as | 1,999: checked = True |
| written as 386.50: checked = True | |
| written as 0.4180: checked = True |
Show the full program
# Chapter 4. p40: Checkable numbers in a fictional zh/en paragraph pair: parity and output reconciliation.
# The token rule is the publishing house's: a number counts when it has a decimal point, or when it is an
# integer >= 1000 that is not a bare year (1000..2100 written without a thousands comma). A percentage
# "2.7%" may also be matched by the printed fraction 0.027. The regex refuses a number glued to a word
# character on either side; in Python 3 every CJK character is a word character.
# All names and figures below are fictional.
import re
NUM = re.compile(r"(?<![\w.])[+\-]?(\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+\.\d+|\d+)(?![\w])(\s?%)?")
ZH = ("青梧工作室去年接单 2,384 件,客单价 386.5 元,退款率 2.7%,毛利率 0.418;2019 年开业,"
"旗舰套餐定价 1999 元,回款周期 45 天,复购客户共1,032位。")
EN = ("Qingwu Studio took 2,348 orders last year at an average ticket of 386.5, a refund rate of 2.7% "
"and a gross margin of 0.418; it opened in 2019, prices its flagship bundle at 1998, collects in "
"45 days and has 1,032 repeat clients.")
OUTPUT = "orders 2384\nmean_ticket 386.50\nrefund_rate 0.027\ngross_margin 0.418\nrepeat_clients 1032"
def scan(text):
"""Return (checked tokens with percent flag, year-band integers that the rule skips)."""
checked, band = [], []
for m in NUM.finditer(text):
raw = m.group(1)
plain = raw.replace(",", "")
if "." not in plain:
v = int(plain)
if v < 1000:
continue
if "," not in raw and v <= 2100:
band.append(plain)
continue
checked.append((plain, bool(m.group(2))))
return checked, band
def frac(tok):
d = len(tok.split(".")[1]) if "." in tok else 0
return "{:.{}f}".format(float(tok) / 100.0, d + 2)
def main():
out_tokens = {t for t, _ in scan(OUTPUT)[0]}
print("output tokens: {} dropped as year band: {}".format(" ".join(sorted(out_tokens)),
" ".join(scan(OUTPUT)[1])))
sets, bands = {}, {}
for lang, text in (("zh", ZH), ("en", EN)):
checked, band = scan(text)
sets[lang] = {t for t, _ in checked}
bands[lang] = set(band)
print("{} tokens: {}".format(lang, " ".join(t + ("%" if p else "") for t, p in checked)))
print("{} year band, not checked: {}".format(lang, " ".join(band)))
for t, p in checked:
hit = t in out_tokens or (p and frac(t) in out_tokens)
how = "as " + frac(t) if p and frac(t) in out_tokens else ("exact" if hit else "MISSING")
print(" reconcile {:>7} -> {}".format(t + ("%" if p else ""), how))
print("parity only zh: {} only en: {}".format(sorted(sets["zh"] - sets["en"]),
sorted(sets["en"] - sets["zh"])))
print("year band only zh: {} only en: {} (invisible to the rule)".format(
sorted(bands["zh"] - bands["en"]), sorted(bands["en"] - bands["zh"])))
glued = re.findall(r"[一-鿿](\d[\d,.]*)|(\d[\d,.]*)[一-鿿]", ZH)
print("zh numbers glued to a CJK character: {}".format([a or b for a, b in glued]))
for s in ("1999", "1,999", "386.50", "0.4180"):
print(" written as {:>6}: checked = {}".format(s, bool(scan(s)[0])))
if __name__ == "__main__":
main()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 4: Number Parity and Duplicate Sentences: Bilingual Agreement, Program Reconciliation and Near-Duplicate Detection. 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
- Chapter 1 · Method: Five Failure Modes, Exclusive Locks and the Four Methods of Collation
- Chapter 2 · Concurrency Control: Exclusive-Create Locks, Leases, Version Numbers and Wave Scheduling
- Chapter 3 · The Terminology Graph: Lock Tables, Synonym Drift and Cross-Volume Consistency Audits
- Chapter 5 · A Zero-Hallucination Citation Verifier: Fields, Identifiers, Ledger Matching and Item-by-Item Verdicts
- Chapter 6 · Style Drift: Gates for Sentence Length, Lexical Diversity, Stock Phrases and Paragraph Openers
- Chapter 8 · Practice: Four Windows Write a Nine-Chapter Book, Five Classes of Injected Error and the Detection Ledger of Four Gates