Aziel Eliab · GodLock.AZ · decryption_complete is false. Cap-7 is not an ICANN name. Paid satellite stays HELD. These pages show the archive file. They do not say the manuscript is decrypted.

Voynich Master Archive - Volume 03 - Pages 2001-3000

Chinese classical control text, plus later workspace supplement files in the same PDF

PDF page 303 of 1000. Catalog page range 2001-3000.

First Previous Next Last Plain text of this page PDF at this page

Extracted text

Voynich Complete Reproducibility Compendium - 2026-08-28 Page 2302
archive/local/external_voynich_units/voynich_decipherme
nt_repro_bundle/decipherment_attack_v5/e3_positional.p
y
SHA-256: 7cddd55facbc6accadb7f3de4ba7c20256c6aceb3e43a9fb276c614a8ce79894 | 3,275 bytes | workspace supplement
#!/usr/bin/env python3
"""E3: positional vs sequential information.
If a line is a syntactic sentence, a token's identity is constrained mostly by
its neighbours (sequential MI >> positional MI).  If a line is a record/list
entry with fields, identity is constrained mostly by the slot it occupies
(positional MI competitive with or exceeding sequential MI).
Both quantities are shuffle-corrected plug-in MI over the same symbol stream
(top-2000 types), so they are directly comparable.
"""
from __future__ import annotations
import json, math, random, sys
from collections import Counter
from pathlib import Path
SCRATCH = Path(__file__).resolve().parent
sys.path.insert(0, str(SCRATCH))
from unit_probe import voynich_lines, latin_words, to_lines, collapse
def posbin(i, n):
    if i == 0: return "first"
    if i == n-1: return "last"
    if n <= 3: return "mid"
    q = (i-1)/(n-2) if n > 3 else 0.5
    return f"q{min(3, int(q*4))}"
def mi_pairs(pairs):
    uni_a, uni_b, joint = Counter(), Counter(), Counter()
    for a, b in pairs:
        uni_a[a] += 1; uni_b[b] += 1; joint[(a, b)] += 1
    n = sum(joint.values())
    h = lambda cnt: -sum(c/n*math.log2(c/n) for c in cnt.values())
    return h(uni_a) + h(uni_b) - h(joint)
def analyse(name, lines, n_shuffles=60):
    freq = Counter(w for ln in lines for w in ln)
    keep = {t for t, _ in freq.most_common(2000)}
    sym = lambda w: w if w in keep else "<unk>"
    sls = [[sym(w) for w in ln] for ln in lines if len(ln) >= 2]
    r = random.Random(5)
    seq_pairs = [(a, b) for ln in sls for a, b in zip(ln, ln[1:])]
    pos_pairs = [(w, posbin(i, len(ln))) for ln in sls for i, w in enumerate(ln)]
    seq_obs, pos_obs = mi_pairs(seq_pairs), mi_pairs(pos_pairs)
    seq_null, pos_null = [], []
    flat = [w for ln in sls for w in ln]
    lens = [len(ln) for ln in sls]
    for _ in range(n_shuffles):
        # sequential null: shuffle within lines (kills order, keeps line makeup)
        s = [list(ln) for ln in sls]
        for ln in s:
            r.shuffle(ln)
        seq_null.append(mi_pairs([(a, b) for ln in s for a, b in zip(ln, ln[1:])]))
        # positional null: shuffle tokens across the corpus, keep line lengths
        f = flat[:]
        r.shuffle(f)
        it = iter(f)
        s2 = [[next(it) for _ in range(L)] for L in lens]
        pos_null.append(mi_pairs([(w, posbin(i, len(ln)))
                                  for ln in s2 for i, w in enumerate(ln)]))
    seq_ex = seq_obs - sum(seq_null)/len(seq_null)
    pos_ex = pos_obs - sum(pos_null)/len(pos_null)
    H1 = mi_pairs([(w, w) for w in flat])  # = unigram entropy
    print(f"{name:10s} H1={H1:.2f}  seq excess={seq_ex:.4f}b ({seq_ex/H1*100:.2f}%)  "
          f"pos excess={pos_ex:.4f}b ({pos_ex/H1*100:.2f}%)  pos/seq={pos_ex/seq_ex:.2f}",
          flush=True)
    return dict(H1=H1, seq_excess=seq_ex, pos_excess=pos_ex,
                seq_share=seq_ex/H1, pos_share=pos_ex/H1)
if __name__ == "__main__":
    vy = [[collapse(w) for w in ln] for ln in voynich_lines()]
    lat = to_lines(latin_words())   # pseudo-lines: positional MI should be ~0
    out = {"voynich": analyse("voynich", vy), "latin": analyse("latin", lat)}
    (SCRATCH / "output" / "e3_results.json").write_text(json.dumps(out, indent=2))