Quantcast
Channel: What is the best algorithm for matching two string containing less than 10 words in latin script - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Donatello for What is the best algorithm for matching two string containing less than 10 words in latin script

$
0
0

Did you take a look at the levenshtein distance ?

int org.apache.commons.lang.StringUtils.getLevenshteinDistance(String s, String t)

Find the Levenshtein distance between two Strings.

This is the number of changes needed to change one String into another, where each change is a single character modification (deletion, insertion or substitution).

The previous implementation of the Levenshtein distance algorithm was from http://www.merriampark.com/ld.htm

Chas Emerick has written an implementation in Java, which avoids an OutOfMemoryError which can occur when my Java implementation is used with very large strings. This implementation of the Levenshtein distance algorithm is from http://www.merriampark.com/ldjava.htm

Anyway, I'm curious to know what do you choose in this case !


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>