Giter Club home page Giter Club logo

jaro-similarity's Introduction

Jaro-Similarity:

LuaU Jaro Similarity Implementation from the following sources:

Jaro similarity is the measure of similarity between two strings, represented by a range from 0 to 1. Where 1 means the strings are equal and 0 - no similarities

The Jaro-Winkler similarity is a string metric measuring edit distance between two strings. Jaro – Winkler Similarity is much similar to Jaro Similarity. They both differ when the prefix of two strings match. Jaro – Winkler Similarity uses a prefix scale ‘p’ which gives a more accurate answer when the strings have a common prefix up to a defined maximum length l

Overview of methods:

Default input configuration:
inputConfig = {
    caseSensitive: boolean? = false,
    scalingFactor: number? = 0.1,
    prefixLength: number?  = 4
}
Calculate Jaro similarity:
.JaroSimilarity(string1: string, string2: string, inputConfig: inputConfig?)
Calculate Jaro distance: (inverse of Jaro similarity)
.JaroDistance(string1: string, string2: string, inputConfig: inputConfig?)
Calculate Jaro Winkler:
.JaroWinkler(string1: string, string2: string, inputConfig: inputConfig?)

Example usage:

local JaroUtil = require(game.ServerScriptService.JaroUtil)

print(JaroUtil.JaroSimilarity("Hello", "hello", {
    caseSensitive = true,
}))

print(JaroUtil.JaroSimilarity("Hello", "Hello")) 

print(JaroUtil.JaroDistance("Hello", "Bello"))

--//Output 1: 0.8666..
--//Output 2: 1
--//Output 3: 0.1333.. 

jaro-similarity's People

Contributors

khanpython avatar

Stargazers

 avatar  avatar

Watchers

 avatar

jaro-similarity's Issues

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.