Coder Social home page Coder Social logo

alwaysbeyourself / levenshteinautomaton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from klawson88/levenshteinautomaton

0.0 2.0 0.0 1.49 MB

A fast and comprehensive Java library capable of performing automaton and non-automaton based Levenshtein distance determination and neighbor calculations.

License: Apache License 2.0

Java 100.00%

levenshteinautomaton's Introduction

##About

LevenshteinAutomaton is a fast and comprehensive Java library capable of performing automaton and non-automaton based Damerau-Levenshtein distance determination and neighbor calculations. The collection of related utilities affords developers the luxury of choosing the most appropriate edit distance-related procedure for their needs at any given time.

The library is capable of the following:

  • Edit-distance determination (via dynamic programming)
  • Edit-distance neighbor determination (via dynamic programming)
  • Edit-distance neighbor dictionary search (via table, dynamic programming, or automaton traversal)

The code well structured, easy to follow, and extensively commented for the benefit of developers seeking to understand the implemented data structures and algorithms, as well as developers seeking to add homogeneous, functionality-extending code with ease.

The code has also been fully tested for correct functionality and performance.

##How to use

//Determine the edit distance between two words
int editDistance = LevenshteinAutomaton.computeEditDistance("tree", "trees"); //1

//Determine if two strings are within a given edit distance of each other
boolean areLDNeighbors = LevenshteinAutomaton.areWithinEditDistanceNonAutomaton(1, "tree", "trees"); //true

//Create dictionary-containing data structures
ArrayList<String> myArrayList = new ArrayList(Arrays.asList(new String[]{"bush", "bushes", "tree", "trees"}));
MDAG myMDAG = new MDAG(myArrayList);
/////

//Detemine via table all of the Strings in the our dictionary that are within a edit distance 2 from "tree"  (ideal use cases: edit distances <= 2)
LinkedList<String> ldNeighborsLinkedList = LevenshteinAutomaton.tableFuzzySearch(2, "tree", myMDAG); //"tree", "trees"

//Detemine via dynamic programming all of the Strings in the our dictionary that are within a edit distance  2 from "tree" (ideal use cases: low memory capacity, edit distances >= 2)
LinkedList<String> ldNeighborsLinkedList = LevenshteinAutomaton.fuzzySearchNonAutomaton(2, "tree", myArrayList); //"tree", "trees"

//Detemine via automaton traversal all of the Strings in the our dictionary that are within a edit distance  2 from "tree"
LinkedList<String> ldNeighborsLinkedList = LevenshteinAutomaton.iterativeFuzzySearch(2, "tree", myMDAG); //"tree", "trees"

##Repo contents

  • src: Contains the source code for unit & integration tests as well as modified LevensheinAutomaton code with exclusive debugging methods and permissive access modifiers on existing methods to facilitate testing
  • dist: Contains the test suite, test library, and MDAG jars
  • final: Contains src and dist folders housing production-ready LevenshteinAutomaton source and jar files respectively (as well as necessary MDAG jar file)

##Licensing and usage information

LevenshteinAutomaton is licensed under the Apache License, Version 2.0.

Informally, It'd be great to be notified of any derivatives or forks (or even better, issues or refactoring points that may inspire one)!

More informally, it'd really be great to be notified any uses in open-source, educational, or (if granted a license) commercial contexts. Help me build my portfolio, if you found the library helpful it only takes an e-mail!

##References

levenshteinautomaton's People

Contributors

klawson88 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.