Martin DeMello
12/12/2005 7:58:00 AM
wrong@socal.rr.com wrote:
> i goofed up my thread by using the word "anagram" incorrectly, or too
> loosely... i also wanted to find all the smaller words that i can
> make with the letters that i have. for example i would like for
> "monkey" to return with "monk" and "key" and "money" and so on, not
> just 6 letter words.
One interesting way to do subset finding in words is to hook up a fast
bignum library (I think ruby/gsl should do this), and index each letter
with a prime number, so that a word maps to the product of its letters.
Then word_b contains word_a if number_b % number_a == 0.
martin