the ratio method returns a measure of the sequences' similarity as a float in the range [0, 1]. Where T is the total number of elements in both sequences, and M is the number of matches, this
is 2.0*M / T. Note that this is 1.0 if the sequences are identical, and 0.0 if they have nothing in common. This is expensive to compute if getMatchingBlocks() or getOpcodes() hasn<U+2019>t already been called,
in which case you may want to try quickRatio() or realQuickRatio() first to get an upper bound.
the quick_ratio method returns an upper bound on ratio() relatively quickly.
the real_quick_ratio method returns an upper bound on ratio() very quickly.
the get_matching_blocks method returns a list of triples describing matching subsequences. Each triple is of the form [i, j, n], and means that a[i:i+n] == b[j:j+n]. The triples are monotonically
increasing in i and j. The last triple is a dummy, and has the value [a.length, b.length, 0]. It is the only triple with n == 0. If [i, j, n] and [i', j', n'] are adjacent triples in the list, and the second
is not the last triple in the list, then i+n != i' or j+n != j'; in other words, adjacent triples always describe non-adjacent equal blocks.
The get_opcodes method returns a list of 5-tuples describing how to turn a into b. Each tuple is of the form [tag, i1, i2, j1, j2]. The first tuple has i1 == j1 == 0, and remaining tuples have i1 equal to
the i2 from the preceding tuple, and, likewise, j1 equal to the previous j2. The tag values are strings, with these meanings:
'replace' a[i1:i2] should be replaced by b[j1:j2].
'delete' a[i1:i2] should be deleted. Note that j1 == j2 in this case.
'insert' b[j1:j2] should be inserted at a[i1:i1]. Note that i1 == i2 in this case.
'equal' a[i1:i2] == b[j1:j2] (the sub-sequences are equal).