Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
3.0 KiB

  1. #!/usr/bin/perl
  2. print STDERR "Loading proper nouns...\n";
  3. open(DICT,"/usr/dict/words") || die "Can't find /usr/dict/words: $!\n";
  4. while (<DICT>) {
  5. if (/^[A-Z]/) {
  6. chop;
  7. ($lower = $_) =~ y/A-Z/a-z/;
  8. $proper{$lower} = $_;
  9. }
  10. }
  11. close DICT;
  12. print STDERR "Loading exceptions...\n";
  13. $prog = <<'EOT';
  14. while (<>) {
  15. next if /[a-z]/;
  16. y/A-Z/a-z/;
  17. s/(\w+)/$proper{$1} ? $proper{$1} : $1/eg;
  18. s/^(\s*)([a-z])/$1 . (($tmp = $2) =~ y:a-z:A-Z:,$tmp)/e;
  19. s/([-.?!]["']?(\n\s*| \s*)["']?)([a-z])/$1 . (($tmp = $3) =~ y:a-z:A-Z:,$tmp)/eg;
  20. s/\b([b-df-hj-np-tv-xz]+)\b/(($tmp = $1) =~ y:a-z:A-Z:,$tmp)/eg;
  21. s/([a-z])'([SDT])\b/$1 . "'" . (($tmp = $2) =~ y:A-Z:a-z:,$tmp)/eg;
  22. EOT
  23. while (<DATA>) {
  24. chop;
  25. next if /^$/;
  26. next if /^#/;
  27. if (! /;$/) {
  28. $foo = $_;
  29. $foo =~ y/A-Z/a-z/;
  30. print STDERR "Dup $_\n" if $proper{$foo};
  31. $foo =~ s/([^\w ])/\\$1/g;
  32. $foo =~ s/ /(\\s+)/g;
  33. $foo = "\\b" . $foo if $foo =~ /^\w/; # XXX till patch 9
  34. $foo .= "\\b" if $foo =~ /\w$/;
  35. $i = 0;
  36. ($bar = $_) =~ s/ /'$' . ++$i/eg;
  37. $_ = "s/$foo/$bar/gi;";
  38. }
  39. $prog .= ' ' . $_ . "\n";
  40. }
  41. $prog .= "}\ncontinue {\n print;\n}\n";
  42. $/ = '';
  43. #print $prog;
  44. eval $prog; die $@ if $@;
  45. __END__
  46. A.M.
  47. Air Force
  48. Air Force Base
  49. Air Force Station
  50. American
  51. Apr.
  52. Ariane
  53. Aug.
  54. August
  55. Bureau of Labor Statistics
  56. CIT
  57. Caltech
  58. Cape Canaveral
  59. Challenger
  60. China
  61. Corporation
  62. Crippen
  63. Daily News in Brief
  64. Daniel Quayle
  65. Dec.
  66. Discovery
  67. Edwards
  68. Endeavour
  69. Feb.
  70. Ford Aerospace
  71. Fri.
  72. General Dynamics
  73. George Bush
  74. Headline News
  75. HOTOL
  76. I
  77. II
  78. III
  79. IV
  80. IX
  81. Institute of Technology
  82. JPL
  83. Jan.
  84. Jul.
  85. Jun.
  86. Kennedy Space Center
  87. LDEF
  88. Long Duration Exposure Facility
  89. Long March
  90. Mar.
  91. March
  92. Martin
  93. Martin Marietta
  94. Mercury
  95. Mon.
  96. in May
  97. s/\bmay (\d)/May $1/g;
  98. s/\boffice of (\w)/'Office of ' . (($tmp = $1) =~ y:a-z:A-Z:,$tmp)/eg;
  99. National Science Foundation
  100. NASA Select
  101. New Mexico
  102. Nov.
  103. OMB
  104. Oct.
  105. Office of Management and Budget
  106. President
  107. President Bush
  108. Richard Truly
  109. Rocketdyne
  110. Russian
  111. Russians
  112. Sat.
  113. Sep.
  114. Soviet
  115. Soviet Union
  116. Soviets
  117. Space Shuttle
  118. Sun.
  119. Thu.
  120. Tue.
  121. U.S.
  122. Union of Soviet Socialist Republics
  123. United States
  124. VI
  125. VII
  126. VIII
  127. Vice President
  128. Vice President Quayle
  129. Wed.
  130. White Sands
  131. Kaman Aerospace
  132. Aerospace Daily
  133. Aviation Week
  134. Space Technology
  135. Washington Post
  136. Los Angeles Times
  137. New York Times
  138. Aerospace Industries Association
  139. president of
  140. Johnson Space Center
  141. Space Services
  142. Inc.
  143. Co.
  144. Hughes Aircraft
  145. Company
  146. Orbital Sciences
  147. Swedish Space
  148. Arnauld
  149. Nicogosian
  150. Magellan
  151. Galileo
  152. Mir
  153. Jet Propulsion Laboratory
  154. University
  155. Department of Defense
  156. Orbital Science
  157. OMS
  158. United Press International
  159. United Press
  160. UPI
  161. Associated Press
  162. AP
  163. Cable News Network
  164. Cape York
  165. Zenit
  166. SYNCOM
  167. Eastern
  168. Western
  169. Test Range
  170. Jcsat
  171. Japanese Satellite Communications
  172. Defence Ministry
  173. Defense Ministry
  174. Skynet
  175. Fixed Service Structure
  176. Launch Processing System
  177. Asiasat
  178. Launch Control Center
  179. Earth
  180. CNES
  181. Glavkosmos
  182. Pacific
  183. Atlantic