Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wink-jaro-distance

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wink-jaro-distance

An Implementation of Jaro Distance Algorithm by Matthew A. Jaro

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

wink-jaro-distance

An Implementation of Jaro Distance Algorithm by Matthew A. Jaro

Build Status Coverage Status Inline docs devDependencies Status Gitter

De-duplicate short strings such as names by computing similarity and distance between a pair of strings using wink-jaro-distance. It is an implementation of Jaro Distance Algorithm that determines the similarity/distance by taking into account the insertions, deletions and transpositions.

Installation

Use npm to install:

npm install wink-jaro-distance --save

Getting Started

// Load Jaro Distance Function
var jaro = require( 'wink-jaro-distance' );

console.log( jaro( 'father', 'farther') );
// -> { distance: 0.04761904761904756, similarity: 0.9523809523809524 }

console.log( jaro( 'Angelina', 'Angelica') );
// -> { distance: 0.08333333333333337,  similarity: 0.9166666666666666 }

console.log( jaro( 'Flikr', 'Flicker' ) );
// -> { distance: 0.09523809523809523, similarity: 0.9047619047619048 }

console.log( jaro( 'abcdef', 'fedcba'  ) );
// -> { distance: 0.6111111111111112, similarity: 0.38888888888888884 }

Try experimenting with this example on Runkit in the browser.

API

Table of Contents
jaro

Computes Jaro distance and similarity between strings s1 and s2.

Original Reference: UNIMATCH: A Record Linkage System: Users Manual pp 104.

Parameters
  • s1 string — the first string.
  • s2 string — the second string.
Examples
jaro( 'daniel', 'danielle' );
// -> { distance: 0.08333333333333337, similarity: 0.9166666666666666 }
jaro( 'god', 'father' );
// -> { distance: 1, similarity: 0 }

Returns object containing distance and similarity values between 0 and 1.

jaro

Computes Jaro distance and similarity between strings s1 and s2.

Original Reference: UNIMATCH: A Record Linkage System: Users Manual pp 104.

Parameters

  • s1 string — the first string.
  • s2 string — the second string.

Examples

jaro( 'daniel', 'danielle' );
// -> { distance: 0.08333333333333337, similarity: 0.9166666666666666 }
jaro( 'god', 'father' );
// -> { distance: 1, similarity: 0 }

Returns object containing distance and similarity values between 0 and 1.

Need Help?

If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a pull request.

About wink

Wink is a family of open source packages for Statistical Analysis, Natural Language Processing and Machine Learning in NodeJS. The code is thoroughly documented for easy human comprehension and has a test coverage of ~100% for reliability to build production grade solutions.

wink-jaro-distance is copyright 2017-18 GRAYPE Systems Private Limited.

It is licensed under the terms of the MIT License.

Keywords

FAQs

Package last updated on 03 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc