Methods
|
|
|
|
__chain_b
|
__chain_b ( self )
|
|
__helper
|
__helper (
self,
alo,
ahi,
blo,
bhi,
answer,
)
|
|
__init__
|
__init__ (
self,
isjunk=None,
a='',
b='',
)
|
|
find_longest_match
|
find_longest_match (
self,
alo,
ahi,
blo,
bhi,
)
Find longest matching block in a[alo:ahi] and b[blo:bhi].
If isjunk is not defined:
Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
alo <= i <= i+k <= ahi
blo <= j <= j+k <= bhi
and for all (i',j',k') meeting those conditions,
k >= k'
i <= i'
and if i == i', j <= j'
In other words, of all maximal matching blocks, return one
that starts earliest in a, and of all those maximal matching
blocks that start earliest in a, return the one that starts
earliest in b.
If isjunk is defined, first the longest matching block is
determined as above, but with the additional restriction that
no junk element appears in the block. Then that block is
extended as far as possible by matching (only) junk elements on
both sides. So the resulting block never matches on junk except
as identical junk happens to be adjacent to an "interesting"
match.
If no blocks match, return (alo, blo, 0).
|
|
get_matching_blocks
|
get_matching_blocks ( self )
|
|
get_opcodes
|
get_opcodes ( self )
|
|
quick_ratio
|
quick_ratio ( self )
Return an upper bound on ratio() relatively quickly.
|
|
ratio
|
ratio ( self )
Return a measure of the sequences' similarity (float in [0,1]).
Where T is the total number of elements in both sequences, and
M is the number of matches, this is 2*M / T.
Note that this is 1 if the sequences are identical, and 0 if
they have nothing in common.
|
|
real_quick_ratio
|
real_quick_ratio ( self )
Return an upper bound on ratio() very quickly
|
|
set_seq1
|
set_seq1 ( self, a )
|
|
set_seq2
|
set_seq2 ( self, b )
|
|
set_seqs
|
set_seqs (
self,
a,
b,
)
|
|