I need to create a spell checker with hashing. So far I pretty much made a hash table with linked lists but don't really know how to 'Mod' strings.
The code below is my Dictionary class which takes in a .txt file that is a word bank. with single alphabet letters before the start of the words with that letter.
Then i have a scan class in which i attempt to go through the linked lists and try to identify the strings. I don't even know :P
How would i check words for misspellings and compare them to the dictionary then provide options for the user to change the words?
Any help is very appreciative
also i forgot to include the OpenFile method which opens a short .txt doc that is misspelled.
Matt Wilde wrote:Are these even some plausible ideas? is there another way anyone suggests i should go about this?
This is nice, but it is still all written in terms of Java. We often want to start in with Java right away, because writing code is fun. Forget about Java. Forget about the computer. How would you, without the aid of a couputer, check the spelling in an excerpt of text? That's where you should start.
Joined: Feb 27, 2012
Well, I would first start reading something. Then if i saw a word that did not look correct or i couldn't pronounce correctly, i would think back to all my years of vocabulary lessons in grade school and books i have read over the years and perhaps look in the dictionary for words that looked similar to that word. words that had the same general prefix or beginning?
This is good but it is a high level description of how you check the spelling of some text. For instance when you say:
"I would first start reading something" you really should say "for each word in the text" or "I look at the text and break it into individual words"
"Then if i saw a word that did not look correct ..." how do know you it doesn't look correct, as you say it is because you are referring to the words you have learned over time ie your internal dictionary. So maybe this should be "check every word against the dictionary to see if it is a known word".
Finding the correct spelling of an unknown word can be quite tricky to describe and even harder to compute. When you do come to code it I believe you can use the Damerau-Levenshtein distance to help find words that might be the correct ones, although there may also be other (possibly better) strategies. Google may help you here.