C# Class Spontaneuos.Lib.SiftStringSimilarity.StringMetrics

Helper class for Sift3, Levenstein and length distance and similarities
Mostra file Open project: pashkov/Spontaneous

Public Methods

Method Description
FastDistance ( string s1, string s2, int maxDistance ) : float

Fast compute the distance between two strings based on several levels of accuracy First length, then Sift, then Levenstein

FastSimilarity ( string s1, string s2, float minSimilarity ) : float

Fast compute the similarity between two strings based on several levels of accuracy First length, then Sift, then Levenstein

LengthDistance ( string s1, string s2 ) : int

Calculate the distance between two strings by length alone

LengthSimilarity ( string string1, string string2 ) : float

Calculate the similarity between two strings by length alone

LevensteinDistance ( string s, string t ) : int

Calculate the Levenstein string distance

LevensteinSimilarity ( string string1, string string2 ) : float

Calculate the percentage of Levenstein similarity between two strings

SiftDistance ( string s1, string s2 ) : float

Calculate the Sift3 distance between 2 strings

SiftSimilarity ( string s1, string s2 ) : float

Calculate the Sift3 similarity between 2 strings

Method Details

FastDistance() public static method

Fast compute the distance between two strings based on several levels of accuracy First length, then Sift, then Levenstein
public static FastDistance ( string s1, string s2, int maxDistance ) : float
s1 string
s2 string
maxDistance int
return float

FastSimilarity() public static method

Fast compute the similarity between two strings based on several levels of accuracy First length, then Sift, then Levenstein
public static FastSimilarity ( string s1, string s2, float minSimilarity ) : float
s1 string
s2 string
minSimilarity float
return float

LengthDistance() public static method

Calculate the distance between two strings by length alone
public static LengthDistance ( string s1, string s2 ) : int
s1 string
s2 string
return int

LengthSimilarity() public static method

Calculate the similarity between two strings by length alone
public static LengthSimilarity ( string string1, string string2 ) : float
string1 string
string2 string
return float

LevensteinDistance() public static method

Calculate the Levenstein string distance
public static LevensteinDistance ( string s, string t ) : int
s string first string
t string second string
return int

LevensteinSimilarity() public static method

Calculate the percentage of Levenstein similarity between two strings
public static LevensteinSimilarity ( string string1, string string2 ) : float
string1 string first string
string2 string second string
return float

SiftDistance() public static method

Calculate the Sift3 distance between 2 strings
public static SiftDistance ( string s1, string s2 ) : float
s1 string
s2 string
return float

SiftSimilarity() public static method

Calculate the Sift3 similarity between 2 strings
public static SiftSimilarity ( string s1, string s2 ) : float
s1 string
s2 string
return float