Place the Danish regions as Akademikernes Jobbank writes them: Storkøbenhavn and Nordsjælland in the Capital Region, the Zealand and Jutland labels in their regions, and Udlandet (øvrige) as no place
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
1127d06f03
commit
b6d0a54f39
2 files changed
+22
-4
No files matched your search
+7
-4
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in new issue
Block a user