Socket
Book a DemoInstallSign in
Socket

sorted-edit-distance

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sorted-edit-distance

Sort strings based on spaces in string and then run edit distance to decrease false negatives.

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

sorted-edit-distance

This tool can be used to improve edit-distance checks for strings by sorting the strings and then running the edit-distance algorithm.

eg.

Previous String A = dark apple eat
Previous String B = eat dark apple

# Now these strings will be sorted first :

New String A = apple dark eat
New String B = apple dark eat

Usage

const { sortedEditDistance, editDistance } = require('sorted-edit-distance');

const A = 'dark apple eat';
const B = 'eat dark apple';

const editDistance1 = sortedEditDistance(A, B);
const editDistance2 = editDistance(A, B);

Keywords

edit-distace

FAQs

Package last updated on 08 Sep 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