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

damerau-levenshtein

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

damerau-levenshtein

Damerau - Levenshtein distance by The Spanish Inquisition + relative distance

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6M
decreased by-57.69%
Maintainers
1
Weekly downloads
 
Created

What is damerau-levenshtein?

The damerau-levenshtein npm package is used to calculate the Damerau-Levenshtein distance between two strings. This distance is a measure of similarity between two strings, considering the number of operations (insertions, deletions, substitutions, and transpositions) needed to transform one string into another. It is particularly useful in applications like spell checking, typo correction, and other forms of text analysis where slight variations in string input need to be quantified.

What are damerau-levenshtein's main functionalities?

Calculate Distance and Steps

This feature allows users to calculate the Damerau-Levenshtein distance between two strings and also provides detailed steps of the operations needed to transform the source string into the target string. This is useful for understanding the specific changes needed.

const damerau = require('damerau-levenshtein');
const result = damerau('hello', 'hallo');
console.log(result.distance); // Output: 2
console.log(result.steps); // Output: [ { operation: 'substitute', srcPos: 1, destPos: 1 }, { operation: 'substitute', srcPos: 4, destPos: 4 } ]

Other packages similar to damerau-levenshtein

Keywords

FAQs

Package last updated on 27 Jan 2020

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