Coder Social home page Coder Social logo

fuzzystringmatching's Introduction

Fuzzy String Matching Algorithm

Levenshtein Distance

Approximate distance between two strings is calculated using number of edits required (insertions, deletions,and substitutions) to change one string into another.

Trigram Distance

String similarity is determined by splitting each string into trigrams, a series of three characters, and then assessing number of matching versus unique trigrams between the two strings. In order to offset the heavy penalty for strings not starting or ending with the same trigram, a trigram is created for both strings containing a padding character and the first two characters as well as the last two characters and a padding character. This algorithm is more suited for longer character strings.

Jaro Distance

String similarity is determined by using a formula derived by Matthew Jaro; it considers the number of matches, length of strings, and number of single transpositions that would turn one string into the other.

Jaro-Winkler Distance

This similarity calculation is a varient of the Jaro Distance created by William Winkler. It incorporates the length of similar characters in the prefix (up to 4) to more heavily factor similarity between strings with common prefixes.

Cosine Similarity

This algorithm is best suited for data with multiple words in each string input. The frequency for each word is calculated per input vector and stored in an array. The dot product is then calculated using these arrays which is then divided into the Euclidean norm of each input vector multiplied together. This cosine value represents at what angle the two input vectors relate to each other, the smaller the angle, the closer to a value of 1, indicating a close relationship between the two input vectors.

fuzzystringmatching's People

Contributors

jdemieville avatar

Stargazers

 avatar

Watchers

James Cloos 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.