Improving search result using Levenshtein distance in Java

前端 未结 5 1342
南方客
南方客 2021-01-31 03:08

I have following working Java code for searching for a word against a list of words and it works perfectly and as expected:

public class Levenshtein {
    privat         


        
5条回答
  •  失恋的感觉
    2021-01-31 03:55

    This really is an open-ended question, but I would suggest an alternative approach which uses for example the Smith-Waterman algorithm as described in this SO.

    Another (more light-weight) solution would be to use other distance/similarity metrics from NLP (e.g., Cosine similarity or Damerau–Levenshtein distance).

提交回复
热议问题