Implementation of various string similarity and distance algorithms in Java
github.com
github.com
String similarity and distance algorithms are different with semantic similarity (knowledge-based). It calculates the similarity based-on relationship of word to another word (hierarchy/tree). So, If you need a library that can calculate semantic similarity instead of string and distance in Java, I would recommend this [1].
Spring (and others) is an exception (stack trace) obfuscation framework.
https://github.com/tdebatty/java-string-similarity/blob/mast...
The example code in README.md can probably do this instead:
MetricStringDistance msd = new Levenshtein();
System.out.println(msd.distance("My string", "My $tring"));
MetricStringDistance msd2 = new MetricLCS();
System.out.println(msd2.distance("ABDEF", "ABDIF"));Implementing mock objects which return "unexpected" results is impossible with static methods.
The standard 1 interface + 1 impl pattern in Java is just so that the Proxy.newProxyInstance can create a decorated or mocked object for testing.
So you can test the methods directly, but you can't write failure-inducing methods (like a connect exception throwing one) which test the methods which use it.
Any plans on including this in Apache Commons?
How does it compare to StringUtils in Apache Commons?
You can take a look at the current project here https://commons.apache.org/sandbox/commons-text/
very nice variety and good readme! good job