trait StringEditDistance extends DiffShortener
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]")
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- StringEditDistance
- DiffShortener
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
-
case class
StringDelimiter
(separator: String) extends Product with Serializable
Create separator characters
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def editDistance(s1: String, s2: String): Int
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
foldSplittedStrings[T](s1: String, s2: String, init: T, f: (T, String, String) ⇒ T): T
apply edit distance functions on strings splitted on newlines so that there are no memory issues
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
shorten(s: String, firstSep: String = "[", secondSep: String = "]", size: Int = 5): String
- Definition Classes
- DiffShortener
- def showDiffs(operations: IndexedSeq[data.EditDistance.EditDistanceOperation[Char]], sep: String, shortenSize: Int): String
-
def
showDistance(s1: String, s2: String, sep: String = "[]", shortenSize: Int = 20): (String, String)
- sep
separators used to hightlight differences. If sep is empty, then no separator is used. If sep contains one character, it is taken as the unique separator. If sep contains 2 or more characters, the first half of the characters are taken as opening separator and the second half as closing separator.
- 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.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )