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

+10 -10
View File
@@ -83,7 +83,7 @@ def test_copenhagen_is_in_the_capital_region_in_denmark_in_europe() -> None:
("Copenhagen Office", ["Copenhagen"]),
("Malmö/Lund", ["Malmö", "Lund"]),
("Aalborg, Copenhagen, Kolding", ["Aalborg", "Copenhagen", "Kolding"]),
("Paderborn, Germany", ["Germany"]),
("Bopfingen, Germany", ["Germany"]),
("Skåne län, Sweden", ["Skåne"]),
("London, Ontario", ["Ontario"]),
("Bergen op Zoom, Netherlands", ["Netherlands"]),
@@ -117,7 +117,7 @@ def test_a_text_of_how_a_role_is_worked_is_no_place(text: str) -> None:
assert places.placeless(text)
@pytest.mark.parametrize("text", ["Oberkochen", "Remote, APAC", "Jena"])
@pytest.mark.parametrize("text", ["Oberkochen", "Remote, APAC", "Lauchheim"])
def test_a_text_with_a_name_is_a_place(text: str) -> None:
assert not places.placeless(text)
@@ -235,7 +235,7 @@ def uids(store: Store, *tokens: str) -> set[str]:
def several(store: Store) -> dict[str, str]:
lines = {"cph": "Copenhagen; London", "eu": "Berlin, Germany; Paris, France",
"malmo": "Malmö", "lund": "Lund, Skåne", "billund": "Billund",
"zeiss": "Oberkochen; Jena", "remote": "Remote (SE)", "ny": "New York, NY"}
"zeiss": "Oberkochen; Lauchheim", "remote": "Remote (SE)", "ny": "New York, NY"}
for key, line in lines.items():
upsert(store, posting(key, place=line))
return {key: posting(key).uid for key in lines}
@@ -312,10 +312,10 @@ def test_a_place_gate_matches_over_the_gazetteer(store: Store,
# ------------------------------------------------------------ unresolved texts
def test_unresolved_texts_are_listed_most_roles_first(store: Store) -> None:
for n, line in enumerate(("Oberkochen; Jena", "Oberkochen", "Remote", "Aalen; Berlin")):
for n, line in enumerate(("Oberkochen; Lauchheim", "Oberkochen", "Remote", "Aalen; Berlin")):
upsert(store, posting(str(n), place=line))
assert store.unresolved_places() == [("oberkochen", "Oberkochen", 2), ("aalen", "Aalen", 1),
("jena", "Jena", 1)]
("lauchheim", "Lauchheim", 1)]
assert store.unresolved_places(limit=1) == [("oberkochen", "Oberkochen", 2)]
@@ -344,12 +344,12 @@ def test_an_alias_links_what_it_names(store: Store) -> None:
def test_a_place_added_by_hand_is_resolved_and_found(store: Store) -> None:
upsert(store, posting("1", place="Oberkochen; Jena"))
upsert(store, posting("2", place="Paderborn, Germany"))
upsert(store, posting("1", place="Oberkochen; Lauchheim"))
upsert(store, posting("2", place="Bopfingen, Germany"))
oberkochen = store.add_place("Oberkochen", "city", "country:DE")
store.add_place("Paderborn", "city", "country:DE")
assert texts(store, posting("1").uid) == [(0, "Oberkochen", "Oberkochen"), (1, "Jena", "")]
assert texts(store, posting("2").uid) == [(0, "Paderborn, Germany", "Paderborn")]
store.add_place("Bopfingen", "city", "country:DE")
assert texts(store, posting("1").uid) == [(0, "Oberkochen", "Oberkochen"), (1, "Lauchheim", "")]
assert texts(store, posting("2").uid) == [(0, "Bopfingen, Germany", "Bopfingen")]
assert uids(store, "place:oberkochen") == {posting("1").uid}
assert store.gazetteer().country(oberkochen) == "DE"
with pytest.raises(ValueError):