perlquestion
ehdonhon
<P>I have a lot of strings which are potentially nonsense, but might contain a few english words. For example:<br>
<pre>owijfwapplelaskfiwejfcherryalkfwiofwfblossomowiejf</pre>
contains the words "apple", "cherry" and "blossom".</p>
<P>My job is to score each string so that strings that are composed entirely of words get a better score than strings that are not. Strings with the fewest number of words will also get a higher score than strings with many words.</P>
<P>Is this a job for recursive descent parsing, or is there a faster way to be doing this? For this task, I am willing to trade off a little accuracy for speed. I'm trying to remember back to my cryptography class to think if there was any kind of algorithm to decide if a string was likely to be an english word.</P>
<P>My dictionary is going to consist of about 250,000 words. I can store them on the disk in any fashion I want. Is there any kind of format (perhaps some db file format) that would lend itself well to the kind of lookups that I am going to need to be doing?</P>
<P>I see there is a [cpan://Text::ExtractWords] module on CPAN, but it doesn't seem to be actually implemented. There is also [cpan://Games::TrackWord], but it wants me to loop through every single dictionary word to try to find it. That would take too long. Is there a CPAN module that would be a good fit for me?</P>
<P>Thanks