@finbheara/domain 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,10 @@ placeRelation(place("Calgary, AB"), place("Western Canada")); // "contains"
100
100
  placeRelation(place("Virginia"), place("Ontario")); // "conflict"
101
101
  ```
102
102
 
103
+ A town followed by a county, district or region reads as the town only where that unit holds
104
+ it: `place("Coventry, West Midlands")` is Coventry, and `place("Coventry, Kent")` is two places.
105
+ Which units hold each town is a table read off GeoNames.
106
+
103
107
  A `Place` is one of four arms: `resolved`, `plural` (a print naming more than one place),
104
108
  `ambiguous` (one print, several readings) and `unread`. Only `conflict` between two readings
105
109
  says they cannot be one place; `same`, `contains` and `overlaps` do not.
@@ -502,3 +506,6 @@ seatName("Aoife Mhaolvarna").nn2; // "Mhaolvarna<<Aoife": nam
502
506
  ## Licence
503
507
 
504
508
  MIT, Copyright (c) 2026 Finbheara Systems.
509
+
510
+ The place-containment table contains data from GeoNames (https://www.geonames.org/), licensed
511
+ under CC BY 4.0.
@@ -6923,6 +6923,297 @@ var PLACE_NODES = [
6923
6923
  }
6924
6924
  ];
6925
6925
 
6926
+ var PLACE_WITHIN = {
6927
+ "AUS-ACT/canberra": { nodes: [], names: ["Australian Capital Territory"] },
6928
+ "AUS-NSW/newcastle": { nodes: [], names: ["New South Wales", "Newcastle"] },
6929
+ "AUS-NSW/sydney": { nodes: [], names: ["New South Wales"] },
6930
+ "AUS-QLD/brisbane": { nodes: [], names: ["Brisbane", "Queensland"] },
6931
+ "AUS-SA/adelaide": { nodes: [], names: ["Adelaide", "South Australia"] },
6932
+ "AUS-VIC/melbourne": { nodes: [], names: ["Melbourne", "Victoria"] },
6933
+ "AUS-WA/perth": { nodes: [], names: ["Perth", "Western Australia"] },
6934
+ "AUT/vienna": { nodes: [], names: ["Vienna", "Wien", "Wien Stadt"] },
6935
+ "CAN-AB/calgary": { nodes: [], names: ["Alberta", "Calgary"] },
6936
+ "CAN-AB/edmonton": { nodes: [], names: ["Alberta", "Edmonton"] },
6937
+ "CAN-AB/fort-mcmurray": { nodes: [], names: ["Alberta", "Wood Buffalo"] },
6938
+ "CAN-AB/red-deer": { nodes: [], names: ["Alberta", "Red Deer"] },
6939
+ "CAN-BC/burnaby": { nodes: [], names: ["British Columbia", "Metro Vancouver Regional District"] },
6940
+ "CAN-BC/duncan": { nodes: [], names: ["British Columbia", "Cowichan Valley Regional District"] },
6941
+ "CAN-BC/invermere": {
6942
+ nodes: [],
6943
+ names: ["British Columbia", "Regional District of East Kootenay"]
6944
+ },
6945
+ "CAN-BC/kelowna": {
6946
+ nodes: [],
6947
+ names: ["British Columbia", "Regional District of Central Okanagan"]
6948
+ },
6949
+ "CAN-BC/ladner": { nodes: [], names: ["British Columbia", "Metro Vancouver Regional District"] },
6950
+ "CAN-BC/richmond": {
6951
+ nodes: [],
6952
+ names: ["British Columbia", "Metro Vancouver Regional District"]
6953
+ },
6954
+ "CAN-BC/surrey": { nodes: [], names: ["British Columbia", "Metro Vancouver Regional District"] },
6955
+ "CAN-BC/vancouver": {
6956
+ nodes: [],
6957
+ names: ["British Columbia", "Metro Vancouver Regional District"]
6958
+ },
6959
+ "CAN-BC/victoria-city": { nodes: [], names: ["British Columbia", "Capital Regional District"] },
6960
+ "CAN-MB/winnipeg": { nodes: [], names: ["Manitoba"] },
6961
+ "CAN-NB/fredericton": { nodes: [], names: ["New Brunswick", "York", "York County"] },
6962
+ "CAN-NS/halifax": { nodes: [], names: ["Halifax Regional Municipality", "Nova Scotia"] },
6963
+ "CAN-ON/belleville": { nodes: [], names: ["Hastings", "Hastings County", "Ontario"] },
6964
+ "CAN-ON/hamilton": { nodes: [], names: ["Hamilton", "Ontario"] },
6965
+ "CAN-ON/kingston": { nodes: [], names: ["Frontenac", "Frontenac County", "Ontario"] },
6966
+ "CAN-ON/london": { nodes: [], names: ["Middlesex", "Middlesex County", "Ontario"] },
6967
+ "CAN-ON/mississauga": { nodes: [], names: ["Ontario", "Peel"] },
6968
+ "CAN-ON/niagara-falls": { nodes: [], names: ["Ontario", "Regional Municipality of Niagara"] },
6969
+ "CAN-ON/oakville": { nodes: [], names: ["Halton", "Ontario"] },
6970
+ "CAN-ON/ottawa": { nodes: [], names: ["Ontario", "Ottawa"] },
6971
+ "CAN-ON/st-catharines": { nodes: [], names: ["Ontario", "Regional Municipality of Niagara"] },
6972
+ "CAN-ON/toronto": { nodes: [], names: ["Ontario"] },
6973
+ "CAN-ON/whitby": { nodes: [], names: ["Durham", "Ontario"] },
6974
+ "CAN-ON/windsor": { nodes: [], names: ["Essex", "Essex County", "Ontario"] },
6975
+ "CAN-QC/hudson": { nodes: [], names: ["Monteregie", "Montérégie", "Quebec"] },
6976
+ "CAN-QC/montreal": { nodes: [], names: ["Montreal", "Montréal", "Quebec"] },
6977
+ "CAN-SK/prince-albert": { nodes: [], names: ["Prince Albert", "Saskatchewan"] },
6978
+ "CAN-SK/regina": { nodes: [], names: ["Regina", "Saskatchewan"] },
6979
+ "CAN-SK/saskatoon": { nodes: [], names: ["Saskatchewan", "Saskatoon"] },
6980
+ "DEU/berlin": { nodes: [], names: ["Berlin", "State of Berlin"] },
6981
+ "DEU/landstuhl": { nodes: [], names: ["Rheinland-Pfalz"] },
6982
+ "ESP/barcelona": {
6983
+ nodes: [],
6984
+ names: ["Barcelona", "Catalonia", "Provincia de Barcelona", "Província de Barcelona"]
6985
+ },
6986
+ "FRA/paris": { nodes: [], names: ["Ile-de-France", "Paris", "Île-de-France"] },
6987
+ "GBR-ANT/belfast": { nodes: [], names: ["Belfast", "City of Belfast", "Northern Ireland"] },
6988
+ "GBR-ENG/alvechurch": { nodes: ["GBR-WOR"], names: ["England", "Worcestershire"] },
6989
+ "GBR-ENG/barnsley": { nodes: ["GBR-SYK"], names: ["Barnsley", "England"] },
6990
+ "GBR-ENG/birmingham": {
6991
+ nodes: ["GBR-WMD"],
6992
+ names: ["Birmingham", "City and Borough of Birmingham", "England"]
6993
+ },
6994
+ "GBR-ENG/bolton": { nodes: ["GBR-GTM"], names: ["Bolton", "Borough of Bolton", "England"] },
6995
+ "GBR-ENG/bristol": { nodes: [], names: ["Bristol", "City of Bristol", "England"] },
6996
+ "GBR-ENG/bromsgrove": { nodes: ["GBR-WOR"], names: ["England", "Worcestershire"] },
6997
+ "GBR-ENG/chesterfield": { nodes: [], names: ["Derbyshire", "England"] },
6998
+ "GBR-ENG/corby": { nodes: ["GBR-NTH"], names: ["England", "North Northamptonshire"] },
6999
+ "GBR-ENG/coventry": { nodes: ["GBR-WMD"], names: ["Coventry", "England"] },
7000
+ "GBR-ENG/derby": { nodes: [], names: ["Derby", "Derbyshire", "England"] },
7001
+ "GBR-ENG/doncaster": { nodes: ["GBR-SYK"], names: ["Doncaster", "England"] },
7002
+ "GBR-ENG/dudley": { nodes: ["GBR-WMD"], names: ["Dudley", "England"] },
7003
+ "GBR-ENG/hinckley": { nodes: ["GBR-LEC"], names: ["England", "Leicestershire"] },
7004
+ "GBR-ENG/kenilworth": { nodes: ["GBR-WAR"], names: ["England", "Warwickshire"] },
7005
+ "GBR-ENG/leamington-spa": { nodes: ["GBR-WAR"], names: ["England", "Warwickshire"] },
7006
+ "GBR-ENG/leeds": { nodes: ["GBR-WYK"], names: ["City and Borough of Leeds", "England", "Leeds"] },
7007
+ "GBR-ENG/liverpool": { nodes: ["GBR-ENG/merseyside"], names: ["England", "Liverpool"] },
7008
+ "GBR-ENG/london": { nodes: ["GBR-GTL"], names: ["England", "Greater London"] },
7009
+ "GBR-ENG/manchester-gb": { nodes: ["GBR-GTM"], names: ["England", "Manchester"] },
7010
+ "GBR-ENG/nottingham": { nodes: ["GBR-NTT"], names: ["England", "Nottingham"] },
7011
+ "GBR-ENG/peterborough": { nodes: ["GBR-CAM"], names: ["England", "Peterborough"] },
7012
+ "GBR-ENG/redditch": { nodes: ["GBR-WOR"], names: ["England", "Worcestershire"] },
7013
+ "GBR-ENG/rugby": { nodes: ["GBR-WAR"], names: ["England", "Warwickshire"] },
7014
+ "GBR-ENG/sheffield": { nodes: ["GBR-SYK"], names: ["England", "Sheffield"] },
7015
+ "GBR-ENG/solihull": { nodes: ["GBR-WMD"], names: ["England", "Solihull"] },
7016
+ "GBR-ENG/southampton": { nodes: ["GBR-HAM"], names: ["England", "Southampton"] },
7017
+ "GBR-ENG/st-albans": { nodes: ["GBR-ENG/hertfordshire"], names: ["England", "Hertfordshire"] },
7018
+ "GBR-ENG/swindon": {
7019
+ nodes: ["GBR-WIL"],
7020
+ names: ["Borough of Swindon", "England", "Gloucestershire", "Swindon"]
7021
+ },
7022
+ "GBR-ENG/windsor": {
7023
+ nodes: ["GBR-BRK"],
7024
+ names: ["England", "Royal Borough of Windsor and Maidenhead", "Windsor and Maidenhead"]
7025
+ },
7026
+ "GBR-ENG/wolverhampton": { nodes: ["GBR-WMD"], names: ["England", "Wolverhampton"] },
7027
+ "GBR-SCT/edinburgh": { nodes: [], names: ["City of Edinburgh", "Edinburgh", "Scotland"] },
7028
+ "GBR-SCT/glasgow": { nodes: [], names: ["Glasgow", "Glasgow City", "Scotland"] },
7029
+ "IRL-D/dublin": { nodes: [], names: ["Dublin", "Dublin City", "Leinster"] },
7030
+ "ITA/rome": {
7031
+ nodes: [],
7032
+ names: [
7033
+ "Citta metropolitana di Roma Capitale",
7034
+ "Città metropolitana di Roma Capitale",
7035
+ "Lazio"
7036
+ ]
7037
+ },
7038
+ "NOR/oslo": { nodes: [], names: ["Oslo"] },
7039
+ "NZL/auckland": { nodes: [], names: ["Auckland"] },
7040
+ "NZL/hamilton": { nodes: [], names: ["Hamilton", "Hamilton City", "Waikato", "Waikato Region"] },
7041
+ "NZL/wellington": { nodes: [], names: ["Wellington", "Wellington City", "Wellington Region"] },
7042
+ "SVK/bratislava": { nodes: [], names: ["Bratislava", "Bratislava Region"] },
7043
+ "TWN/taipei": { nodes: [], names: ["Taipei", "Taipei City", "Taiwan"] },
7044
+ "USA-AK/anchorage": { nodes: [], names: ["Alaska", "Anchorage Municipality"] },
7045
+ "USA-AL/birmingham": { nodes: [], names: ["Alabama", "Jefferson", "Jefferson County"] },
7046
+ "USA-AR/fort-smith": { nodes: [], names: ["Arkansas", "Sebastian", "Sebastian County"] },
7047
+ "USA-AR/little-rock": { nodes: [], names: ["Arkansas", "Pulaski", "Pulaski County"] },
7048
+ "USA-AZ/phoenix": { nodes: [], names: ["Arizona", "Maricopa", "Maricopa County"] },
7049
+ "USA-AZ/tucson": { nodes: [], names: ["Arizona", "Pima", "Pima County"] },
7050
+ "USA-CA/danville": { nodes: [], names: ["California", "Contra Costa", "Contra Costa County"] },
7051
+ "USA-CA/dublin": { nodes: [], names: ["Alameda", "Alameda County", "California"] },
7052
+ "USA-CA/los-angeles": { nodes: [], names: ["California", "Los Angeles", "Los Angeles County"] },
7053
+ "USA-CA/oakland": { nodes: [], names: ["Alameda", "Alameda County", "California"] },
7054
+ "USA-CA/sacramento": { nodes: [], names: ["California", "Sacramento", "Sacramento County"] },
7055
+ "USA-CA/san-diego": { nodes: [], names: ["California", "San Diego", "San Diego County"] },
7056
+ "USA-CA/san-francisco": { nodes: [], names: ["California", "City and County of San Francisco"] },
7057
+ "USA-CA/san-jose": { nodes: [], names: ["California", "Santa Clara", "Santa Clara County"] },
7058
+ "USA-CO/colorado-springs": { nodes: [], names: ["Colorado", "El Paso", "El Paso County"] },
7059
+ "USA-CO/denver": { nodes: [], names: ["Colorado", "Denver", "Denver County"] },
7060
+ "USA-CT/hartford": {
7061
+ nodes: [],
7062
+ names: ["Capitol Planning", "Capitol Planning Region", "Connecticut"]
7063
+ },
7064
+ "USA-CT/new-haven": {
7065
+ nodes: [],
7066
+ names: [
7067
+ "Connecticut",
7068
+ "South Central Connecticut Planning",
7069
+ "South Central Connecticut Planning Region"
7070
+ ]
7071
+ },
7072
+ "USA-DE/wilmington": { nodes: [], names: ["Delaware", "New Castle", "New Castle County"] },
7073
+ "USA-FL/gainesville": { nodes: [], names: ["Alachua", "Alachua County", "Florida"] },
7074
+ "USA-FL/jacksonville": { nodes: [], names: ["Duval", "Duval County", "Florida"] },
7075
+ "USA-FL/kissimmee": { nodes: [], names: ["Florida", "Osceola", "Osceola County"] },
7076
+ "USA-FL/miami": { nodes: [], names: ["Florida", "Miami-Dade", "Miami-Dade County"] },
7077
+ "USA-FL/naples": { nodes: [], names: ["Collier", "Collier County", "Florida"] },
7078
+ "USA-FL/orlando": { nodes: [], names: ["Florida", "Orange", "Orange County"] },
7079
+ "USA-FL/sarasota": { nodes: [], names: ["Florida", "Sarasota", "Sarasota County"] },
7080
+ "USA-FL/tampa": { nodes: [], names: ["Florida", "Hillsborough", "Hillsborough County"] },
7081
+ "USA-FL/winter-garden": { nodes: [], names: ["Florida", "Orange", "Orange County"] },
7082
+ "USA-GA/atlanta": { nodes: [], names: ["Fulton", "Fulton County", "Georgia"] },
7083
+ "USA-GA/savannah": { nodes: [], names: ["Chatham", "Chatham County", "Georgia"] },
7084
+ "USA-HI/honolulu": { nodes: [], names: ["Hawaii", "Honolulu", "Honolulu County"] },
7085
+ "USA-IA/des-moines": { nodes: [], names: ["Iowa", "Polk", "Polk County"] },
7086
+ "USA-ID/boise": { nodes: [], names: ["Ada", "Ada County", "Idaho"] },
7087
+ "USA-IL/chicago": { nodes: [], names: ["Cook", "Cook County", "Illinois"] },
7088
+ "USA-IL/lemont": { nodes: [], names: ["Cook", "Cook County", "Illinois"] },
7089
+ "USA-IL/niles": { nodes: [], names: ["Cook", "Cook County", "Illinois"] },
7090
+ "USA-IL/o-fallon": { nodes: [], names: ["Illinois", "Saint Clair", "Saint Clair County"] },
7091
+ "USA-IL/springfield": { nodes: [], names: ["Illinois", "Sangamon", "Sangamon County"] },
7092
+ "USA-IN/indianapolis": { nodes: [], names: ["Indiana", "Marion", "Marion County"] },
7093
+ "USA-KS/wichita": { nodes: [], names: ["Kansas", "Sedgwick", "Sedgwick County"] },
7094
+ "USA-KY/lexington": { nodes: [], names: ["Fayette", "Fayette County", "Kentucky"] },
7095
+ "USA-KY/louisville": { nodes: [], names: ["Jefferson", "Jefferson County", "Kentucky"] },
7096
+ "USA-LA/baton-rouge": { nodes: [], names: ["East Baton Rouge Parish", "Louisiana"] },
7097
+ "USA-LA/new-orleans": { nodes: [], names: ["Louisiana", "Orleans Parish"] },
7098
+ "USA-MA/boston": { nodes: [], names: ["Massachusetts", "Suffolk", "Suffolk County"] },
7099
+ "USA-MA/lexington": { nodes: [], names: ["Massachusetts", "Middlesex", "Middlesex County"] },
7100
+ "USA-MA/quincy": { nodes: [], names: ["Massachusetts", "Norfolk", "Norfolk County"] },
7101
+ "USA-MA/springfield": { nodes: [], names: ["Hampden", "Hampden County", "Massachusetts"] },
7102
+ "USA-MA/worcester": { nodes: [], names: ["Massachusetts", "Worcester", "Worcester County"] },
7103
+ "USA-MD/annapolis": { nodes: [], names: ["Anne Arundel", "Anne Arundel County", "Maryland"] },
7104
+ "USA-MD/baltimore": { nodes: [], names: ["Baltimore", "City of Baltimore", "Maryland"] },
7105
+ "USA-MD/columbia": { nodes: [], names: ["Howard", "Howard County", "Maryland"] },
7106
+ "USA-MD/salisbury": { nodes: [], names: ["Maryland", "Wicomico", "Wicomico County"] },
7107
+ "USA-ME/portland": { nodes: [], names: ["Cumberland", "Cumberland County", "Maine"] },
7108
+ "USA-MI/ann-arbor": { nodes: [], names: ["Michigan", "Washtenaw", "Washtenaw County"] },
7109
+ "USA-MI/detroit": { nodes: [], names: ["Michigan", "Wayne", "Wayne County"] },
7110
+ "USA-MI/grand-rapids": { nodes: [], names: ["Kent", "Kent County", "Michigan"] },
7111
+ "USA-MN/minneapolis": { nodes: [], names: ["Hennepin", "Hennepin County", "Minnesota"] },
7112
+ "USA-MN/st-paul": { nodes: [], names: ["Minnesota", "Ramsey", "Ramsey County"] },
7113
+ "USA-MO/columbia": { nodes: [], names: ["Boone", "Boone County", "Missouri"] },
7114
+ "USA-MO/kansas-city": { nodes: [], names: ["Jackson", "Jackson County", "Missouri"] },
7115
+ "USA-MO/springfield": { nodes: [], names: ["Greene", "Greene County", "Missouri"] },
7116
+ "USA-MO/st-louis": { nodes: [], names: ["City of Saint Louis", "Missouri", "Saint Louis"] },
7117
+ "USA-MT/butte": { nodes: [], names: ["Montana", "Silver Bow", "Silver Bow County"] },
7118
+ "USA-MT/helena": { nodes: [], names: ["Lewis and Clark", "Lewis and Clark County", "Montana"] },
7119
+ "USA-NC/charlotte": { nodes: [], names: ["Mecklenburg", "Mecklenburg County", "North Carolina"] },
7120
+ "USA-NC/fayetteville": {
7121
+ nodes: [],
7122
+ names: ["Cumberland", "Cumberland County", "North Carolina"]
7123
+ },
7124
+ "USA-NC/greensboro": { nodes: [], names: ["Guilford", "Guilford County", "North Carolina"] },
7125
+ "USA-NC/mooresville": { nodes: [], names: ["Iredell", "Iredell County", "North Carolina"] },
7126
+ "USA-NC/raleigh": { nodes: [], names: ["North Carolina", "Wake", "Wake County"] },
7127
+ "USA-ND/fargo": { nodes: [], names: ["Cass", "Cass County", "North Dakota"] },
7128
+ "USA-NE/omaha": { nodes: [], names: ["Douglas", "Douglas County", "Nebraska"] },
7129
+ "USA-NH/manchester": {
7130
+ nodes: [],
7131
+ names: ["Hillsborough", "Hillsborough County", "New Hampshire"]
7132
+ },
7133
+ "USA-NJ/jersey-city": { nodes: [], names: ["Hudson", "Hudson County", "New Jersey"] },
7134
+ "USA-NJ/newark": { nodes: [], names: ["Essex", "Essex County", "New Jersey"] },
7135
+ "USA-NJ/trenton": { nodes: [], names: ["Mercer", "Mercer County", "New Jersey"] },
7136
+ "USA-NM/albuquerque": { nodes: [], names: ["Bernalillo", "Bernalillo County", "New Mexico"] },
7137
+ "USA-NM/rio-rancho": { nodes: [], names: ["New Mexico", "Sandoval", "Sandoval County"] },
7138
+ "USA-NM/santa-fe": { nodes: [], names: ["New Mexico", "Santa Fe", "Santa Fe County"] },
7139
+ "USA-NV/las-vegas": { nodes: [], names: ["Clark", "Clark County", "Nevada"] },
7140
+ "USA-NV/reno": { nodes: [], names: ["Nevada", "Washoe", "Washoe County"] },
7141
+ "USA-NY/albany": { nodes: [], names: ["Albany", "Albany County", "New York"] },
7142
+ "USA-NY/buffalo": { nodes: [], names: ["Erie", "Erie County", "New York"] },
7143
+ "USA-NY/grand-island": { nodes: [], names: ["Erie", "Erie County", "New York"] },
7144
+ "USA-NY/kingston": { nodes: [], names: ["New York", "Ulster", "Ulster County"] },
7145
+ "USA-NY/liverpool": { nodes: [], names: ["New York", "Onondaga", "Onondaga County"] },
7146
+ "USA-NY/manhattan": { nodes: [], names: ["New York", "New York County"] },
7147
+ "USA-NY/massapequa": { nodes: [], names: ["Nassau", "Nassau County", "New York"] },
7148
+ "USA-NY/nyc": { nodes: [], names: ["New York"] },
7149
+ "USA-NY/rochester": { nodes: [], names: ["Monroe", "Monroe County", "New York"] },
7150
+ "USA-NY/syracuse": { nodes: [], names: ["New York", "Onondaga", "Onondaga County"] },
7151
+ "USA-NY/webster": { nodes: [], names: ["Monroe", "Monroe County", "New York"] },
7152
+ "USA-OH/akron": { nodes: [], names: ["Ohio", "Summit", "Summit County"] },
7153
+ "USA-OH/cincinnati": { nodes: [], names: ["Hamilton", "Hamilton County", "Ohio"] },
7154
+ "USA-OH/cleveland": { nodes: [], names: ["Cuyahoga", "Cuyahoga County", "Ohio"] },
7155
+ "USA-OH/columbus": { nodes: [], names: ["Franklin", "Franklin County", "Ohio"] },
7156
+ "USA-OH/dayton": { nodes: [], names: ["Montgomery", "Montgomery County", "Ohio"] },
7157
+ "USA-OH/dublin": { nodes: [], names: ["Franklin", "Franklin County", "Ohio"] },
7158
+ "USA-OH/richfield": { nodes: [], names: ["Ohio", "Summit", "Summit County"] },
7159
+ "USA-OH/toledo": { nodes: [], names: ["Lucas", "Lucas County", "Ohio"] },
7160
+ "USA-OK/ardmore": { nodes: [], names: ["Carter", "Carter County", "Oklahoma"] },
7161
+ "USA-OK/oklahoma-city": { nodes: [], names: ["Oklahoma", "Oklahoma County"] },
7162
+ "USA-OK/tulsa": { nodes: [], names: ["Oklahoma", "Tulsa", "Tulsa County"] },
7163
+ "USA-OR/portland": { nodes: [], names: ["Multnomah", "Multnomah County", "Oregon"] },
7164
+ "USA-PA/allentown": { nodes: [], names: ["Lehigh", "Lehigh County", "Pennsylvania"] },
7165
+ "USA-PA/ardmore": { nodes: [], names: ["Montgomery", "Montgomery County", "Pennsylvania"] },
7166
+ "USA-PA/erie": { nodes: [], names: ["Erie", "Erie County", "Pennsylvania"] },
7167
+ "USA-PA/lancaster": { nodes: [], names: ["Lancaster", "Lancaster County", "Pennsylvania"] },
7168
+ "USA-PA/philadelphia": {
7169
+ nodes: [],
7170
+ names: ["Pennsylvania", "Philadelphia", "Philadelphia County"]
7171
+ },
7172
+ "USA-PA/pittsburgh": { nodes: [], names: ["Allegheny", "Allegheny County", "Pennsylvania"] },
7173
+ "USA-PA/scranton": { nodes: [], names: ["Lackawanna", "Lackawanna County", "Pennsylvania"] },
7174
+ "USA-RI/providence": { nodes: [], names: ["Providence", "Providence County", "Rhode Island"] },
7175
+ "USA-SC/charleston": { nodes: [], names: ["Charleston", "Charleston County", "South Carolina"] },
7176
+ "USA-SC/columbia": { nodes: [], names: ["Richland", "Richland County", "South Carolina"] },
7177
+ "USA-SC/greenville": { nodes: [], names: ["Greenville", "Greenville County", "South Carolina"] },
7178
+ "USA-TN/chattanooga": { nodes: [], names: ["Hamilton", "Hamilton County", "Tennessee"] },
7179
+ "USA-TN/knoxville": { nodes: [], names: ["Knox", "Knox County", "Tennessee"] },
7180
+ "USA-TN/memphis": { nodes: [], names: ["Shelby", "Shelby County", "Tennessee"] },
7181
+ "USA-TN/nashville": { nodes: [], names: ["Davidson", "Davidson County", "Tennessee"] },
7182
+ "USA-TX/austin": { nodes: [], names: ["Texas", "Travis", "Travis County"] },
7183
+ "USA-TX/corpus-christi": { nodes: [], names: ["Nueces", "Nueces County", "Texas"] },
7184
+ "USA-TX/dallas": { nodes: [], names: ["Dallas", "Dallas County", "Texas"] },
7185
+ "USA-TX/fort-worth": { nodes: [], names: ["Tarrant", "Tarrant County", "Texas"] },
7186
+ "USA-TX/grapevine": { nodes: [], names: ["Tarrant", "Tarrant County", "Texas"] },
7187
+ "USA-TX/houston": { nodes: [], names: ["Harris", "Harris County", "Texas"] },
7188
+ "USA-TX/richardson": { nodes: [], names: ["Dallas", "Dallas County", "Texas"] },
7189
+ "USA-TX/san-antonio": { nodes: [], names: ["Bexar", "Bexar County", "Texas"] },
7190
+ "USA-UT/cedar-hills": { nodes: [], names: ["Utah", "Utah County"] },
7191
+ "USA-UT/salt-lake-city": { nodes: [], names: ["Salt Lake", "Salt Lake County", "Utah"] },
7192
+ "USA-VA/leesburg": { nodes: [], names: ["Loudoun", "Loudoun County", "Virginia"] },
7193
+ "USA-VA/newport-news": { nodes: [], names: ["City of Newport News", "Newport News", "Virginia"] },
7194
+ "USA-VA/norfolk": { nodes: [], names: ["City of Norfolk", "Norfolk", "Virginia"] },
7195
+ "USA-VA/reston": { nodes: [], names: ["Fairfax", "Fairfax County", "Virginia"] },
7196
+ "USA-VA/richmond": { nodes: [], names: ["City of Richmond", "Richmond", "Virginia"] },
7197
+ "USA-VA/smithfield": { nodes: [], names: ["Isle of Wight", "Isle of Wight County", "Virginia"] },
7198
+ "USA-VA/springfield": { nodes: [], names: ["Fairfax", "Fairfax County", "Virginia"] },
7199
+ "USA-VA/virginia-beach": {
7200
+ nodes: [],
7201
+ names: ["City of Virginia Beach", "Virginia", "Virginia Beach"]
7202
+ },
7203
+ "USA-VA/williamsburg": {
7204
+ nodes: [],
7205
+ names: ["City of Williamsburg", "James City", "James City County", "Virginia", "Williamsburg"]
7206
+ },
7207
+ "USA-VT/burlington": { nodes: [], names: ["Chittenden", "Chittenden County", "Vermont"] },
7208
+ "USA-WA/lynnwood": { nodes: [], names: ["Snohomish", "Snohomish County", "Washington"] },
7209
+ "USA-WA/olympia": { nodes: [], names: ["Thurston", "Thurston County", "Washington"] },
7210
+ "USA-WA/seattle": { nodes: [], names: ["King", "King County", "Washington"] },
7211
+ "USA-WA/spokane": { nodes: [], names: ["Spokane", "Spokane County", "Washington"] },
7212
+ "USA-WA/tacoma": { nodes: [], names: ["Pierce", "Pierce County", "Washington"] },
7213
+ "USA-WI/madison": { nodes: [], names: ["Dane", "Dane County", "Wisconsin"] },
7214
+ "USA-WI/milwaukee": { nodes: [], names: ["Milwaukee", "Milwaukee County", "Wisconsin"] }
7215
+ };
7216
+
6926
7217
  var QUALIFIER_DELIMITER = /[,;:()[\]/–—-]/;
6927
7218
  var SHORT_TOKEN_BARS = [
6928
7219
  {
@@ -7077,6 +7368,7 @@ var PLACE_CELL_SENTINELS = [...SHARED_ROW_SENTINELS2];
7077
7368
  var placeCellSentinelOf = sentinelIn2(PLACE_CELL_SENTINELS);
7078
7369
  function createPlaceReader2(options = {}) {
7079
7370
  const nodes = options.tree ?? PLACE_NODES;
7371
+ const withinTable = options.within ?? PLACE_WITHIN;
7080
7372
  let index;
7081
7373
  const given = options.refusals;
7082
7374
  const refusals = given === undefined ? () => {
@@ -7265,6 +7557,19 @@ function createPlaceReader2(options = {}) {
7265
7557
  function relates(a, b) {
7266
7558
  return isAncestor(a, b) || isAncestor(b, a);
7267
7559
  }
7560
+ let withinNames;
7561
+ function holds(unit, town) {
7562
+ return isAncestor(unit, town) || (withinTable[town.id]?.nodes.includes(unit.id) ?? false);
7563
+ }
7564
+ function namedHolds(print, town) {
7565
+ if (withinNames === undefined) {
7566
+ withinNames = new Map;
7567
+ for (const [id, row] of Object.entries(withinTable))
7568
+ withinNames.set(id, new Set(row.names.map(fold).filter((n) => n !== "")));
7569
+ }
7570
+ const folded = fold(print);
7571
+ return folded !== "" && (withinNames.get(town.id)?.has(folded) ?? false);
7572
+ }
7268
7573
  function onTheMap(a, b) {
7269
7574
  const seen = new Set;
7270
7575
  for (let at = b;at !== undefined && !seen.has(at.id); ) {
@@ -7814,14 +8119,11 @@ function createPlaceReader2(options = {}) {
7814
8119
  function townInCounty(left, right) {
7815
8120
  if (left.length === 0 || right.length === 0)
7816
8121
  return;
7817
- if (!left.every((l) => l.kind === "city") || !right.every((r) => r.kind === "subdivision"))
8122
+ if (!left.every((l) => l.kind === "city") || !right.every((r) => r.kind === "subdivision" || r.kind === "city"))
7818
8123
  return;
7819
8124
  if (left.some((l) => right.some((r) => relates(l, r))))
7820
8125
  return;
7821
- const kept = left.filter((l) => {
7822
- const parent = l.geo === null ? undefined : idx().byId.get(l.geo);
7823
- return parent !== undefined && right.some((r) => r.id !== parent.id && onTheMap(parent, r));
7824
- });
8126
+ const kept = left.filter((l) => right.some((r) => holds(r, l)));
7825
8127
  return kept.length === 0 ? undefined : kept;
7826
8128
  }
7827
8129
  function read(print, declared = false, smushed = true) {
@@ -8177,7 +8479,8 @@ function createPlaceReader2(options = {}) {
8177
8479
  at = k;
8178
8480
  if (at === -1)
8179
8481
  return;
8180
- const tail = read(pieces.slice(at + 1).join(""), true);
8482
+ const qualifier = pieces.slice(at + 1).join("");
8483
+ const tail = read(qualifier, true);
8181
8484
  if (tail.heads.length > 0 || tail.refusal !== null)
8182
8485
  return;
8183
8486
  const town = read(pieces.slice(0, at).join(""), true);
@@ -8185,7 +8488,7 @@ function createPlaceReader2(options = {}) {
8185
8488
  return;
8186
8489
  if (town.heads.length === 0 || !town.heads.every((n) => n.kind === "city"))
8187
8490
  return;
8188
- const kept = town.heads.filter((h) => within.some((w) => isAncestor(w, h)));
8491
+ const kept = town.heads.filter((h) => within.some((w) => isAncestor(w, h)) && namedHolds(qualifier, h));
8189
8492
  if (kept.length === 0)
8190
8493
  return;
8191
8494
  return build(print, chainsFor(kept), { ...town, heads: kept }, []);
package/dist/place.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  placesRelation2,
18
18
  probablySamePlace2,
19
19
  sameReading2
20
- } from "./chunks/place-s3gefhzm.js";
20
+ } from "./chunks/place-qe5krdev.js";
21
21
  import"./chunks/place-tcgfvemw.js";
22
22
  export {
23
23
  DEFAULT_PLACE_CAPACITY2 as DEFAULT_PLACE_CAPACITY,
package/dist/school.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  areAllPlaceTokens2,
13
13
  placeRelation2,
14
14
  sameReading2
15
- } from "./chunks/place-s3gefhzm.js";
15
+ } from "./chunks/place-qe5krdev.js";
16
16
  import {
17
17
  validity
18
18
  } from "./chunks/place-q9kwsmzd.js";
@@ -792,6 +792,18 @@ var SCHOOL_INSTITUTION_VOCABULARY = new Map([
792
792
  matchKey: false
793
793
  }
794
794
  ],
795
+ [
796
+ "s d",
797
+ {
798
+ canonical: "school",
799
+ label: "School",
800
+ kind: "phrase",
801
+ position: "suffix",
802
+ truncatable: false,
803
+ glued: false,
804
+ matchKey: false
805
+ }
806
+ ],
795
807
  [
796
808
  "ecole",
797
809
  {
@@ -16,6 +16,10 @@ export interface PlaceNode {
16
16
  readonly isoNumeric?: string;
17
17
  readonly oireachtas?: string;
18
18
  }
19
+ export interface PlaceWithin {
20
+ readonly nodes: readonly string[];
21
+ readonly names: readonly string[];
22
+ }
19
23
  export type PlaceMatch = "id" | "code" | "print" | "phrase" | "iso" | "county" | "truncation" | "desmushed";
20
24
  export type PlaceRefusal = "school" | "organization" | "placeholder" | "damaged" | "web" | "online" | "notice";
21
25
  export type PlaceRelation = "same" | "contains" | "overlaps" | "conflict" | "silent";
@@ -0,0 +1,4 @@
1
+ import type { PlaceWithin } from "./place-types.ts";
2
+ export declare const PLACE_WITHIN_TREE = "42be759c4de3678a3d22fc5174dbafad342c5437ec8fd8e2f05cd8b0a37660bf";
3
+ export declare const PLACE_WITHIN_SOURCES: Readonly<Record<string, string>>;
4
+ export declare const PLACE_WITHIN: Readonly<Record<string, PlaceWithin>>;
@@ -1,6 +1,6 @@
1
- import type { PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation } from "./place-types.ts";
1
+ import type { PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation, PlaceWithin } from "./place-types.ts";
2
2
  import { type EmptyReason, type Validated } from "./validated.ts";
3
- export type { EmptyReason, PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation, Validated, };
3
+ export type { EmptyReason, PlaceContext, PlaceKind, PlaceMatch, PlaceNode, PlaceRefusal, PlaceRelation, PlaceWithin, Validated, };
4
4
  export type PlaceArm = "resolved" | "plural" | "ambiguous" | "unread";
5
5
  export interface AbstractPlace extends Validated<PlaceRefusal> {
6
6
  readonly [Symbol.toStringTag]: "Place";
@@ -61,6 +61,7 @@ export interface PlaceReaderOptions {
61
61
  readonly tree?: readonly PlaceNode[];
62
62
  readonly refusals?: PlaceRefusals | ReadonlyMap<string, PlaceRefusal>;
63
63
  readonly capacity?: number;
64
+ readonly within?: Readonly<Record<string, PlaceWithin>>;
64
65
  }
65
66
  export declare const DEFAULT_PLACE_CAPACITY = 8192;
66
67
  export declare function createPlaceReader(options?: PlaceReaderOptions): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/domain",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Places, CLRG regions, school names, ages, dances and a person's print in its role, as they are printed: read, compared and told apart",
5
5
  "keywords": [
6
6
  "places",