Installations
npm install @alordash/damerau-levenshtein
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
13.12.0
NPM Version
6.14.4
Score
69.5
Supply Chain
87.7
Quality
75.5
Maintenance
100
Vulnerability
99.6
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
3,254
Last Day
2
Last Week
2
Last Month
36
Last Year
309
GitHub Statistics
42 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
1.75 kB
Minified
720.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.0.8
Package Id
@alordash/damerau-levenshtein@1.0.8
Unpacked Size
8.34 kB
Size
2.73 kB
File Count
5
NPM Version
6.14.4
Node Version
13.12.0
Total Downloads
Cumulative downloads
Total Downloads
3,254
Last day
0%
2
Compared to previous day
Last week
-84.6%
2
Compared to previous week
Last month
56.5%
36
Compared to previous month
Last year
-54.6%
309
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
@alordash/damerau-levenshtein
$ npm i @alordash/damerau-levenshtein
Levenshtein algorithm
My realization of Damerau-Levenshtein distance algorithm.
Usage
1const { distance, closest } = require('@alordash/damerau-levenshtein') 2 3// Print Damerau-Levenshtein distance between "better" and "bteetr" 4console.log(distance("better", "bteetr")); 5//=> 2 6 7// Select the most similar string to "park" from string list. 8let value = closest("park", ["luck", "duck", "apkr"]); 9 10// Result: 11console.log(value.closest_string); 12//=> "apkr" 13 14console.log(value.distance); 15//=> 2
Features
You can also create calculation object using DamerauLevenshtein class:
1const { DamerauLevenshtein } = require("@alordash/levenshtein"); 2 3// Calculate Damerau-Levenshtein distance between "entity" and "idenitty" 4let object = new DamerauLevenshtein("entity", "idenitty"); 5 6// Print Damerau-Levenshtein distance between "entity" and "idenitty" 7console.log(object.valueOf(), object.distance); 8//=> 3 3 9 10// Change strings in object to "first" and "wrist" and calculate Damerau-Levenshtein distance between them 11object.strings = ["first", "wrist"]; 12 13// Print Damerau-Levenshtein distance between "first" and "wrist" 14console.log(object.distance); 15//=> 2 16 17// Print calculation matrix 18console.log(object.toString()); 19//=> 20// | | w | r | i | s | t 21//—————+–––+–––+–––+–––+–––+––– 22// | 0 | 1 | 2 | 3 | 4 | 5 23//—————+–––+–––+–––+–––+–––+––– 24// f | 1 | 1 | 2 | 3 | 4 | 5 25//—————+–––+–––+–––+–––+–––+––– 26// i | 2 | 2 | 2 | 2 | 3 | 4 27//—————+–––+–––+–––+–––+–––+––– 28// r | 3 | 3 | 2 | 2 | 3 | 4 29//—————+–––+–––+–––+–––+–––+––– 30// s | 4 | 4 | 3 | 3 | 2 | 3 31//—————+–––+–––+–––+–––+–––+––– 32// t | 5 | 5 | 4 | 4 | 3 | 2 33//—————+–––+–––+–––+–––+–––+–––
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More