countries: abbreviate West and East names
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 26 Apr 2017 21:21:48 +0000 (23:21 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 16:51:17 +0000 (18:51 +0200)
Western Sahara and East Timor to W-Sah and E-Tim.

tools/mkcountries-geonames

index 209653e1818c1385d0b0bb9af4140ed0ff550f9c..56f85c41f0d921bfe1a5b88ae46cff534b35cf6c 100755 (executable)
@@ -90,11 +90,13 @@ for (values %cc) {
                s/ and / & /g and s/(?<=.)[a-z ]+//g;
                s/ of / /g;
                s/\bsa?int /st /gi;
                s/ and / & /g and s/(?<=.)[a-z ]+//g;
                s/ of / /g;
                s/\bsa?int /st /gi;
-               s/United /Un. /gi;
+               s/Un\Kited /. /gi;
                s/South(?:ern)? /S-/g;
                s/North(?:ern)? /N-/g;
                s/South(?:ern)? /S-/g;
                s/North(?:ern)? /N-/g;
+               s/West(?:ern)? /W-/g;
+               s/East(?:ern)? /E-/g;
                s/New /n./g;
                s/New /n./g;
-               s/(\S)(\S+)-/$1-/g;  # strip most chars preceding dash
+               s/(\w)(\w+)-/$1-/g;  # strip most chars preceding dash
                s/(\S{4}[b-df-hj-np-tv-xz])((?<!Austr)(?!land)\w{2,})/$1./g;  # abbreviate (at consonant)
                $_;
        };
                s/(\S{4}[b-df-hj-np-tv-xz])((?<!Austr)(?!land)\w{2,})/$1./g;  # abbreviate (at consonant)
                $_;
        };