I'm taking a list of letters and finding matches in the dictionary that contain a permutation of these letters. I have gotten to the point where if I pass it the string "ciolnaot", it will find 'location'. This is being done with the above-mentioned Algorithm::Permute. This is working fine, but now I need to add a new twist to it. I want to specify the length of the words the script will find in the dictionary. Meaning that if I specify the string "ciolnaot" and a length of 4, I want to find 'coal', 'colt', 'loin', 'lion', 'toil', and whatever other 4-letter words exist in there, and only the words of that length.
So rather than taking the string, splitting it and finding permutations of it, it seems it becomes more complicated as I think I'll need to get 4-character permutations from the original string of letters, and then permutate each of those permutations... Am I making sense anymore? :)
One thing I hope I may be missing is another module like Algorithm::Permute that is more advanced, in allowing permutation string lengths or something similar. Please help!
-------------------------------------
eval reverse@{[lreP
=>q{ tsuJ\{qq},' rehtonA'
,q{\}rekcaH },' tnirp']}[1+1+
1,1-1,1+1,1*1,(1+1)*(1+1)];
-------------------------------------
In reply to N Permutations of M Items by mt2k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |