C# Class Spontaneuos.Lib.SiftStringSimilarity.StringSift3

Computes the distance and similarity between two strings a lot faster than Levenshtein
Exibir arquivo Open project: pashkov/Spontaneous Class Usage Examples

Public Methods

Method Description
Distance ( string s1, string s2 ) : float

Calculate a distance similar to Levenstein, but faster and less reliable.

Similarity ( string s1, string s2 ) : float

Calculate the similarity of two strings, as a percentage.

StringSift3 ( ) : System

Instantiate the class with a default value of MaxOffset=5

StringSift3 ( int maxOffset ) : System

MaxOffset represents the maximum range the algorithm searches for the same character It is cheaper to replace a character rather than move it from a distance larger than MaxOffset.

Method Details

Distance() public method

Calculate a distance similar to Levenstein, but faster and less reliable.
public Distance ( string s1, string s2 ) : float
s1 string
s2 string
return float

Similarity() public method

Calculate the similarity of two strings, as a percentage.
public Similarity ( string s1, string s2 ) : float
s1 string
s2 string
return float

StringSift3() public method

Instantiate the class with a default value of MaxOffset=5
public StringSift3 ( ) : System
return System

StringSift3() public method

MaxOffset represents the maximum range the algorithm searches for the same character It is cheaper to replace a character rather than move it from a distance larger than MaxOffset.
public StringSift3 ( int maxOffset ) : System
maxOffset int
return System