Home | Trees | Index | Help |
|
---|
Package lxml :: Package html :: Module diff :: Class InsensitiveSequenceMatcher |
|
SequenceMatcher
--+
|
InsensitiveSequenceMatcher
Method Summary | |
---|---|
Return list of triples describing matching subsequences. | |
Inherited from SequenceMatcher | |
Construct a SequenceMatcher. | |
Find longest matching block in a[alo:ahi] and b[blo:bhi]. | |
Isolate change clusters by eliminating ranges with no changes. | |
Return list of 5-tuples describing how to turn a into b. | |
Return an upper bound on ratio() relatively quickly. | |
Return a measure of the sequences' similarity (float in [0,1]). | |
Return an upper bound on ratio() very quickly. | |
Set the first sequence to be compared. | |
Set the second sequence to be compared. | |
Set the two sequences to be compared. |
Class Variable Summary | |
---|---|
int |
threshold = 2 |
Method Details |
---|
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. New in Python 2.5, it's also guaranteed that 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'. IOW, adjacent triples never describe adjacent equal blocks. The last triple is a dummy, (len(a), len(b), 0), and is the only triple with n==0.>>> s = SequenceMatcher(None, "abxcd", "abcd") >>> s.get_matching_blocks() [(0, 0, 2), (3, 2, 2), (5, 4, 0)]
|
Class Variable Details |
---|
threshold
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Aug 18 12:44:27 2007 | http://epydoc.sf.net |