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.

46 lines
817 B

  1. #!/usr/bin/perl
  2. while (<>) {
  3. next if /^\./;
  4. next if /^From / .. /^$/;
  5. next if /^Path: / .. /^$/;
  6. s/^\W+//;
  7. push(@ary,split(' '));
  8. while ($#ary > 1) {
  9. $a = $p;
  10. $p = $n;
  11. $w = shift(@ary);
  12. $n = $num{$w};
  13. if ($n eq '') {
  14. push(@word,$w);
  15. $n = pack('S',$#word);
  16. $num{$w} = $n;
  17. }
  18. $lookup{$a . $p} .= $n;
  19. }
  20. }
  21. for (;;) {
  22. $n = $lookup{$a . $p};
  23. ($foo,$n) = each(lookup) if $n eq '';
  24. $n = substr($n,int(rand(length($n))) & 0177776,2);
  25. $a = $p;
  26. $p = $n;
  27. ($w) = unpack('S',$n);
  28. $w = $word[$w];
  29. $col += length($w) + 1;
  30. if ($col >= 65) {
  31. $col = 0;
  32. print "\n";
  33. }
  34. else {
  35. print ' ';
  36. }
  37. print $w;
  38. if ($w =~ /\.$/) {
  39. if (rand() < .1) {
  40. print "\n";
  41. $col = 80;
  42. }
  43. }
  44. }