git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keys: move key definitions into translation includes
[sheet.git]
/
tools
/
mkcountries-geonames
diff --git
a/tools/mkcountries-geonames
b/tools/mkcountries-geonames
index ddc963cefb331f746c40b22e8804689a2e5cf537..56f85c41f0d921bfe1a5b88ae46cff534b35cf6c 100755
(executable)
--- a/
tools/mkcountries-geonames
+++ b/
tools/mkcountries-geonames
@@
-1,5
+1,5
@@
#!/usr/bin/env perl
#!/usr/bin/env perl
-use 5.01
2
;
+use 5.01
4
;
use warnings;
my %cc; # map of country code to info array
use warnings;
my %cc; # map of country code to info array
@@
-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/Un
ited /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)
$_;
};