Word list export includes LT top replacement - helps separate typos from abbreviations

This commit is contained in:
Sadmin committed 2026-11-02 17:33:09 +03:00
1 parent 7df303ba0e
commit 35ca06dd6b
2 files changed
+10 -3

No files matched your search

+8 -1
View File
@@ -422,11 +422,18 @@ def run_job(job_id: str, data: bytes, filename: str, use_llm: bool):
for it in items:
counts[it["kind"]] = counts.get(it["kind"], 0) + 1
frag_counts = Counter()
frag_first_repl: dict = {}
for it in items:
frag = (it.get("fragment") or "").strip().lower()
if frag:
frag_counts[frag] += 1
fragments_top = [{"fragment": k, "count": v} for k, v in frag_counts.most_common(100)]
if frag not in frag_first_repl:
repls = it.get("replacements") or []
frag_first_repl[frag] = repls[0] if repls else ""
fragments_top = [
{"fragment": k, "count": v, "top_replacement": frag_first_repl.get(k, "")}
for k, v in frag_counts.most_common(100)
]
page_acc = 0
page_map = []
for p in paras: