damerau-levenshtein

WebJar for damerau-levenshtein

License

License

BSD 2-Clause
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

damerau-levenshtein
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

damerau-levenshtein
WebJar for damerau-levenshtein
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/lzrski/node-damerau-levenshtein

Download damerau-levenshtein

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/damerau-levenshtein/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>damerau-levenshtein</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/damerau-levenshtein/
implementation 'org.webjars.npm:damerau-levenshtein:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/damerau-levenshtein/
implementation ("org.webjars.npm:damerau-levenshtein:1.0.4")
'org.webjars.npm:damerau-levenshtein:jar:1.0.4'
<dependency org="org.webjars.npm" name="damerau-levenshtein" rev="1.0.4">
  <artifact name="damerau-levenshtein" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='damerau-levenshtein', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "damerau-levenshtein" % "1.0.4"
[org.webjars.npm/damerau-levenshtein "1.0.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

NPM

It provides a function that takes two string arguments and returns a hash like this:

{
  steps: 5,       // Levenstein demerau distance
  relative: 0.7,  // steps / length of the longer string
  similarity: 0.3 // 1 - relative
}

Install

npm install damerau-levenshtein

Use with ES6 modules

import * as levenshtien from 'damerau-levenshtein';

const lev = levenshtien('hello world', 'Hello World!');
// { steps: 4, relative: 0.3076923076923077, similarity: 0.6923076923076923 }

Please see tests for more insights.

Use with TypeScript

import * as levenshtien from 'damerau-levenshtein';

interface LevenshteinResponse {
  steps: number;
  relative: number;
  similarity: number;
}

const lev: LevenshteinResponse = levenshtien('hello world', 'Hello World!');

console.log(lev.steps);
// 2
console.log(lev.foo);
// TypeScript Error: Property 'foo' does not exist on type 'LevenshteinResponse'.
org.webjars.npm

Developer formerly known as lzrski

Looking for lzrski? I'm tad-lispy now. Sorry if I inconvenienced you.

Versions

Version
1.0.4