Voynich Complete Reproducibility Compendium - 2026-08-28 Page 2649 """Attack real stream and scrambled stream; return normalised index.""" ftr, ttr = class_arrays(ustream, classmap, 0) fte, tte = class_arrays(ustream, classmap, 1) M, tr_bits = attack(ftr, ttr, m, lm, restarts=restarts, seed=seed) te = heldout_bits(fte, tte, M, lm) scr = scrambled(ustream, classmap, seed=seed + 99) sftr, sttr = class_arrays(scr, classmap, 0) sfte, stte = class_arrays(scr, classmap, 1) Ms, _ = attack(sftr, sttr, m, lm, restarts=max(4, restarts // 2), seed=seed) te_scr = heldout_bits(sfte, stte, Ms, lm) idx = (te - te_scr) / (anchor - te_scr) if anchor > te_scr else float("nan") return dict(test_bits=te, scrambled_bits=te_scr, anchor_bits=anchor, index=idx, mapping=[int(x) for x in M], train_bits=tr_bits) # ------------------------------------------------------------ voynich data -- def voynich_lines_by_language() -> dict[str, list[list[str]]]: """Paragraph-locus token lines split by Currier language ($L).""" text = (ROOT / "voynich_calibration_sources" / "ZL3b.txt").read_text( encoding="utf-8", errors="replace") attrs = {} for mm in re.finditer(r"^<([^>.]+)>\s+", text, re.M): v = dict(re.findall(r"\$([A-Z])=([^ $>]+)", mm.group(2))) attrs[mm.group(1)] = v out = defaultdict(list) for raw in text.splitlines(): lm = LOCUS_RE.match(raw) if not lm: continue page, num, marker, typ, txt = lm.groups() if typ != "P": continue toks = clean_tokens(txt) if not toks: continue lang = attrs.get(page, {}).get("L", "?") out[lang].append(toks) out["pooled"].append(toks) return dict(out)