org.specs.util.EditDistance

object EditDistance

object EditDistance

 extends EditDistance


The EditDistance object 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]")
 


Companion: EditDistance

Source: EditDistance.scala(13)

 Constructors

def this

 Methods

!= final def !=(arg0 : Any) Boolean Any
!= final def !=(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Any) Boolean Any
asInstanceOf final def asInstanceOf[T0] T0 Any
clone protected def clone Object AnyRef
editDistance def editDistance(s1 : String, s2 : String)
[details]
return
- the edit distance between 2 strings = the minimum number of insertions/suppressions/substitutions to pass from one string to the other
Int EditDistance
eq final def eq(arg0 : Object) Boolean AnyRef
equals def equals(arg0 : Any) Boolean AnyRef
finalize protected def finalize Unit AnyRef
getClass final def getClass Class[Object] AnyRef
hashCode def hashCode Int AnyRef
isInstanceOf final def isInstanceOf[T0] Boolean Any
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
showDistance def showDistance(s1 : String, s2 : String, sep : String)
[details]
param
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.
return
- a (String, String) displaying the differences between each input strings. The used separators are specified by the caller.

(String, String) EditDistance
showDistance def showDistance(s1 : String, s2 : String)
[details]
return
- a (String, String) displaying the differences between each input strings. The used separators are parenthesis: '(' and ')'
(String, String) EditDistance
showMatrix def showMatrix(s1 : String, s2 : String)
prints on the console the edit matrix for 2 strings
EditMatrix EditDistance
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
toString def toString String AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
Copyright (c) 2007-2009. All Rights Reserved.