I noticed that a number of individuals who post regularly to the NANOG mailing list have keyboards with malfunctioning shift keys. Since working keyboards are so expensive, far beyond the financial means of most poorly-paid technical workers, I humbly offer the following Perl program, which you can use to filter your NANOG e-mail to correct capitalization errors (procmail should do the trick for that). For example: i abhor cross-posting. but sometimes ... Gets converted to: I abhor cross-posting. But sometimes ... It's not perfect, but it catches most occurrances. If you have a slow computer, you probably want to disable the dictionary. You can do this by setting @DICT_FILES=(). As is, it is configured to search for the word list in the default locations in Linux and Solaris. And oh yes, it's a joke. ;) #!/usr/bin/perl -w # use good Perl form use strict; use English; # location of plain-text word list my @DICT_FILES = ("/usr/dict/words", "/usr/share/lib/dict/words"); # slurp in all input undef $INPUT_RECORD_SEPARATOR; my $input = <>; exit unless (defined($input)); # Fix end of paragraph $input =~ s/([a-z])(\n\n.)/$1.$2/g; # Fix start of sentence $input =~ s/(\n\n+)([a-z])/$1\u$2/g; $input =~ s/(\.\s+)([a-z])/$1\u$2/g; # Fix self-referental problems $input =~ s/(\b)i(\b)/$1I$2/g; $input =~ s/(\b)randy(\b)/$1Randy$2/g; $input =~ s/(\b)bush(\b)/$1Bush$2/g; # Fix words that should be capitalized (based on the dictionary) $INPUT_RECORD_SEPARATOR = "\n"; foreach my $dict_file (@DICT_FILES) { if (open(DICT, "< $dict_file")) { while (defined (my $uc_word=<DICT>)) { if ($uc_word =~ /[A-Z]/) { chomp($uc_word); my $lc_word = lc($uc_word); $input =~ s/(\b)$lc_word(\b)/$1$uc_word$2/g; } } last; } } # output our fixed text print $input; # The author releases this software into the public domain. -------------------------------------- AltaVista Smart is Beautiful http://www.altavista.com Raging Bull? Sleeping Bear? Live stock quotes at AltaVista Live! http://money.altavista.com --------------------------------------
bandyrush@altavista.com said:
I noticed that a number of individuals who post regularly to the NANOG mailing list have keyboards with malfunctioning shift keys. Since working keyboards are so expensive, far beyond the financial means of most poorly-paid technical workers, I humbly offer the following Perl program, which you can use to filter your NANOG e-mail to correct capitalization errors (procmail should do the trick for that). For example:
Date: 1 Mar 2000 20:11:04 -0800 (Thu 04:11 GMT)
You are a month early! Simon -- Simon Lockhart | Tel: +44 (0)1737 839676 Internet Engineering Manager | Fax: +44 (0)1737 839516 BBC Internet Services | Email: Simon.Lockhart@bbc.co.uk Kingswood Warren,Tadworth,Surrey,UK | URL: http://support.bbc.co.uk/
there is a bug in your mail system. it is regurgigating mail which, from the content, is clearly from the mid '70s, but it seems to have current dates in the header.
Received: from segue.merit.edu ([198.108.1.41]) by psg.com with esmtp (Exim 3.12 #1) id 12QMzj-0008bv-00; Wed, 01 Mar 2000 20:13:47 -0800 Received: by segue.merit.edu (Postfix) id 1EFD35DDB9; Wed, 1 Mar 2000 23:11:08 -0500 (EST) Delivered-To: nanog-outgoing@merit.edu Received: by segue.merit.edu (Postfix, from userid 56) id EC52B5DDB5; Wed, 1 Mar 2000 23:11:07 -0500 (EST) Received: from c012.sfo.cp.net (c012-h010.c012.sfo.cp.net [209.228.13.104]) by segue.merit.edu (Postfix) with SMTP id B07735DDA8 for <nanog@merit.edu>; Wed, 1 Mar 2000 23:11:05 -0500 (EST) Received: (cpmta 4757 invoked from network); 1 Mar 2000 20:11:04 -0800 Message-ID: <20000302041104.4756.cpmta@c012.sfo.cp.net> X-Sent: 2 Mar 2000 04:11:04 GMT Received: from [24.15.185.142] by mail.altavista.com with HTTP; 01 Mar 2000 20:11:04 PST Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 X-Mailer: Web Mail 3.5.1.4 Sender: owner-nanog@merit.edu Precedence: bulk Errors-To: owner-nanog-outgoing@merit.edu X-Loop: nanog Date: 1 Mar 2000 20:11:04 -0800 To: nanog@merit.edu From: Bandy Rush <bandyrush@altavista.com> Subject: Quick fix
I noticed that a number of individuals who post regularly to the NANOG mailing list have keyboards with malfunctioning shift keys. Since working keyboards are so expensive, far beyond the financial means of most poorly-paid technical workers, I humbly offer the following Perl program, which you can use to filter your NANOG e-mail to correct capitalization errors (procmail should do the trick for that). For example:
i abhor cross-posting. but sometimes ...
Gets converted to:
I abhor cross-posting. But sometimes ...
It's not perfect, but it catches most occurrances. If you have a slow computer, you probably want to disable the dictionary. You can do this by setting @DICT_FILES=(). As is, it is configured to search for the word list in the default locations in Linux and Solaris.
And oh yes, it's a joke. ;)
#!/usr/bin/perl -w
# use good Perl form use strict; use English;
# location of plain-text word list my @DICT_FILES = ("/usr/dict/words", "/usr/share/lib/dict/words");
# slurp in all input undef $INPUT_RECORD_SEPARATOR; my $input = <>; exit unless (defined($input));
# Fix end of paragraph $input =~ s/([a-z])(\n\n.)/$1.$2/g;
# Fix start of sentence $input =~ s/(\n\n+)([a-z])/$1\u$2/g; $input =~ s/(\.\s+)([a-z])/$1\u$2/g;
# Fix self-referental problems $input =~ s/(\b)i(\b)/$1I$2/g; $input =~ s/(\b)randy(\b)/$1Randy$2/g; $input =~ s/(\b)bush(\b)/$1Bush$2/g;
# Fix words that should be capitalized (based on the dictionary) $INPUT_RECORD_SEPARATOR = "\n"; foreach my $dict_file (@DICT_FILES) { if (open(DICT, "< $dict_file")) { while (defined (my $uc_word=<DICT>)) { if ($uc_word =~ /[A-Z]/) { chomp($uc_word); my $lc_word = lc($uc_word); $input =~ s/(\b)$lc_word(\b)/$1$uc_word$2/g; } } last; } }
# output our fixed text print $input;
# The author releases this software into the public domain.
-------------------------------------- AltaVista Smart is Beautiful http://www.altavista.com
Raging Bull? Sleeping Bear? Live stock quotes at AltaVista Live! http://money.altavista.com
--------------------------------------
and too many of them misspelled for the smugness quotient of the original post. I recommend re-enabling the dictionary. --Tom -- far too many words for randy
its not so much that my shift key doesn't work, that i gave it up to have an extra meta key for emacs functions to be mapped to. :-) loosing uppercase didn't seem so bad, however having just been through a bandwidth crunch, i was unable to take my companies' suggestion and switch from ascii to some a bit saving character set like bcd or fielddata to save two bits of bandwidth. On 1 Mar 2000, Bandy Rush wrote:
I noticed that a number of individuals who post regularly to the NANOG mailing list have keyboards with malfunctioning shift keys. Since working keyboards are so expensive, far beyond the financial means of most poorly-paid technical workers, I humbly offer the following Perl program, which you can use to filter your NANOG e-mail to correct capitalization errors (procmail should do the trick for that). For example:
i abhor cross-posting. but sometimes ...
Gets converted to:
I abhor cross-posting. But sometimes ...
It's not perfect, but it catches most occurrances. If you have a slow computer, you probably want to disable the dictionary. You can do this by setting @DICT_FILES=(). As is, it is configured to search for the word list in the default locations in Linux and Solaris.
And oh yes, it's a joke. ;)
#!/usr/bin/perl -w
# use good Perl form use strict; use English;
# location of plain-text word list my @DICT_FILES = ("/usr/dict/words", "/usr/share/lib/dict/words");
# slurp in all input undef $INPUT_RECORD_SEPARATOR; my $input = <>; exit unless (defined($input));
# Fix end of paragraph $input =~ s/([a-z])(\n\n.)/$1.$2/g;
# Fix start of sentence $input =~ s/(\n\n+)([a-z])/$1\u$2/g; $input =~ s/(\.\s+)([a-z])/$1\u$2/g;
# Fix self-referental problems $input =~ s/(\b)i(\b)/$1I$2/g; $input =~ s/(\b)randy(\b)/$1Randy$2/g; $input =~ s/(\b)bush(\b)/$1Bush$2/g;
# Fix words that should be capitalized (based on the dictionary) $INPUT_RECORD_SEPARATOR = "\n"; foreach my $dict_file (@DICT_FILES) { if (open(DICT, "< $dict_file")) { while (defined (my $uc_word=<DICT>)) { if ($uc_word =~ /[A-Z]/) { chomp($uc_word); my $lc_word = lc($uc_word); $input =~ s/(\b)$lc_word(\b)/$1$uc_word$2/g; } } last; } }
# output our fixed text print $input;
# The author releases this software into the public domain.
-------------------------------------- AltaVista Smart is Beautiful http://www.altavista.com
Raging Bull? Sleeping Bear? Live stock quotes at AltaVista Live! http://money.altavista.com
--------------------------------------
-- Dan Boehlke, Senior Network Engineer Onvoy Internet: dboehlke@onvoy.com Formerly MEANS and MRNet Phone: 612-362-5814 2829 SE University Ave. Suite 200 WWW: http://www.onvoy.com/~dboehlke/ Minneapolis, MN 55414
participants (7)
-
Alex Bligh
-
Bandy Rush
-
Dan Boehlke
-
Randy Bush
-
Roeland M.J. Meyer
-
Simon Lockhart
-
Tom Walton