Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
wink-jaro-distance
Advanced tools
An Implementation of Jaro Distance Algorithm by Matthew A. Jaro
Weekly downloads
Readme
An Implementation of Jaro Distance Algorithm by Matthew A. Jaro
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.
Use npm to install:
npm install wink-jaro-distance --save
// 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.
Computes Jaro distance and similarity between strings s1
and s2
.
Original Reference: UNIMATCH: A Record Linkage System: Users Manual pp 104.
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.
Computes Jaro distance and similarity between strings s1
and s2
.
Original Reference: UNIMATCH: A Record Linkage System: Users Manual pp 104.
Parameters
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.
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.
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.
FAQs
An Implementation of Jaro Distance Algorithm by Matthew A. Jaro
The npm package wink-jaro-distance receives a total of 3,407 weekly downloads. As such, wink-jaro-distance popularity was classified as popular.
We found that wink-jaro-distance demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.