views:

42

answers:

2

Hello together,

i need some decision help today :-)

  • interface A) an input field where the user can type his search parameters.

  • interface B) next step he will come to some mask, where he can refine his search.

if he enters some defined words (there are about 10) in A the corresponding checkboxes in B should be be checked. Next to these Words he can enter other stuff, which will be found after step B is submitted

  1. the interface A should help the user via auto-complete function for those few words
  2. if the user does not care about the suggested words and still spells my keywords wrong, the system should find them although.

sounds after phonetic search for me, but is it necessary to implement a full featured algorithm for 10 Words, that could be found?

is there an admitted easier/faster/lightweight way to do this?

thanks in advice

+1  A: 

You could store a list of possible/common misspelling for each - much simpler.

For simple misspelling (letter switching, etc.) - a simple distance measuring heuristic would also be a good idea.

Ofir
this is exactly what i thought of too. i found the levenshtein algorithm, which calculates the distance between tow strings.it#s available in php native (http://www.php.net/manual/de/function.levenshtein.php), and with php.js (http://phpjs.org/functions/levenshtein:463) in javascript as well...
helle
calculating levenshtein is, I believe, more expensive then metaphones.
Unreason
hm ... thats a reason ... do you have any link to metaphones with other languages than english?
helle
A: 

I think that you could use double metaphone. It is used by some spelling checkers.

Might be exactly what you are looking for.

Unreason
Great link, but isn't that exactly what he is trying to avoid?
Ofir
thank you. there is a problem with metaphone. it's matching for English only. I need it for Germany, Italy, Spain - well yes and England.
helle
Well, it is not hopeless with other languages either - even though the pronunciation are developed for english it also works on getting a more proper pronunciation of other languages (it was developed because SOUNDEX was horrible and it was used a lot for matching names); so double metaphone performs reasonably well even for non-english languages (as I said spelling checkers use it - not only for english).As for measuring the distance, yes of course, but if you hash your entries using metaphone you should be able to jump to your dictionary entry
Unreason