Skip to content

Files

Latest commit

 

History

History
46 lines (29 loc) · 1.67 KB

Assorted.Utils.Text.StringExtensions.DamerauLevenshteinSimilarityTo.md

File metadata and controls

46 lines (29 loc) · 1.67 KB

StringExtensions.DamerauLevenshteinSimilarityTo(this string, string) Method

Namespace: Assorted.Utils.Text
Assembly: Assorted.Utils (Assorted.Utils.dll) version 1.1.0.0

Returns the normalized Damerau-Levenshtein distance between two strings.

Syntax

public static double DamerauLevenshteinSimilarityTo(this string source, string other)

Parameters

source: string
The source string.

other: string
The other string.

Return Value

double
A value between 0 and 1 such that 0 equates to no similarity and 1 is an exact match.

Exceptions

Exception Description
System.ArgumentNullException source or other is null.

Remarks

The Damerau-Levenshtein distance is defined as the minimum number of primitive edit operations needed to transform one text into the other and these operations are substitution, deletion, insertion and the transposition of two adjacent characters.

See Also


This document is generated by DG.