|
1 | 1 | {% macro country_normalization(raw_country_name) %}
|
2 | 2 | case
|
3 |
| - when lower({{raw_country_name }}) in ('åland') then 'åland islands' |
| 3 | + when lower({{raw_country_name }}) in ('åland','aland islands') then 'åland islands' |
| 4 | + when lower({{raw_country_name }}) in ('antigua & barbuda') then 'antigua and barbuda' |
| 5 | + when lower({{raw_country_name }}) in ('the bahamas') then 'bahamas' |
| 6 | + when lower({{raw_country_name }}) in ('caribbean netherlands') then 'bonaire, sint eustatius, and saba' |
| 7 | + when lower({{raw_country_name }}) in ('bosnia herzegovina','bosnia & herzegovina') then 'bosnia and herzegovina' |
4 | 8 | when lower({{raw_country_name }}) in ('brunei') then 'brunei darussalam'
|
5 | 9 | when lower({{raw_country_name }}) in ('cape verde') then 'cabo verde'
|
6 | 10 | when lower({{raw_country_name }}) in ('cocos [keeling] islands') then 'cocos (keeling) islands'
|
7 |
| - when lower({{raw_country_name }}) in ('dr congo','congo','congo, the democratic republic of the') then 'congo, democratic republic of' |
| 11 | + when lower({{raw_country_name }}) in ('dr congo','congo','congo, the democratic republic of the','democratic republic of congo','democratic republic of the congo') then 'congo, democratic republic of' |
8 | 12 | when lower({{raw_country_name }}) in ('republic of the congo','congo republic') then 'congo, republic of'
|
9 | 13 | when lower({{raw_country_name }}) in ('ivory coast','cote d''ivoire') then 'côte d''ivoire'
|
10 | 14 | when lower({{raw_country_name }}) in ('czech republic') then 'czechia'
|
11 | 15 | when lower({{raw_country_name }}) in ('swaziland') then 'eswatini'
|
| 16 | + when lower({{raw_country_name }}) in ('falkland islands (islas malvinas)') then 'falkland islands' |
| 17 | + when lower({{raw_country_name }}) in ('the gambia') then 'gambia' |
12 | 18 | when lower({{raw_country_name }}) in ('iran, islamic republic of') then 'iran'
|
13 | 19 | when lower({{raw_country_name }}) in ('hashemite kingdom of jordan') then 'jordan'
|
| 20 | + when lower({{raw_country_name }}) in ('republic of kosovo') then 'kosovo' |
14 | 21 | when lower({{raw_country_name }}) in ('lao people''s democratic republic') then 'laos'
|
15 | 22 | when lower({{raw_country_name }}) in ('republic of lithuania') then 'lithuania'
|
16 | 23 | when lower({{raw_country_name }}) in ('macau') then 'macao'
|
17 |
| - when lower({{raw_country_name }}) in ('federated states of micronesia') then 'micronesia, federated states of' |
| 24 | + when lower({{raw_country_name }}) in ('federated states of micronesia','micronesia') then 'micronesia, federated states of' |
18 | 25 | when lower({{raw_country_name }}) in ('republic of moldova','moldova') then 'moldova, republic of'
|
19 | 26 | when lower({{raw_country_name }}) in ('principality of monaco') then 'monaco'
|
20 |
| - when lower({{raw_country_name }}) in ('myanmar [burma]') then 'myanmar' |
| 27 | + when lower({{raw_country_name }}) in ('myanmar [burma]','republic of the union of myanmar','myanmar (burma)') then 'myanmar' |
21 | 28 | when lower({{raw_country_name }}) in ('the netherlands') then 'netherlands'
|
22 | 29 | when lower({{raw_country_name }}) in ('korea, democratic people''s republic of') then 'north korea'
|
23 |
| - when lower({{raw_country_name }}) in ('macedonia') then 'north macedonia' |
24 |
| - when lower({{raw_country_name }}) in ('palestinian territory') then 'palestine' |
| 30 | + when lower({{raw_country_name }}) in ('macedonia','macedonia (fyrom)') then 'north macedonia' |
| 31 | + when lower({{raw_country_name }}) in ('kingdom of norway') then 'norway' |
| 32 | + when lower({{raw_country_name }}) in ('palestinian territory','palestinian territories') then 'palestine' |
| 33 | + when lower({{raw_country_name }}) in ('pitcairn islands') then 'pitcairn' |
| 34 | + when lower({{raw_country_name }}) in ('reunion') then 'réunion' |
25 | 35 | when lower({{raw_country_name }}) in ('russian federation') then 'russia'
|
26 |
| - when lower({{raw_country_name }}) in ('saint-barthélemy','saint-barthélemy') then 'saint barthélemy' |
27 |
| - when lower({{raw_country_name }}) in ('saint helena') then 'saint helena, ascension, and tristan da cunha' |
| 36 | + when lower({{raw_country_name }}) in ('saint-barthélemy') then 'saint barthélemy' |
| 37 | + when lower({{raw_country_name }}) in ('saint helena','saint helena ascension and tristan da cunha') then 'saint helena, ascension, and tristan da cunha' |
28 | 38 | when lower({{raw_country_name }}) in ('st kitts and nevis') then 'saint kitts and nevis'
|
| 39 | + when lower({{raw_country_name }}) in ('collectivity of saint martin') then 'saint martin' |
29 | 40 | when lower({{raw_country_name }}) in ('st vincent and grenadines') then 'saint vincent and the grenadines'
|
30 | 41 | when lower({{raw_country_name }}) in ('sao tome and principe') then 'são tomé and príncipe'
|
31 | 42 | when lower({{raw_country_name }}) in ('slovak republic') then 'slovakia'
|
32 | 43 | when lower({{raw_country_name }}) in ('republic of korea', 'korea, republic of') then 'south korea'
|
33 | 44 | when lower({{raw_country_name }}) in ('syrian arab republic') then 'syria'
|
34 | 45 | when lower({{raw_country_name }}) in ('tanzania, united republic of') then 'tanzania'
|
35 |
| - when lower({{raw_country_name }}) in ('democratic republic of timor-leste','east timor') then 'timor-leste' |
| 46 | + when lower({{raw_country_name }}) in ('democratic republic of timor-leste','east timor','timor leste') then 'timor-leste' |
36 | 47 | when lower({{raw_country_name }}) in ('turkey') then 'türkiye'
|
| 48 | + when lower({{raw_country_name }}) in ('northern ireland') then 'united kingdom' |
37 | 49 | when lower({{raw_country_name }}) in ('u.s. minor outlying islands') then 'united states minor outlying islands'
|
| 50 | + when lower({{raw_country_name }}) in ('us virgin islands') then 'u.s. virgin islands' |
38 | 51 | when {{raw_country_name}} = '' then NULL
|
39 | 52 | else lower({{raw_country_name }})
|
40 | 53 | end
|
|
0 commit comments