metric-lcs

Zero dependency Metric Longest Common Subsequence implementation in js

MIT 7 个版本
安装
npm install metric-lcs
yarn add metric-lcs
pnpm add metric-lcs
bun add metric-lcs
README

Build Status

metric-lcs

Zero dependency Metric Longest Common Subsequence implementation in js.

Usage

npm i metric-lcs

import metriclcs from "metric-lcs";
console.log(metriclcs("ABDEF", "ABDIF")); //.8

or

const metriclcs = require("metric-lcs");
console.log(metriclcs("ABDEF", "ABDIF")); //.8

Use case

Longest Common Subsequence is used with diff, so the metric version of it is suitable for comparing larger strings or for comparing likely subsets of strings since it ignores edit distance and lowers the cost of insertion.

Thanks

Special thanks to tdebatty for java-string-similarity, which I used as a reference implementation.

版本列表
1.0.3 2024-12-09
1.0.2-rc 2024-12-09
1.0.1-rc 2024-12-09
1.0.0 2024-12-09
0.1.2 2017-11-09
0.1.1 2017-11-09
0.1.0 2017-11-09