NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
a word filter (Score:3, Informative)
(1) "edcba" contained (anywhere) within a word as a (sub-)string
(2} "e" at the end of one word and "dcba" at the beginning of another
(3) "de" at the end and "cba" at the beginning
(4) - (5) the obvious continuations.
To fully test this would require having a hash of leading n-letter strings, trailing n-letter strings, and anywhere n-letter strings. That is going to be a large number of combinations. Filtering out a bunch of irreversible words might make additional words irreversible (since they might have only be able to be reversed using words that have been filtered). So, those hashes should contain a count of how many times that particular sub-string exists, and when a word is found to be unusable, all of its substrings must be subtracted out - if any substring counts went to zero then another round of checking may produce additional words that can be deleted.
Reply to This