Hi, I have a dictionary loaded into a hashmap, and I have a partial decrypted word. What I want to know is how do I enter a string (e.g. atteJFtiHU) lowercase letters are known letters and uppercase are still crypted letters. And search the dictionary on possible matches. Maybe the first question should be is a hashmap a good way to go about this or would a linkedlist be better? So I want to say here's my string 'atteJFtiHU' and have it return saying this is the list of possible matches e.g. 'attempting'. Any advice would be greatly received.
Joined: Mar 06, 2007
This is what I have so far, but returns a nullPointerException, and I'm not sure it's going to do what I expect it to.
dictionary.get is not doing what you think it does. Read the javadoc for Map/HashMap carefully.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Thank you, that was a big improvement on my old code, the only thing is it's not able to work out the partially decrypted word, if I say: String strToCompare = "attempting"; Then it returns it from the set, but if I pass in: String strToCompare = "atteJFtiHU"; Then nothing happens, how can I search the Set for a word that is a possible match to "atteJFtiHU" - lowerCase letters are letters that have been worked out uppercase are letters that haven't been worked out yet.
Joined: Mar 06, 2007
Thank you for your help, I have now worked out the problem
[Gary Goldsmith:] Thank you for your help, I have now worked out the problem
Well can we see the code ? Some others are working on this same problem (me) and a fast, efficient decryption approach is always of interest in the matter - such as maintaining a precompiled TreeSet of Patterns for working through Collections of junk mail looking for the markers that Oscar De Grouch should have a chance at. [ November 25, 2007: Message edited by: Nicholas Jordan ]
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."