@nlptools/comparison
v0.0.1
Published
Programmatically create text comparisons, powered by Demo Macro.
Downloads
52
Maintainers
Readme
@nlptools/comparison
Programmatically create text comparisons, powered by Demo Macro.
Getting started
# npm
$ npm install @nlptools/comparison
# yarn
$ yarn add @nlptools/comparison
# pnpm
$ pnpm add @nlptools/comparison
Usage
// diff
import { createDiffComparison } from "@nlptools/comparison";
const diff = createDiffComparison("Hello, world!", "Hello, world?", {
// options
ignoreCase: false,
lang: "en",
segmentation: "chars",
});
// similarity
import { createSimilarityComparison } from "@nlptools/comparison";
const similarity = createSimilarityComparison(
"Hello, world!",
"Hello, world?",
{
// options
lang: "en",
threshold: 10,
},
);