Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding words from random input letters in python. What algorithm to use/code already there?

I am trying to code a word descrambler like this one here and was wondering what algorithms I should use to implement this. Also, if anyone can find existing code for this that would be great as well. Basically the functionality is going to be like a boggle solver but without being a matrix, just searching for all word possibilities from a string of characters. I do already have adequate dictionaries.

I was planning to do this in either python or ruby. Thanks in advance for your help guys!

like image 941
Javed Ahamed Avatar asked Feb 14 '26 13:02

Javed Ahamed


1 Answers

I'd use a Trie. Here's an implementation in Python: http://jtauber.com/2005/02/trie.py (credit to James Tauber)

like image 126
perimosocordiae Avatar answered Feb 17 '26 02:02

perimosocordiae



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!