diff --git a/tools/import-normalizer/README.md b/tools/import-normalizer/README.md index 97b77110..ca820519 100644 --- a/tools/import-normalizer/README.md +++ b/tools/import-normalizer/README.md @@ -25,15 +25,16 @@ Outputs: | Review file | What to do | | --- | --- | | `unparsed-dates.csv` | For each `raw` (sorted by frequency), fill `suggested_iso` + `suggested_precision`, then paste `raw,suggested_iso,suggested_precision` into `overrides/dates.csv` (header `raw,iso,precision`). | -| `unmatched-names.csv` | If `suggested_id` is right, copy `raw,suggested_id` into `overrides/names.csv`; else look up the correct id in `out/canonical-persons.xlsx` (the `person_id` column). | -| `unresolved-names.csv` | Names whose value is itself problematic, grouped by `category`: `unknown` (`?`/illegible), `single_token` (first OR last name only), `relational` (`Tante …`), `collective` (`Familie …`), `prose` (a description landed in a name column), `ambiguous_pair` (two given names → likely two people, not auto-split). Review highest-impact categories first; add decisions to `overrides/names.csv`. | +| `unresolved-names.csv` | Names whose value is itself problematic, grouped by `category`: `unknown` (`?`/illegible), `single_token` (first OR last name only), `relational` (`Tante …`), `collective` (`Familie …`), `prose` (a description landed in a name column), `ambiguous_pair` (two given names → likely two people, not auto-split). Review highest-impact categories first; add decisions to `overrides/names.csv` (look up valid ids in `out/canonical-persons.xlsx`). | | `index-file-mismatch.csv` | The `Datei` path disagrees with the index-derived filename — reconcile when the PDFs arrive. | | `duplicate-index.csv`, `blank-index-rows.csv`, `skipped-x-suffix.csv` | Inspect; fix in the source spreadsheet if needed. | -> `unresolved-names.csv` is the focused "names that need a human" list — distinct from -> `unmatched-names.csv` (which is just non-family correspondents that got provisional persons). -> The given-name set that drives `ambiguous_pair` detection is the register's first names plus -> `config.EXTRA_GIVEN_NAMES` — add names there if a real two-person cell isn't being flagged. +> `unresolved-names.csv` is the focused "names that need a human" list. Non-family +> correspondents that simply aren't in the register are NOT reported — they just become +> provisional persons in `out/canonical-persons.xlsx` (the `unmatched_name_strings` count in +> `summary.txt` tracks how many). The given-name set that drives `ambiguous_pair` detection is +> the register's first names plus `config.EXTRA_GIVEN_NAMES` — add names there if a real +> two-person cell isn't being flagged. **Valid `person_id` values** all come from the `person_id` column of `out/canonical-persons.xlsx`. diff --git a/tools/import-normalizer/normalize.py b/tools/import-normalizer/normalize.py index e9840c34..5e821c77 100644 --- a/tools/import-normalizer/normalize.py +++ b/tools/import-normalizer/normalize.py @@ -83,14 +83,6 @@ def run(*, document_workbook, document_sheet, person_workbook, person_sheet, writers.write_review_csv(review_dir / "unparsed-dates.csv", ["raw", "count", "example_rows", "suggested_iso", "suggested_precision"], unparsed_rows) - unmatched_rows = [] - for name, rows in sorted(ctx.unmatched.items()): - sid, score = alias_index.suggest(name) - unmatched_rows.append([name, len(rows), " ".join(map(str, rows[:5])), - sid or "", f"{score:.2f}" if sid else ""]) - writers.write_review_csv(review_dir / "unmatched-names.csv", - ["raw", "count", "example_rows", "suggested_id", "suggested_score"], unmatched_rows) - writers.write_review_csv(review_dir / "duplicate-index.csv", ["source_row", "index"], duplicates) writers.write_review_csv(review_dir / "blank-index-rows.csv", ["source_row", "kind", "content"], blank_index) writers.write_review_csv(review_dir / "skipped-x-suffix.csv", ["source_row", "index", "base_index"], skipped_x)