[SOLVED] HashMap & Spell checking
Hi, I'm fairly new to Java, and especially to HashMaps. Basically what I need to do is make a spell checker that reads a dictionary file (txt) and maps it in a hashmap, so that every key is a word and every value is a non-null object (so that every "word" with value Null is certain to be incorrect or not part of the dictionary):
Key1: a Value1: 1
key2: Aa Value2: 2
key23: Atomic bomb Value23: 23
I've made the HashMap, but now I need to find every word that has an edit distance of 2 (or less) compared to a word I need to check spelling of. How would I do this? I know how to check whether the max edit distance is 2, but how do I find the words in the dictionary, without having to compare every single word?