Skip to content

Java implementation of some in-memory fuzzy search algorithms

License

Notifications You must be signed in to change notification settings

eugenelesnov/fuzzy-search

Repository files navigation

Codacy Badge Build Status Conventional Commits

FuzzySearch

Java implementation of some fuzzy search algorithms.

How to use

  1. Add to your build.gradle:
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}
  1. Add dependency:
dependencies {
    implementation 'com.github.EugeneLesnov:fuzzy-search:{version}'
}

Some examples

  1. NgramSearch
int power = 3;
String token = "query";
Collection<String> source = getSomeStringCollection();

Map<String, Float> matched = ngramSearch(power, token, source, String::toString);
matched.forEach((k, v) -> System.out.println("Token: " + k + "; Percentage: " + v));
  1. LevenshteinSearch
int precision = 4;
String token = "query";
Collection<String> source = getStringCollection();

Map<String, Integer> matched = levenshteinSearch(precision, token, source, String::toString);
matched.forEach((k, v) -> System.out.println("Token: " + k + "; Levenshtein distance: " + v));

About

Java implementation of some in-memory fuzzy search algorithms

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages