Link the obvious towns of the Unmapped list: 460 unlinked place texts down to 50

About 190 German towns (mostly 1KOMMA5°'s) and the German states, French,
Italian, Dutch, Asian and other towns, the ISO3 codes and German or French
country names boards write. Towns keep their marks through spelling groups.
The tests that used Paderborn, Jena and Überlingen as unknown towns use
Bopfingen, Lauchheim and Ellwangen instead. Left: names that are no place,
ambiguous ones (Halifax, Richmond, Victoria, Durham, Warwick) and bare codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 13:34:27 +02:00
1 parent 19401cfc7a
commit 3e3060ba50
6 files changed
+188 -85

No files matched your search

+7 -7
View File
@@ -275,12 +275,12 @@ def test_a_changed_table_maps_every_open_role_again_without_a_pull(store: Store)
def test_a_town_added_to_the_code_is_linked_at_the_next_prep(
store: Store, monkeypatch: pytest.MonkeyPatch) -> None:
store.upsert_role(item("1", places=[{"text": "Überlingen", "remote": None}]))
store.upsert_role(item("1", places=[{"text": "Ellwangen", "remote": None}]))
prep.run(store, tables=TABLES)
assert [p["text"] for p in store.unlinked_places()] == ["Überlingen"]
assert [p["text"] for p in store.unlinked_places()] == ["Ellwangen"]
assert row(store, "1")["country"] == ""
monkeypatch.setitem(models._CITIES, "uberlingen", "DE")
monkeypatch.setitem(models._CITIES, "ellwangen", "DE")
done = prep.run(store, tables=TABLES)
assert done.remapped
assert store.unlinked_places() == []
@@ -340,9 +340,9 @@ def test_app_prep_runs_and_lists_the_unmapped_words(
assert json.loads(capsys.readouterr().out)["read"] == 1
assert cli.main(["-c", str(path), "prep", "unmapped"]) == 0
assert capsys.readouterr().out.split() == ["seniority", "acme", "1", "grand", "poobah"]
Store(tmp_path / "roledesk.db").upsert_role(item("2", place="Überlingen"))
Store(tmp_path / "roledesk.db").upsert_role(item("2", place="Ellwangen"))
assert cli.main(["-c", str(path), "prep", "unlinked"]) == 0
assert capsys.readouterr().out.split() == ["1", "Überlingen", "-:1", "Acme"]
assert capsys.readouterr().out.split() == ["1", "Ellwangen", "-:1", "Acme"]
assert cli.main(["-c", str(path), "prep", "--remap"]) == 0
assert json.loads(capsys.readouterr().out)["remapped"] is True
@@ -371,11 +371,11 @@ def test_the_api_lists_the_unlinked_places(tmp_path: Path) -> None:
app = create_app(Config(server=ServerConfig(host="127.0.0.1", port=0),
database=tmp_path / "roledesk.db"))
app.state.store.upsert_role(item("1", place="Überlingen", country="DE"))
app.state.store.upsert_role(item("1", place="Ellwangen", country="DE"))
prep.run(app.state.store, tables=TABLES)
with TestClient(app) as client:
found = client.get("/api/prep/unlinked").json()
assert found == [{"fold": "uberlingen", "text": "Überlingen", "roles": 1,
assert found == [{"fold": "ellwangen", "text": "Ellwangen", "roles": 1,
"countries": [["DE", 1]], "companies": ["Acme"]}]