diff --git a/resources/pelias/dictionaries/whosonfirst/country/name:eng_x_preferred.txt b/resources/pelias/dictionaries/whosonfirst/country/name:eng_x_preferred.txt new file mode 100644 index 00000000..61027d15 --- /dev/null +++ b/resources/pelias/dictionaries/whosonfirst/country/name:eng_x_preferred.txt @@ -0,0 +1,3 @@ +# Korea is actually divided into 'South Korea' and 'North Korea' +# So we add an alias here in case 'Korea' is used to indicate either. +korea diff --git a/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt b/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt index efa973a5..fbc93a07 100644 --- a/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt +++ b/resources/pelias/dictionaries/whosonfirst/locality/name:eng_x_preferred.txt @@ -62,4 +62,202 @@ sf #!washington !west virginia !wisconsin -!wyoming \ No newline at end of file +!wyoming + +!afghanistan +!albania +!algeria +!andorra +!angola +!antigua & deps +!argentina +!armenia +!australia +!austria +!azerbaijan +!bahamas +!bahrain +!bangladesh +!barbados +!belarus +!belgium +!belize +!benin +!bhutan +!bolivia +!bosnia herzegovina +!botswana +!brazil +!brunei +!bulgaria +!burkina +!burundi +!cambodia +!cameroon +!canada +!cape verde +!central african republic +!chad +!chile +!china +!colombia +!comoros +!congo +!costa rica +!croatia +!cuba +!cyprus +!czech republic +!denmark +!djibouti +!dominica +!dominican republic +!east timor +!ecuador +!egypt +!el salvador +!equatorial guinea +!eritrea +!estonia +!ethiopia +!fiji +!finland +!france +!gabon +!gambia +!georgia +!germany +!ghana +!greece +!grenada +!guatemala +!guinea +!guinea-bissau +!guyana +!haiti +!honduras +!hungary +!iceland +!india +!indonesia +!iran +!iraq +!ireland +!israel +!italy +!ivory coast +!jamaica +!japan +!jordan +!kazakhstan +!kenya +!kiribati +!korea +!north korea +!south korea +!kosovo +!kuwait +!kyrgyzstan +!laos +!latvia +!lebanon +!lesotho +!liberia +!libya +!liechtenstein +!lithuania +!luxembourg +!macedonia +!madagascar +!malawi +!malaysia +!maldives +!mali +!malta +!marshall islands +!mauritania +!mauritius +!mexico +!micronesia +!moldova +!monaco +!mongolia +!montenegro +!morocco +!mozambique +!myanmar +!burma +!namibia +!nauru +!nepal +!netherlands +!new zealand +!nicaragua +!niger +!nigeria +!norway +!oman +!pakistan +!palau +!panama +!papua new guinea +!paraguay +!peru +!philippines +!poland +!portugal +!qatar +!romania +!russian federation +!rwanda +!st kitts & nevis +!st lucia +!saint vincent & the grenadines +!samoa +!san marino +!sao tome & principe +!saudi arabia +!senegal +!serbia +!seychelles +!sierra leone +!singapore +!slovakia +!slovenia +!solomon islands +!somalia +!south africa +!south sudan +!spain +!sri lanka +!sudan +!suriname +!swaziland +!sweden +!switzerland +!syria +!taiwan +!tajikistan +!tanzania +!thailand +!togo +!tonga +!trinidad & tobago +!tunisia +!turkey +!turkmenistan +!tuvalu +!uganda +!ukraine +!united arab emirates +!united kingdom +!united states +!uruguay +!uzbekistan +!vanuatu +!vatican city +!venezuela +!vietnam +!yemen +!zambia +!zimbabwe diff --git a/test/countries.test.js b/test/countries.test.js new file mode 100644 index 00000000..bf8f2c6f --- /dev/null +++ b/test/countries.test.js @@ -0,0 +1,212 @@ +const testcase = (test, common) => { + let assert = common.assert(test) + + // technically 'South Korea' or 'North Korea' + // but we'll allow it ;) + assert('Korea', [{ country: 'Korea' }]) + + assert('Afghanistan', [{ country: 'Afghanistan' }]) + assert('Albania', [{ country: 'Albania' }]) + assert('Algeria', [{ country: 'Algeria' }]) + assert('Andorra', [{ country: 'Andorra' }]) + assert('Angola', [{ country: 'Angola' }]) + // assert('Antigua & Deps', [{ country: 'Antigua & Deps' }]) + assert('Argentina', [{ country: 'Argentina' }]) + assert('Armenia', [{ country: 'Armenia' }]) + assert('Australia', [{ country: 'Australia' }]) + assert('Austria', [{ country: 'Austria' }]) + assert('Azerbaijan', [{ country: 'Azerbaijan' }]) + // assert('Bahamas', [{ country: 'Bahamas' }]) + assert('Bahrain', [{ country: 'Bahrain' }]) + assert('Bangladesh', [{ country: 'Bangladesh' }]) + assert('Barbados', [{ country: 'Barbados' }]) + assert('Belarus', [{ country: 'Belarus' }]) + assert('Belgium', [{ country: 'Belgium' }]) + // assert('Belize', [{ country: 'Belize' }]) + assert('Benin', [{ country: 'Benin' }]) + assert('Bhutan', [{ country: 'Bhutan' }]) + assert('Bolivia', [{ country: 'Bolivia' }]) + // assert('Bosnia Herzegovina', [{ country: 'Bosnia Herzegovina' }]) + assert('Botswana', [{ country: 'Botswana' }]) + assert('Brazil', [{ country: 'Brazil' }]) + assert('Brunei', [{ country: 'Brunei' }]) + assert('Bulgaria', [{ country: 'Bulgaria' }]) + // assert('Burkina', [{ country: 'Burkina' }]) + assert('Burundi', [{ country: 'Burundi' }]) + assert('Cambodia', [{ country: 'Cambodia' }]) + assert('Cameroon', [{ country: 'Cameroon' }]) + assert('Canada', [{ country: 'Canada' }]) + assert('Cape Verde', [{ country: 'Cape Verde' }]) + // assert('Central African Rep', [{ country: 'Central African Rep' }]) + assert('Chad', [{ country: 'Chad' }]) + assert('Chile', [{ country: 'Chile' }]) + assert('China', [{ country: 'China' }]) + assert('Colombia', [{ country: 'Colombia' }]) + assert('Comoros', [{ country: 'Comoros' }]) + assert('Congo', [{ country: 'Congo' }]) + // assert('Congo {Democratic Rep}', [{ country: 'Congo {Democratic Rep}' }]) + assert('Costa Rica', [{ country: 'Costa Rica' }]) + assert('Croatia', [{ country: 'Croatia' }]) + assert('Cuba', [{ country: 'Cuba' }]) + assert('Cyprus', [{ country: 'Cyprus' }]) + // assert('Czech Republic', [{ country: 'Czech Republic' }]) + assert('Denmark', [{ country: 'Denmark' }]) + // assert('Djibouti', [{ country: 'Djibouti' }]) + assert('Dominica', [{ country: 'Dominica' }]) + assert('Dominican Republic', [{ country: 'Dominican Republic' }]) + assert('East Timor', [{ country: 'East Timor' }]) + assert('Ecuador', [{ country: 'Ecuador' }]) + assert('Egypt', [{ country: 'Egypt' }]) + assert('El Salvador', [{ country: 'El Salvador' }]) + assert('Equatorial Guinea', [{ country: 'Equatorial Guinea' }]) + assert('Eritrea', [{ country: 'Eritrea' }]) + // assert('Estonia', [{ country: 'Estonia' }]) + assert('Ethiopia', [{ country: 'Ethiopia' }]) + assert('Fiji', [{ country: 'Fiji' }]) + assert('Finland', [{ country: 'Finland' }]) + assert('France', [{ country: 'France' }]) + assert('Gabon', [{ country: 'Gabon' }]) + // assert('Gambia', [{ country: 'Gambia' }]) + // assert('Georgia', [{ country: 'Georgia' }]) + assert('Germany', [{ country: 'Germany' }]) + assert('Ghana', [{ country: 'Ghana' }]) + assert('Greece', [{ country: 'Greece' }]) + assert('Grenada', [{ country: 'Grenada' }]) + // assert('Guatemala', [{ country: 'Guatemala' }]) + assert('Guinea', [{ country: 'Guinea' }]) + assert('Guinea-Bissau', [{ country: 'Guinea-Bissau' }]) + assert('Guyana', [{ country: 'Guyana' }]) + assert('Haiti', [{ country: 'Haiti' }]) + assert('Honduras', [{ country: 'Honduras' }]) + assert('Hungary', [{ country: 'Hungary' }]) + assert('Iceland', [{ country: 'Iceland' }]) + assert('India', [{ country: 'India' }]) + assert('Indonesia', [{ country: 'Indonesia' }]) + assert('Iran', [{ country: 'Iran' }]) + assert('Iraq', [{ country: 'Iraq' }]) + assert('Ireland', [{ country: 'Ireland' }]) + assert('Israel', [{ country: 'Israel' }]) + assert('Italy', [{ country: 'Italy' }]) + // assert('Ivory Coast', [{ country: 'Ivory Coast' }]) + assert('Jamaica', [{ country: 'Jamaica' }]) + assert('Japan', [{ country: 'Japan' }]) + assert('Jordan', [{ country: 'Jordan' }]) + assert('Kazakhstan', [{ country: 'Kazakhstan' }]) + assert('Kenya', [{ country: 'Kenya' }]) + // assert('Kiribati', [{ country: 'Kiribati' }]) + assert('North Korea', [{ country: 'North Korea' }]) + assert('South Korea', [{ country: 'South Korea' }]) + // assert('Kosovo', [{ country: 'Kosovo' }]) + assert('Kuwait', [{ country: 'Kuwait' }]) + assert('Kyrgyzstan', [{ country: 'Kyrgyzstan' }]) + assert('Laos', [{ country: 'Laos' }]) + assert('Latvia', [{ country: 'Latvia' }]) + assert('Lebanon', [{ country: 'Lebanon' }]) + assert('Lesotho', [{ country: 'Lesotho' }]) + assert('Liberia', [{ country: 'Liberia' }]) + assert('Libya', [{ country: 'Libya' }]) + // assert('Liechtenstein', [{ country: 'Liechtenstein' }]) + assert('Lithuania', [{ country: 'Lithuania' }]) + // assert('Luxembourg', [{ country: 'Luxembourg' }]) + assert('Macedonia', [{ country: 'Macedonia' }]) + assert('Madagascar', [{ country: 'Madagascar' }]) + assert('Malawi', [{ country: 'Malawi' }]) + assert('Malaysia', [{ country: 'Malaysia' }]) + assert('Maldives', [{ country: 'Maldives' }]) + // assert('Mali', [{ country: 'Mali' }]) + assert('Malta', [{ country: 'Malta' }]) + assert('Marshall Islands', [{ country: 'Marshall Islands' }]) + assert('Mauritania', [{ country: 'Mauritania' }]) + assert('Mauritius', [{ country: 'Mauritius' }]) + // assert('Mexico', [{ country: 'Mexico' }]) + // assert('Micronesia', [{ country: 'Micronesia' }]) + assert('Moldova', [{ country: 'Moldova' }]) + // assert('Monaco', [{ country: 'Monaco' }]) + assert('Mongolia', [{ country: 'Mongolia' }]) + assert('Montenegro', [{ country: 'Montenegro' }]) + assert('Morocco', [{ country: 'Morocco' }]) + assert('Mozambique', [{ country: 'Mozambique' }]) + // assert('Myanmar, {Burma}', [{ country: 'Myanmar, {Burma}' }]) + assert('Namibia', [{ country: 'Namibia' }]) + assert('Nauru', [{ country: 'Nauru' }]) + assert('Nepal', [{ country: 'Nepal' }]) + assert('Netherlands', [{ country: 'Netherlands' }]) + assert('New Zealand', [{ country: 'New Zealand' }]) + assert('Nicaragua', [{ country: 'Nicaragua' }]) + // assert('Niger', [{ country: 'Niger' }]) + assert('Nigeria', [{ country: 'Nigeria' }]) + assert('Norway', [{ country: 'Norway' }]) + assert('Oman', [{ country: 'Oman' }]) + assert('Pakistan', [{ country: 'Pakistan' }]) + assert('Palau', [{ country: 'Palau' }]) + // assert('Panama', [{ country: 'Panama' }]) + assert('Papua New Guinea', [{ country: 'Papua New Guinea' }]) + assert('Paraguay', [{ country: 'Paraguay' }]) + assert('Peru', [{ country: 'Peru' }]) + assert('Philippines', [{ country: 'Philippines' }]) + assert('Poland', [{ country: 'Poland' }]) + assert('Portugal', [{ country: 'Portugal' }]) + assert('Qatar', [{ country: 'Qatar' }]) + assert('Romania', [{ country: 'Romania' }]) + // assert('Russian Federation', [{ country: 'Russian Federation' }]) + assert('Rwanda', [{ country: 'Rwanda' }]) + // assert('St Kitts & Nevis', [{ country: 'St Kitts & Nevis' }]) + // assert('St Lucia', [{ country: 'St Lucia' }]) + // assert('Saint Vincent & the Grenadines', [{ country: 'Saint Vincent & the Grenadines' }]) + assert('Samoa', [{ country: 'Samoa' }]) + // assert('San Marino', [{ country: 'San Marino' }]) + // assert('Sao Tome & Principe', [{ country: 'Sao Tome & Principe' }]) + assert('Saudi Arabia', [{ country: 'Saudi Arabia' }]) + assert('Senegal', [{ country: 'Senegal' }]) + assert('Serbia', [{ country: 'Serbia' }]) + assert('Seychelles', [{ country: 'Seychelles' }]) + assert('Sierra Leone', [{ country: 'Sierra Leone' }]) + assert('Singapore', [{ country: 'Singapore' }]) + assert('Slovakia', [{ country: 'Slovakia' }]) + assert('Slovenia', [{ country: 'Slovenia' }]) + assert('Solomon Islands', [{ country: 'Solomon Islands' }]) + assert('Somalia', [{ country: 'Somalia' }]) + assert('South Africa', [{ country: 'South Africa' }]) + assert('South Sudan', [{ country: 'South Sudan' }]) + assert('Spain', [{ country: 'Spain' }]) + assert('Sri Lanka', [{ country: 'Sri Lanka' }]) + assert('Sudan', [{ country: 'Sudan' }]) + assert('Suriname', [{ country: 'Suriname' }]) + // assert('Swaziland', [{ country: 'Swaziland' }]) + assert('Sweden', [{ country: 'Sweden' }]) + assert('Switzerland', [{ country: 'Switzerland' }]) + assert('Syria', [{ country: 'Syria' }]) + assert('Taiwan', [{ country: 'Taiwan' }]) + assert('Tajikistan', [{ country: 'Tajikistan' }]) + assert('Tanzania', [{ country: 'Tanzania' }]) + assert('Thailand', [{ country: 'Thailand' }]) + assert('Togo', [{ country: 'Togo' }]) + assert('Tonga', [{ country: 'Tonga' }]) + // assert('Trinidad & Tobago', [{ country: 'Trinidad & Tobago' }]) + assert('Tunisia', [{ country: 'Tunisia' }]) + assert('Turkey', [{ country: 'Turkey' }]) + assert('Turkmenistan', [{ country: 'Turkmenistan' }]) + // assert('Tuvalu', [{ country: 'Tuvalu' }]) + assert('Uganda', [{ country: 'Uganda' }]) + assert('Ukraine', [{ country: 'Ukraine' }]) + assert('United Arab Emirates', [{ country: 'United Arab Emirates' }]) + assert('United Kingdom', [{ country: 'United Kingdom' }]) + assert('United States', [{ country: 'United States' }]) + assert('Uruguay', [{ country: 'Uruguay' }]) + assert('Uzbekistan', [{ country: 'Uzbekistan' }]) + assert('Vanuatu', [{ country: 'Vanuatu' }]) + assert('Vatican City', [{ country: 'Vatican City' }]) + assert('Venezuela', [{ country: 'Venezuela' }]) + assert('Vietnam', [{ country: 'Vietnam' }]) + assert('Yemen', [{ country: 'Yemen' }]) + assert('Zambia', [{ country: 'Zambia' }]) + assert('Zimbabwe', [{ country: 'Zimbabwe' }]) +} + +module.exports.all = (tape, common) => { + function test (name, testFunction) { + return tape(`countries: ${name}`, testFunction) + } + + testcase(test, common) +}