The EditDistance trait provides methods to compute and display the shortest distance between 2 strings.
Usage:
showDistance("kitten", "sitting") // returns ("(k)itt(e)n", "(s)itt(i)n(g)") // with different separators showDistance("kitten", "sitting", "[]") // returns ("[k]itt[e]n", "[s]itt[i]n[g]")
Attributes
- Companion
- object
- Graph
-
- Supertypes
- Known subtypes
-
object StringEditDistance
Members list
Type members
Classlikes
Create delimiter characters
Create delimiter characters
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Inherited classlikes
Attributes
- Inherited from:
- DiffShortener
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Tokenclass Objecttrait Matchableclass AnyShow all
Attributes
- Inherited from:
- DiffShortener
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Tokenclass Objecttrait Matchableclass AnyShow all
Attributes
- Inherited from:
- DiffShortener
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Tokenclass Objecttrait Matchableclass AnyShow all
Attributes
- Inherited from:
- DiffShortener
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Tokenclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
apply edit distance functions on strings split on newlines so that there are no memory issues
apply edit distance functions on strings split on newlines so that there are no memory issues
Attributes
Value parameters
- separators
-
separators used to highlight differences. If sep is empty, then no delimiter is used. If sep contains one character, it is taken as the unique delimiter. If sep contains 2 or more characters, the first half of the characters are taken as opening delimiter and the second half as closing delimiter.
Attributes
- Returns
-
a (String, String) displaying the differences between each input strings. The used separators are specified by the caller. The string is shortened before and after differences if necessary.
Inherited methods
Attributes
- Inherited from:
- DiffShortener
Attributes
- Inherited from:
- DiffShortener
Attributes
- Inherited from:
- DiffShortener
Attributes
- Inherited from:
- DiffShortener
Extensions
Inherited extensions
Attributes
- Inherited from:
- DiffShortener