"""Exploratory punctuation-first sensitivity; does not change any of the original three slots.
Run: python -B layout_206_marked.py output.json
"""
from layout_205_select import *
def main2():
    f=evidence_dir()/'liber-primus__transcription--master.txt';raw=f.read_text();m=mask('%'.join(raw[raw.index('ᚱ-'):].split('%')[15:71]));ts=tokens_masked(m)
    p=main();assert hashlib.sha256(m.encode()).hexdigest()==p['masked_utf8_sha256']
    reserved=[(x,x+w['length']) for w in p['selected'] for x in [w['a'],w['b']]]
    all_marked=select(ts,8,EXCLUDE,3,marked_only=True)
    remaining=select(ts,8,EXCLUDE,3,marked_only=True,reserved=reserved)
    return dict(source_sha256=p['source_sha256'],masked_utf8_sha256=p['masked_utf8_sha256'],primary_reserved=reserved,marked_first_no_reservation=all_marked['selected'],marked_first_disjoint=remaining['selected'],primary_eligible_by_length_marking=p['pairs'])
if __name__=='__main__':Path(sys.argv[1]).write_text(json.dumps(main2(),indent=2,ensure_ascii=False)+'\n')
