Clear questions and runnable code
get the best and fastest answer
Challenge: "Words" In A Stringby Limbic~Region (Chancellor)
|on Sep 18, 2008 at 22:55 UTC||Need Help??|
Limbic~Region has asked for the
wisdom of the Perl Monks concerning the following question:
I am pretty sure this question has been asked before but my Super Search fu is weak.
Use the official '2of12inf.txt' file from here stripped of all non-alpha characters and forced to lowercase.
The code should accept a file name as a command line argument. The file will contain a list of strings, one on each line. The string needs to be forced to lowercase with all non-alpha characters removed like the dictionary above.
For each line of input, the code should output all possible substrings (separated by whitespace) with the following constraints:
For a somewhat similar challenge, see One for the weekend: challenge. Note: The example above was done by hand and could possibly not include all possibilities.
Update: Clarified constraint two thanks to /msg from ikegami
Cheers - L~R
Update: Clarified example thanks to /msg from blokhead and ikegami