1

I have an application which lets people ask predefined queries. However, the list of such queries is too long. Hence, the current approach is to let users enter a word in the search box and then show them the likely matches from the list of queries. ( Very much like google's "Did you mean" feature.)

Is there an API in Java available for this? I should be able to supply the list of queries. The API should provide a fuzzy match capability, so that incorrect spellings do not matter. ( That is why an exact String matching algorithm is not sufficient)

athena
  • 5,579
  • 8
  • 30
  • 31

4 Answers4

0

The magic word here may be "regular expression" -- anything you can model as a finite state machine can be done with regular expressions.

Failing that, you might look into "digital search trees" or "tries".

Charlie Martin
  • 110,348
  • 25
  • 193
  • 263
0

Some of the API's i can suggest are:

Similar SO Questions:

Community
  • 1
  • 1
Emil
  • 13,577
  • 18
  • 69
  • 108
0

Perhaps a probabilistic algorithm using Soundex or a derivative would work? http://en.wikipedia.org/wiki/Soundex

Dilum Ranatunga
  • 13,254
  • 3
  • 41
  • 52
0

Found these Java implementation of Peter Norvig's spell correction algorithm. A bit dated, but good for getting started.

  1. Spelling Corrector
  2. jSpellCorrect
athena
  • 5,579
  • 8
  • 30
  • 31