Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditDistance ¶
EditDistance calculates edit distance (**ed**) according to Levenshtein algorithm. It also runs additional checks and if they fail, returns -1.
Checks: - result should not exceed maxEditDistance - number of characters divided by ed should be bigger than charsPerED
It assumes that checks have to be applied only to the second string:
EditDistance("Pomatomus", "Pom atomus")
returns -1
EditDistance("Pom atomus", "Pomatomus")
returns 1
It also assumes that number of spaces between words was already normalized to 1 space, and that s1 and s2 always have the same number of words.
Types ¶
Click to show internal directories.
Click to hide internal directories.