Skip to content

solo-studios/kt-fuzzy

Repository files navigation

Kotlin Fuzzy

MIT license Maven Central Pure Kotlin Discord Server

A zero-dependency multiplatform library for fuzzy string matching in Kotlin which is roughly equivalent to the Python package thefuzz (Previously "fuzzywuzzy") without the GPL license.

Kotlin Fuzzy String Matching

Kotlin Fuzzy, or kt-fuzzy was created because the only other options for Java/Kotlin fuzzy string matching libraries were under the GPL. This meant, they couldn't be used in non-GPL projects. So, I created this library to remedy that.

This library was inspired by libraries like javawuzzy, fuzzywuzzy-kotlin, and thefuzz but does not use any code from them, allowing it to exist without the GPL license.

This library was designed with the goal of mimicking their functionality, without directly using any code from those repositories.

There are two modules that can be used:

Kotlin String Similarity

The secondary module, Kotlin String Similarity implements various string similarity and distance measures. It contains over a dozen such algorithms, including Levenshtein distance (and siblings), Jaro-Winkler, Longest Common Subsequence, cosine similarity, and many others.

It primarily a direct port of Java String Similarity by tdebatty.

If you want to depend only on this module, you do not need to add a dependency on Kotlin Fuzzy to do so. Read the Kotlin String Similarity README for more info.

Features

  • No dependencies
  • Simple to use
  • Performance friendly

Including

You can include Kotlin Fuzzy in your project by adding the following, depending on your platform:

Maven

<dependency>
    <groupId>ca.solo-studios</groupId>
    <artifactId>kt-fuzzy</artifactId>
    <version>VERSION</version>
</dependency>

Gradle Groovy

implementation 'ca.solo-studios:kt-fuzzy:VERSION'

Gradle Kotlin

implementation("ca.solo-studios:kt-fuzzy:VERSION")