Object

equate

Algorithms

Related Doc: package equate

Permalink

object Algorithms

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Algorithms
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  6. def commonSubstringIndicesToDiff(a: String, b: String, initialCommonSubstringIndices: List[(Int, Int, Int)]): Seq[Diff[Char]]

    Permalink

    Convert a list of common substring indices into a diff.

    Convert a list of common substring indices into a diff.

    returns

    a diff of a and b based on initialCommonSubstringIndices. If initialCommonSubstringIndices contains no empty runs, the result will not contain an Insert(_) followed by a Delete(_), i.e. in difference regions it puts characters from a before those from b. If initialCommonSubstringIndices does not correspond to a common subsequence of a and b, hilarity may ensue.

  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def findMiddle(a: String, b: String, zero: Int, vForward: Array[Int], vReverse: Array[Int], i: Int, n: Int, j: Int, m: Int): (Int, (Int, Int, Int))

    Permalink

    Find a (dist, (xlo, xhi, ylo)) such that dist is the LCS edit distance between a.substring(i, n) and b.substring(j, m), and such that a(i) == b(i - xlo + ylo) for all i in (xlo until xhi).

    Find a (dist, (xlo, xhi, ylo)) such that dist is the LCS edit distance between a.substring(i, n) and b.substring(j, m), and such that a(i) == b(i - xlo + ylo) for all i in (xlo until xhi).

    If 0 <= i <= n <= a.size and 0 <= j <= m <= b.size don't both hold, hilarity may ensue.

    a

    the observed/old sequence

    b

    the expected/new sequence

    zero

    an index into vForward and vReverse such that ((zero - (a.size + b.size)) to (zero + (a.size + b.size))) is a range of valid (in-bounds) indices into vForward and vReverse

    vForward

    an array, some entries of which will be overwritten

    vReverse

    an array, some entries of which will be overwritten

    i

    the start (inclusive) of the substring of a to search in

    n

    the end (exclusive) of the substring of a to search in

    j

    the start (inclusive) of the substring of b to search in

    m

    the end (exclusive) of the substring of b to search in

    returns

    see description

  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def lcsSubstringIndices(a: String, b: String): List[(Int, Int, Int)]

    Permalink

    returns

    a list of substring indices (xlo, xhi, ylo) which together make up a (the) longest common subsequence between a and b. The substring index triples are such that

    lcsRuns(a, b).forall {
        case (xlo, xhi, ylo) =>
            (xlo until xhi).forall(i => a(i) == b(i - xlo + ylo))
    }

    furthermore lcsRuns(a, b).flatMap(t => Seq(t._1, t._2)) is sorted, and so is lcsRuns(a, b).map(_._3)

  14. def longestCommonSubsequenceEdits(a: String, b: String): Seq[Diff[Char]]

    Permalink

    See "An O(ND) Difference Algorithm and Its Variations" by Eugene W.

    See "An O(ND) Difference Algorithm and Its Variations" by Eugene W. Myers at http://xmailserver.org/diff2.pdf; this implements the linear space recursive bidirectional search.

    returns

    a char-by-char diff describing how to turn a into b. Specifically,

    a == longestCommonSubsequenceEdits(a, b).collect {
        case Common(c) => c
        case Delete(c) => c
    }.mkString

    and

    b == longestCommonSubsequenceEdits(a, b).collect {
        case Common(c) => c
        case Insert(c) => c
    }.mkString

    and

    // this is the longest common subsequence of a and b:
    longestCommonSubsequenceEdits(a, b).collect { case Common(c) => c }
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  18. def recurseAroundTheMiddle(a: String, b: String, zero: Int, vForward: Array[Int], vReverse: Array[Int], i: Int, n: Int, j: Int, m: Int, commonSubstringIndices: List[(Int, Int, Int)] = Nil): List[(Int, Int, Int)]

    Permalink

    Use findMiddle to find a common substring with (approximately) half the differences before it and half the differences after it, such that the common substring is part of the longest common subsequence.

    Use findMiddle to find a common substring with (approximately) half the differences before it and half the differences after it, such that the common substring is part of the longest common subsequence. This substring may be empty. Then recursively solve the two subproblems on each side of the substring.

    The parameters are the same as findMiddle with one exception.

    commonSubstringIndices

    return value accumulator, initially Nil

    returns

    a list of common substring indices making up the longest common subsequence.

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped