Merge the Danish region names of Akademikernes Jobbank into the gazetteer (wp-rev-places)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-10-05 09:33:38 +02:00
commit 56a0bb8558
2 files changed
+22 -4

No files matched your search

+7 -4
View File
@@ -283,7 +283,8 @@ _SKANE = Region(
_HOVEDSTADEN = Region( _HOVEDSTADEN = Region(
"hovedstaden", "Capital Region of Denmark", "hovedstaden", "Capital Region of Denmark",
_split("Capital Region of Denmark, Capital Region Denmark, Region Hovedstaden, Hovedstaden"), _split("""Capital Region of Denmark, Capital Region Denmark, Region Hovedstaden, Hovedstaden,
Storkøbenhavn, Nordsjælland"""),
_split("""København, Copenhagen, Frederiksberg, Albertslund, Allerød, Ballerup, _split("""København, Copenhagen, Frederiksberg, Albertslund, Allerød, Ballerup,
Bornholm, Brøndby, Dragør, Egedal, Fredensborg, Frederikssund, Furesø, Gentofte, Bornholm, Brøndby, Dragør, Egedal, Fredensborg, Frederikssund, Furesø, Gentofte,
Gladsaxe, Glostrup, Gribskov, Halsnæs, Helsingør, Herlev, Hillerød, Hvidovre, Gladsaxe, Glostrup, Gribskov, Halsnæs, Helsingør, Herlev, Hillerød, Hvidovre,
@@ -303,7 +304,8 @@ _HOVEDSTADEN = Region(
# The bare word is left out of `names` since "New Zealand" would match it. # The bare word is left out of `names` since "New Zealand" would match it.
_ZEALAND = Region( _ZEALAND = Region(
"zealand", "Zealand", "zealand", "Zealand",
_split("Region Zealand, Region Sjælland, Zealand Denmark, Sjælland, Sjaelland"), _split("""Region Zealand, Region Sjælland, Zealand Denmark, Sjælland, Sjaelland,
Østsjælland, Vestsjælland, Sydsjælland"""),
_split("""Faxe, Greve, Guldborgsund, Holbæk, Kalundborg, Køge, Lejre, Lolland, Næstved, _split("""Faxe, Greve, Guldborgsund, Holbæk, Kalundborg, Køge, Lejre, Lolland, Næstved,
Odsherred, Ringsted, Roskilde, Slagelse, Solrød, Sorø, Stevns, Vordingborg, Odsherred, Ringsted, Roskilde, Slagelse, Solrød, Sorø, Stevns, Vordingborg,
Nykøbing Falster, Nykøbing F, Nykøbing Sjælland, Nakskov, Maribo, Sakskøbing, Nykøbing Falster, Nykøbing F, Nykøbing Sjælland, Nakskov, Maribo, Sakskøbing,
@@ -316,7 +318,7 @@ _JUTLAND = Region(
"jutland", "Jutland", "jutland", "Jutland",
_split("""Jutland, Jylland, Central Jutland, Midtjylland, Region Midtjylland, _split("""Jutland, Jylland, Central Jutland, Midtjylland, Region Midtjylland,
North Jutland, Nordjylland, Region Nordjylland, South Jutland, Sønderjylland, North Jutland, Nordjylland, Region Nordjylland, South Jutland, Sønderjylland,
East Jutland, West Jutland, Vestjylland, Østjylland"""), East Jutland, West Jutland, Vestjylland, Østjylland, Sydøstjylland, Sydvestjylland"""),
_split("""Aarhus, Aalborg, Esbjerg, Randers, Kolding, Horsens, Vejle, Silkeborg, Herning, _split("""Aarhus, Aalborg, Esbjerg, Randers, Kolding, Horsens, Vejle, Silkeborg, Herning,
Viborg, Billund, Fredericia, Holstebro, Skive, Ringkøbing, Videbæk, Lem, Risskov, Viborg, Billund, Fredericia, Holstebro, Skive, Ringkøbing, Videbæk, Lem, Risskov,
Åbyhøj, Brabrand, Viby J, Aabenraa, Haderslev, Sønderborg, Grenaa, Grenå, Åbyhøj, Brabrand, Viby J, Aabenraa, Haderslev, Sønderborg, Grenaa, Grenå,
@@ -882,7 +884,8 @@ _PLACELESS = frozenset((
"remote", "hybrid", "anywhere", "worldwide", "global", "distributed", "home", "based", "remote", "hybrid", "anywhere", "worldwide", "global", "distributed", "home", "based",
"from", "work", "working", "wfh", "office", "offices", "onsite", "on", "site", "in", "from", "work", "working", "wfh", "office", "offices", "onsite", "on", "site", "in",
"multiple", "several", "various", "locations", "location", "flexible", "or", "and", "any", "multiple", "several", "various", "locations", "location", "flexible", "or", "and", "any",
"first", "field", "travel", "tbd", "n", "a", "other", "job", "jobs", "position")) "first", "field", "travel", "tbd", "n", "a", "other", "job", "jobs", "position",
"udlandet", "ovrige"))
def placeless(text: str) -> bool: def placeless(text: str) -> bool:
+15
View File
@@ -141,6 +141,21 @@ def test_europe_is_every_european_country_and_eu() -> None:
assert not {"US", "CN"} & codes assert not {"US", "CN"} & codes
def test_a_danish_region_as_akademikernes_jobbank_writes_it_is_placed() -> None:
# The labels of the site's search form. Unplaced, "Storkøbenhavn;
# Øresundsregionen" was known only as Øresund, which lies in no country.
assert names("Storkøbenhavn") == ["Capital Region of Denmark"]
assert names("Nordsjælland") == ["Capital Region of Denmark"]
for text in ("Østsjælland", "Vestsjælland", "Sydsjælland & Øer"):
assert names(text) == ["Zealand"]
for text in ("Sydøstjylland", "Sydvestjylland"):
assert names(text) == ["Jutland"]
assert names("Storkøbenhavn; Øresundsregionen") == ["Capital Region of Denmark", "Øresund"]
# "Abroad (other)" names no place, so it is not listed as unresolved.
assert names("Udlandet (øvrige)") == [] and places.placeless("Udlandet (øvrige)")
assert names("Udlandet (Sverige)") == ["Sweden"]
def test_oresund_holds_both_capital_regions() -> None: def test_oresund_holds_both_capital_regions() -> None:
under = GAZ.under(GAZ.lookup("region:oresund") or ()) under = GAZ.under(GAZ.lookup("region:oresund") or ())
assert {GAZ.by_key[("city", "malmo")], GAZ.by_key[("city", "copenhagen")]} <= under assert {GAZ.by_key[("city", "malmo")], GAZ.by_key[("city", "copenhagen")]} <= under