Current results of "dictionary word count" programs...

Jayce^ jason at infogenix.com
Tue Mar 14 07:38:06 MST 2006


Bryan Sant wrote:
> Here are the current results for the "count the dictionary words in a
> file" programs submitted thus far.

Here's an non optimized Perl version.  I just wanted to do a quick 
version that squashed the main work into a single line, without using 
deep magic.  Like most posted, it assumes the text will be 'normal' (eg, 
not one word per line like the dictionary file), although, I did split 
out on more than whitespace, which I saw some do, as that will include 
punctuation with a word ( hello!, what?, etc. ), it would be faster 
without that.  It also does no form of safety checking besides the open 
calls, and attempts to load everything into memory.

Now, for the next trick, maybe we'll do one all in Regex :)

Once again, this is not normal code, in NO way can it be related as a 
preferred, or even condoned style! it is supposed to be all squashed up 
and chained together :)  And yes, it could be squashed a bit more if I 
wanted.

--
Jayce^
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: words.pl
Url: http://plug.org/pipermail/plug/attachments/20060314/ffbdb026/attachment.pl 


More information about the PLUG mailing list