\href{https://nodei.co/npm/damerau-levenshtein/}{\texttt{ }}

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


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

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7789}{}\doxysubsection{Install}\label{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7789}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install damerau-\/levenshtein }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7790}{}\doxysubsection{Use with ES6 modules}\label{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7790}

\begin{DoxyCode}{0}
\DoxyCodeLine{import * as levenshtien from 'damerau-\/levenshtein';}
\DoxyCodeLine{}
\DoxyCodeLine{const lev = levenshtien('hello world', 'Hello World!');}
\DoxyCodeLine{// \{ steps: 4, relative: 0.3076923076923077, similarity: 0.6923076923076923 \} }

\end{DoxyCode}


Please see \href{./test/test.js}{\texttt{ tests}} for more insights.\hypertarget{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7791}{}\doxysubsection{Use with Type\+Script}\label{md_sfcode_node_modules_damerau_levenshtein_README_autotoc_md7791}

\begin{DoxyCode}{0}
\DoxyCodeLine{import * as levenshtien from 'damerau-\/levenshtein';}
\DoxyCodeLine{}
\DoxyCodeLine{interface LevenshteinResponse \{}
\DoxyCodeLine{  steps: number;}
\DoxyCodeLine{  relative: number;}
\DoxyCodeLine{  similarity: number;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{const lev: LevenshteinResponse = levenshtien('hello world', 'Hello World!');}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(lev.steps);}
\DoxyCodeLine{// 2}
\DoxyCodeLine{console.log(lev.foo);}
\DoxyCodeLine{// TypeScript Error: Property 'foo' does not exist on type 'LevenshteinResponse'. }

\end{DoxyCode}
 