3 print STDERR "Loading proper nouns...\n";
4 open(DICT,"/usr/dict/words") || die "Can't find /usr/dict/words: $!\n";
8 ($lower = $_) =~ y/A-Z/a-z/;
13 print STDERR "Loading exceptions...\n";
19 s/(\w+)/$proper{$1} ? $proper{$1} : $1/eg;
20 s/^(\s*)([a-z])/$1 . (($tmp = $2) =~ y:a-z:A-Z:,$tmp)/e;
21 s/([-.?!]["']?(\n\s*| \s*)["']?)([a-z])/$1 . (($tmp = $3) =~ y:a-z:A-Z:,$tmp)/eg;
22 s/\b([b-df-hj-np-tv-xz]+)\b/(($tmp = $1) =~ y:a-z:A-Z:,$tmp)/eg;
23 s/([a-z])'([SDT])\b/$1 . "'" . (($tmp = $2) =~ y:A-Z:a-z:,$tmp)/eg;
32 print STDERR "Dup $_\n" if $proper{$foo};
33 $foo =~ s/([^\w ])/\\$1/g;
35 $foo = "\\b" . $foo if $foo =~ /^\w/; # XXX till patch 9
36 $foo .= "\\b" if $foo =~ /\w$/;
38 ($bar = $_) =~ s/ /'$' . ++$i/eg;
39 $_ = "s/$foo/$bar/gi;";
41 $prog .= ' ' . $_ . "\n";
43 $prog .= "}\ncontinue {\n print;\n}\n";
47 eval $prog; die $@ if $@;
58 Bureau of Labor Statistics
84 Institute of Technology
91 Long Duration Exposure Facility
100 s/\bmay (\d)/May $1/g;
101 s/\boffice of (\w)/'Office of ' . (($tmp = $1) =~ y:a-z:A-Z:,$tmp)/eg;
102 National Science Foundation
108 Office of Management and Budget
125 Union of Soviet Socialist Republics
131 Vice President Quayle
141 Aerospace Industries Association
156 Jet Propulsion Laboratory
158 Department of Defense
161 United Press International
174 Japanese Satellite Communications
178 Fixed Service Structure
179 Launch Processing System
181 Launch Control Center