This is a library that implements various measures of string similarity and distance.
Add the Maven Central repository if it is not already there:
repositories {
mavenCentral()
}
Add a dependency to the dependencies block:
dependencies {
implementation "com.aallam.similarity:string-similarity-kotlin:$version"
}
The following is the list of implemented algorithms:
- Levenshtein
- Normalized Levenshtein
- Weighted Levenshtein
- Damerau-Levenshtein
- Optimal String Alignment
- Jaro-Winkler
- Longest Common Subsequence
- Metric Longest Common Subsequence
- N-Gram
- Q-Gram
- Cosine similarity
- Jaccard index
- Sorensen-Dice coefficient
- Ratcliff-Obershelp
The library is a Kotlin port of java-string-similarity.
The library is an open-sourced software licensed under the MIT license.