Voynich Complete Reproducibility Compendium - 2026-08-28 Page 1796 archive/local/external_voynich_units/voynich_decipherme nt_repro_bundle/decipherment_attack/plant_crib_attack.p y SHA-256: 944a7028a8977f51cc5d36a1b746c3c450afaec5503e1a34f0d32e56cb41b026 | 11,294 bytes | workspace supplement #!/usr/bin/env python3 """Anchor-first Voynich decipherment attack. Use external iconographic claims already present in the ZL metadata ("same plant as ...") as semantic cribs. For each linked herbal page, identify the nearby pharmaceutical labels on the referenced page and rank them by whether the same surface family is unusually present in the full herbal-page text. This is not a generic statistics battery. Its output is a tentative bilingual codebook: Voynich label/family -> proposed plant identity, with explicit strength and counter-evidence. """ from __future__ import annotations import argparse import csv import json import math import re from collections import Counter, defaultdict from dataclasses import dataclass, field from pathlib import Path from statistics import median PAGE_RE = re.compile(r'^<([^>.]+)>\s+.]+)\.(\d+),([@+*=~&])([A-Za-z])[^>]*>\s*(.*)$') REF_RE = re.compile(r'Same\s+(?:plant|root|leaf)\s+as\s+(f\d+[rv](?:\d)?)\s*(?:\[\s*(\d+)\s*,\s*(\d+)\s*\])?', re.I) PLANT_RE = re.compile(r'Plant ID:\s*(.*)', re.I) BAD = set('?*<>{}[]()|@') SUBS = [ ('cth','T'), ('ckh','K'), ('cph','P'), ('cfh','F'), ('ch','C'), ('sh','S'), ('iin','N'), ('in','I'), ('ee','E') ] def strip_markup(s: str) -> str: s = re.sub(r'<[^>]*>', '', s) s = re.sub(r'\[([^:\]]*):[^\]]*\]', r'\1', s) s = re.sub(r'\{[^}]*\}', '', s) s = s.replace("'", '') return s def collapse(w: str) -> str: w = w.lower().strip() for a, b in SUBS: w = w.replace(a, b) return w def clean_tokens(s: str) -> list[str]: s = strip_markup(s) out = [] for w in re.split(r'[.,\s]+', s): w = w.strip().lower() if not w or any(c in BAD for c in w): continue if not re.fullmatch(r"[a-z]+", w): continue out.append(w) return out @dataclass class Label: raw: str collapsed: str locus: str line_no: int block: int @dataclass class Page: name: str comments: list[str] = field(default_factory=list) plant_id: str | None = None refs: list[tuple[str, int | None, int | None, str]] = field(default_factory=list) paragraph_tokens: list[str] = field(default_factory=list) labels: list[Label] = field(default_factory=list) def parse_zl(path: Path) -> dict[str, Page]: pages: dict[str, Page] = {}