removed highlighting text. Added in magnifying words left side, sync scrolling, keyboard shortcuts, editing text etc

This commit is contained in:
nathan
2026-05-11 10:24:32 -04:00
parent 7b059390bd
commit 77323821cb
2 changed files with 10 additions and 8 deletions

View File

@@ -6,9 +6,11 @@ Outputs a JSON array of position objects.
import re
import json
from html.parser import HTMLParser
from pathlib import Path
INPUT_FILE = r"C:\Users\natha\IdeaProjects\AI-Prototype\Inputs\ocr-output\Calgary-Highlanders_War-Diary_Sep44_olmocr.md"
OUTPUT_FILE = r"C:\Users\natha\IdeaProjects\AI-Prototype\outputs\Calgary-Highlanders_Sep44_positions.json"
_PROJECT_ROOT = Path(__file__).resolve().parent.parent
INPUT_FILE = _PROJECT_ROOT / "Inputs" / "ocr-output" / "Calgary-Highlanders_War-Diary_Sep44_olmocr.md"
OUTPUT_FILE = _PROJECT_ROOT / "outputs" / "Calgary-Highlanders_Sep44_positions.json"
# ── helpers ──────────────────────────────────────────────────────────────────
@@ -671,10 +673,8 @@ def assign_end_of_day(positions: list[dict]) -> list[dict]:
# ── run ───────────────────────────────────────────────────────────────────────
if __name__ == "__main__":
import pathlib
print("Reading source file …")
text = pathlib.Path(INPUT_FILE).read_text(encoding="utf-8")
text = INPUT_FILE.read_text(encoding="utf-8")
print("Extracting positions …")
positions = extract_positions(text)
@@ -691,8 +691,8 @@ if __name__ == "__main__":
print("Assigning end-of-day flags …")
unique = assign_end_of_day(unique)
pathlib.Path(OUTPUT_FILE).parent.mkdir(parents=True, exist_ok=True)
pathlib.Path(OUTPUT_FILE).write_text(
OUTPUT_FILE.parent.mkdir(parents=True, exist_ok=True)
OUTPUT_FILE.write_text(
json.dumps(unique, indent=2, ensure_ascii=False),
encoding="utf-8"
)
@@ -716,6 +716,8 @@ if __name__ == "__main__":