#!/usr/bin/env perl
-use 5.012;
+use 5.014;
use warnings;
my %cc; # map of country code to info array
s/(?<=.)\(.*\)\s*//;
s/ republic\b//gi;
s/ islands?\b//gi;
- s/\bthe //g;
+ s/\bthe //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/West(?:ern)? /W-/g;
+ s/East(?:ern)? /E-/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)
$_;
};