C# Класс StopGuessing.DataStructures.EditDistance

A static class for calculating the edit distance between two strings, factoring in not just the standard additions, deletions, and subtstitutions, but also case changes ('a'->'A') and transpositions ('typo'->'tpyo'). The caller may set the cost of each type of edit and the calculator will compute the least-cost edit from the source string to the destination string.
Показать файл Открыть проект

Открытые методы

Метод Описание
Calculate ( char xstr, char ystr, Costs costs = null ) : float
Calculate ( string sourceString, string destinationString, Costs costs = null ) : float

Calculate the cost to edit a source string into a destination string, where the set of possible operations (add char, delete char, substitute one char for another, transpose adjacent characters, or change the case of a character) can be set by the caller.

Описание методов

Calculate() публичный статический Метод

public static Calculate ( char xstr, char ystr, Costs costs = null ) : float
xstr char
ystr char
costs Costs
Результат float

Calculate() публичный статический Метод

Calculate the cost to edit a source string into a destination string, where the set of possible operations (add char, delete char, substitute one char for another, transpose adjacent characters, or change the case of a character) can be set by the caller.
public static Calculate ( string sourceString, string destinationString, Costs costs = null ) : float
sourceString string The string to be changed (edited).
destinationString string The string that the source string should be turned into through edits.
costs Costs The cost of each of the types of changes that can be made.
Результат float