JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q47562F
  • License ISC

Compare two strings and return the Jaro-Winkler similarity score.

Package Exports

  • dromo-similarity-score
  • dromo-similarity-score/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dromo-similarity-score) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Similarity Score

Overview

This TypeScript implementation provides a function to compare the similarity between two strings using the Jaro-Winkler distance algorithm. The Jaro-Winkler distance is a measure of edit distance between two sequences, particularly well-suited for short strings such as person names.

Features

  • Calculates similarity score between two strings
  • Returns a value between 0 (completely different) and 1 (identical)
  • Gives more weight to strings that match from the beginning
  • Handles strings of different lengths and empty strings

Installation

npm i dromo-similarity-score

Usage

import similarityScore from "dromo-similarity-score";

const similarity = compareSimilarity("hello", "hallo");
console.log(similarity); // Outputs a number between 0 and 1