From e241b9572ce6d734ee2c340f85d9c2121c9e4ec2 Mon Sep 17 00:00:00 2001 From: "Claude (backend session)" Date: Sat, 25 Jul 2026 01:20:42 +0300 Subject: [PATCH] Fix stale trad2simp data paths in eval after the pack-15 move to internal/text --- eval/exp15/mem_select.py | 2 +- eval/pilot/memory_eval.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eval/exp15/mem_select.py b/eval/exp15/mem_select.py index fc8a37a2..76596822 100644 --- a/eval/exp15/mem_select.py +++ b/eval/exp15/mem_select.py @@ -33,7 +33,7 @@ import regex # \p{Han} etc. — exact Unicode script tables, matching Go's unic import yaml BACKEND = Path("/home/ubuntu/projects/textmachine/backend") -TRAD2SIMP_FILE = BACKEND / "internal/pipeline/data/trad2simp.txt" +TRAD2SIMP_FILE = BACKEND / "internal/text/data/trad2simp.txt" # moved from internal/pipeline/data in pack-15 (byte-identical) MIN_KEY_LEN_HAN = 2 MIN_KEY_LEN_PHONETIC = 3 diff --git a/eval/pilot/memory_eval.py b/eval/pilot/memory_eval.py index dc7f9ccf..d7a5d9cf 100644 --- a/eval/pilot/memory_eval.py +++ b/eval/pilot/memory_eval.py @@ -90,7 +90,7 @@ ROOT = Path(__file__).resolve().parent SAMPLES = ROOT.parent / "data" / "samples" OUTDIR = ROOT.parent / "data" / "pilot" OUTDIR.mkdir(parents=True, exist_ok=True) -TRAD_TABLE = ROOT / "trad2simp.txt" # vendored from backend/internal/pipeline/data/trad2simp.txt +TRAD_TABLE = ROOT / "trad2simp.txt" # vendored from backend/internal/text/data/trad2simp.txt # --- normalization (faithful mirror of memnorm.go) -------------------------------- @@ -104,7 +104,7 @@ def _load_trad2simp(path: Path) -> dict[str, str]: m: dict[str, str] = {} if not path.exists(): raise SystemExit(f"memory_eval: vendored trad2simp table missing: {path}\n" - f" cp backend/internal/pipeline/data/trad2simp.txt {path}") + f" cp backend/internal/text/data/trad2simp.txt {path}") for i, line in enumerate(path.read_text(encoding="utf-8").splitlines(), 1): s = line.strip() if not s or s.startswith("#"): @@ -765,7 +765,7 @@ def self_test() -> int: # İ→lower Go-parity (parity-review #1): norm_src must fold İ to 'i' (Python .lower() → 'i̇') check(norm_src("İ") == "i" and dm.normalize_target("İ") == "i", "İ: not folded to Go's lowercase 'i'") # trad2simp byte-parity with the Go embed (package-2 Task 1d): the vendored table must stay - # byte-identical to backend/internal/pipeline/data/trad2simp.txt (memoryNormVersion hashes its + # byte-identical to backend/internal/text/data/trad2simp.txt (memoryNormVersion hashes its # bytes) — a drift silently diverges the normalizers. Skipped if the Go source isn't checked out. go_embed = ROOT.parent.parent / "backend" / "internal" / "pipeline" / "data" / "trad2simp.txt" if go_embed.exists():