lib/diff.rb

# Diff

`Diff.new(seq_a, seq_b)`
`Diff#ses([algorithm=:speculative])`
`Diff#lcs([algorithm=:speculative])`

  Available algorithms are follows.

  - :shortestpath
  - :contours
  - :speculative

# Diff::EditScript

`Diff::EditScript.new`
`Diff::EditScript#del(seq_or_len_a)`
`Diff::EditScript#add(seq_or_len_b)`
`Diff::EditScript#common(seq_or_len_a[, seq_or_len_b])`
`Diff::EditScript#commonsubsequence`
`Diff::EditScript#count_a`
`Diff::EditScript#count_b`
`Diff::EditScript#additions`
`Diff::EditScript#deletions`
`Diff::EditScript#each {|mark, a, b| ...}`
`Diff::EditScript#apply(arr)`
`Diff::EditScript.parse_rcsdiff(input)`
`Diff::EditScript#rcsdiff([out=''])`

# Diff::Subsequence

`Diff::Subsequence.new`
`Diff::Subsequence.add(i, j[, len=1])`
`Diff::Subsequence#length`
`Diff::Subsequence#each {|i, j, len| ...}`

Data class reduces input for diff and convert alphabet to Integer.

It reduces input by removing common prefix, suffix and unique elements.

So, reduced input has following properties:

- First element is different.
- Last element is different.
- Any elemnt in A is also exist in B.
- Any elemnt in B is also exist in A.