b.p.PatienceSequenceMatcher(difflib.SequenceMatcher) : class documentation

Part of bzrlib.patiencediff View In Hierarchy

Compare a pair of sequences using longest common subset.
Method __init__ Undocumented
Method get_matching_blocks Return list of triples describing matching subsequences.
def __init__(self, isjunk=None, a='', b=''):
Undocumented
def get_matching_blocks(self):

Return 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 in j.

The last triple is a dummy, (len(a), len(b), 0), and is the only triple with n==0.

>>> s = PatienceSequenceMatcher(None, "abxcd", "abcd")
>>> s.get_matching_blocks()
[(0, 0, 2), (3, 2, 2), (5, 4, 0)]
API Documentation for Bazaar, generated by pydoctor at 2014-10-23 00:02:21.