I am creating a small language dictionary application that requires the user to input a word (in either two languages) and have the most relevant results (Out of 10 or more) show up. My client wants this to account for spelling errors so I'm using the Damerau-Levenshtein distance formula. As an example here is a snippet of what the application should do:
MySQL fields - Term1 -> Value1 | Term2 -> Value2
Implementation - English Term -> English Value | German Term -> German Value
----------
forge -> to forge your parent's signature | fälschen -> die unterschrift de eltern fälschen
Synonyms: fake, imitation, etc,
fake -> to fake your parent's signature | fälschen -> die unterschrift de eltern fälschen
Synonyms: forge, imitation, etc,
black out -> to black out a classroom (with blinds) | verdunkeln -> (einen klassenraum) verdunkeln
Since fake and forge are similar I want the search results for forge (or foreg etc.) to return the two. I have a crude implementation working right now that will search through every row of a large database but it is a long process and I need a better system.
As additional information I am using the Moby Thesaurus to find synonyms of each word returned. To cut down on bulk synonyms (as nearly 20 results are placed in the array) I will probably strip entries that aren't found in the database.
Anyways, what I'm trying to find out is if there is a faster, more efficient method for search the database than what I am using right now. I hope I am clear enough, if not feel free to ask me more.
Many thanks!