Files
sim-numerics/check_new_numbers.py
T
vvsandClaude Opus 5 0a62f7babb Revision step 3: restructured and shortened paper, full listing of A', code availability.
Title: 'Root Finding by Similarity and Analogy: A Bracketing Method with a Data-Selected Decision Layer'. Abstract 246 words. Main text 10.4k words (was 17.4k): search reports moved to Appendices A (old 6-7), B (wall-clock), C (negative results); revision history removed; pronouns for Chandrupatla's method fixed; tables numbered in order. New: Algorithm 2 (complete A'), the decision layer counted honestly in 6.5, Code and data availability, Appendix D (30 pre-registrations against the first commit of their own results, read from git by check_prereg_order.py: 25 before, 4 same commit, 1 decided on the smoke; A' frozen at 8027d7f between corpus 4's definition 657df10 and its results 6d2531e). Literature: Bus & Dekker 1975, Fernandez-Diaz & Menendez-Perez 2023 (two dimensionless parameters; SFRFm on sign(f)|f|^(1/m) with known multiplicity - the nearest precursor of the split), Cordero-Neta-Torregrosa 2021; Illinois and Ridders cited. verify_article: explicit check that every head-to-head row sums to its set. check_new_numbers.py: no number new to the text except headings, references, hashes. Server: verify 527 OK / 0 BAD, regression x2 1232 passed, PDF 30 pages, 0 errors, 0 undefined, 0 overfull.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 08:18:30 +01:00

31 lines
1002 B
Python

"""After an editorial pass: every number in the new article that was not in the old one, with its
context - a transcription slip shows up here. Numbers only removed are fine (verify_article.py
checks the data, and a removed statement claims nothing).
python -u check_new_numbers.py OLD.md NEW.md
"""
import re
import sys
NUM = re.compile(r"(?<![\w.])\d+(?:\.\d+)?(?![\w])")
def nums(text):
return set(NUM.findall(text))
def main(old_path, new_path):
old = open(old_path, encoding="utf8").read()
new = open(new_path, encoding="utf8").read()
fresh = sorted(nums(new) - nums(old), key=lambda s: float(s))
print(f"{len(fresh)} numbers in the new text that the old one did not contain")
for n in fresh:
for m in re.finditer(rf"(?<![\w.]){re.escape(n)}(?![\w])", new):
print(f" {n:>10}: ...{new[max(0, m.start() - 60):m.end() + 30]!r}...")
break
print("new numbers done")
if __name__ == "__main__":
main(sys.argv[1], sys.argv[2])