0

I'm using Lucene as a best effort match to map from user input to a long list of previous inputs for categorizing - and this works great -most- cases so far.

Problematic example:

Index:

  • Ford
  • Mercedes
  • Honda
  • I like toyota a lot

Input:

  • ford (exact match: works great)
  • toyota (partial match in a longer index entry: works great)
  • i used to have a mercedes but now i dont however (longer text with a short exact match contained: will usually give either a long completely unrelated - fuzzy - match - or nothing)

I guess what I'm looking for is finding the longest common subsequence in case it's not one of the first two cases - but then again, I'm relatively new to Lucene, so maybe I just don't know enough search-lingo to explain it properly.

1 Answer 1

1

What you might need is n-gramm similarity

see NGramDistance class

Edit wikipedia link http://en.wikipedia.org/wiki/Approximate_string_matching

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.