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

+43 -5
View File
@@ -179,6 +179,27 @@ _ALIAS_GROUPS: tuple[tuple[str, ...], ...] = (
("Timișoara", "Timisoara"),
("Marseille", "Marseilles"),
("Bolzano", "Bozen"),
("Padua", "Padova"),
("Forlì",),
("L'Aquila",),
("Massa-Carrara", "Massa Carrara"),
# France, with the marks and hyphens a fold drops
("Aix-en-Provence",), ("Bourg-en-Bresse",), ("Boulogne-sur-Mer",), ("Chambéry",),
("Clermont-Ferrand",), ("La Roche-sur-Yon",), ("Les Sables-d'Olonne",), ("Loudéac",),
("Nîmes",), ("Orléans",), ("Rezé",), ("Saint-Brieuc",), ("Saint-Étienne",),
("Saint-Herblain",), ("Saint-Malo",), ("Saint-Nazaire",), ("Saint-Ouen-l'Aumône",),
# Germany, likewise
("Annaberg-Buchholz",), ("Baden-Baden",), ("Bietigheim-Bissingen",), ("Böblingen",),
("Donauwörth",), ("Flörsheim", "Flohrsheim"), ("Fürth",), ("Gießen", "Giessen"),
("Göppingen",), ("Großostheim",), ("Günzburg",), ("Güstrow",), ("Halle (Saale)",),
("Höxter",), ("Idar-Oberstein",), ("Königsbrunn",), ("Künzelsau",), ("Lörrach",),
("Lüchow",), ("Meißen", "Meissen"), ("Möhnesee",), ("Mönchengladbach",), ("Mühldorf",),
("Mülheim",), ("Neumünster",), ("Nördlingen",), ("Öhringen",), ("Ribnitz-Damgarten",),
("Röbel",), ("Schwäbisch Gmünd",), ("Schwäbisch Hall",), ("Überlingen",),
("Villingen-Schwenningen",), ("Waren an der Müritz",), ("Wolfenbüttel",),
# Elsewhere
("Cegléd",), ("Brașov", "Brasov"), ("Älmhult",), ("Hornbæk",), ("Melaka", "Malacca"),
("Samut Prakan", "Samut Prakarn"), ("Xi'an",), ("Ho Chi Minh City", "Ho Chi Minh"),
)
@@ -305,13 +326,30 @@ _ORESUND = Region(
_split("Øresund, Öresund, Oresund, Oresund Region, Øresundsregionen, Öresundsregionen"),
(), includes=("hovedstaden", "skane"))
# Germany's by the names boards write for a remote role's area, towns not
# listed: a town in Germany is found through the country.
# Germany's states and the areas boards write for a remote role's area, by
# name, towns not listed: a town in Germany is found through the country.
_GERMANY = tuple(Region(key, label, _split(names), (), "DE") for key, label, names in (
("niedersachsen", "Niedersachsen", "Niedersachsen, Lower Saxony"),
("norddeutschland", "Norddeutschland", "Norddeutschland, Northern Germany"),
("ostdeutschland", "Ostdeutschland", "Ostdeutschland, Eastern Germany"),
("suddeutschland", "Süddeutschland", "Süddeutschland, Southern Germany")))
("suddeutschland", "Süddeutschland", "Süddeutschland, Southern Germany"),
("baden-wurttemberg", "Baden-Württemberg", "Baden-Württemberg"),
("bayern", "Bayern", "Bayern, Bavaria"),
("brandenburg", "Brandenburg", "Brandenburg"),
("hessen", "Hessen", "Hessen, Hesse"),
("mecklenburg-vorpommern", "Mecklenburg-Vorpommern",
"Mecklenburg-Vorpommern, Mecklenburg-Western Pomerania"),
("nordrhein-westfalen", "Nordrhein-Westfalen", "Nordrhein-Westfalen, North Rhine-Westphalia, NRW"),
("rheinland-pfalz", "Rheinland-Pfalz", "Rheinland-Pfalz, Rhineland-Palatinate"),
("saarland", "Saarland", "Saarland"),
("sachsen", "Sachsen", "Sachsen, Saxony"),
("sachsen-anhalt", "Sachsen-Anhalt", "Sachsen-Anhalt, Saxony-Anhalt"),
("schleswig-holstein", "Schleswig-Holstein", "Schleswig-Holstein"),
("thuringen", "Thüringen", "Thüringen, Thuringia"),
("bodensee", "Bodensee", "Bodensee, Lake Constance"),
("harz", "Harz", "Harz"),
("rugen", "Rügen", "Rügen"),
("uckermark", "Uckermark", "Uckermark")))
REGIONS: dict[str, Region] = {
r.key: r for r in (_SKANE, _HOVEDSTADEN, _ZEALAND, _ORESUND, _JUTLAND, _FUNEN, *_GERMANY)}
@@ -694,7 +732,7 @@ KINDS: tuple[str, ...] = ("continent", "country", "region", "city")
#: Entries of `_CITIES` that name a region rather than a town.
_CITY_REGIONS = frozenset(("new south wales", "queensland", "surrey", "sussex", "east anglia",
"bay area"))
"bay area", "emilia romagna", "tuscany", "lazio"))
#: Words a place text holds when it names how or where-ever a role is worked
#: rather than a place: "Remote", "Multiple Locations", "Home based". A text
@@ -922,7 +960,7 @@ class Gazetteer:
def resolve(self, text: str) -> tuple[int, ...]:
"""The places one place text names, most specific first from the left:
`Aarhus N, Region Central Jutland, Denmark` is Aarhus, `Malmö/Lund`
is Malmö and Lund, `Paderborn, Germany` is Germany, `Remote` is none.
is Malmö and Lund, `Ellwangen, Germany` is Germany, `Remote` is none.
Every alias the text holds as whole words is a candidate, longest
first. A fold that names several places is the one in the country