1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <title>lxml.html.diff.InsensitiveSequenceMatcher</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
18 <th> <a
19 href="lxml-module.html">Home</a> </th>
22 <th> <a
23 href="module-tree.html">Trees</a> </th>
26 <th> <a
27 href="identifier-index.html">Indices</a> </th>
30 <th> <a
31 href="help.html">Help</a> </th>
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="/">lxml API</a></th>
41 <table width="100%" cellpadding="0" cellspacing="0">
44 <span class="breadcrumbs">
45 <a href="lxml-module.html">Package lxml</a> ::
46 <a href="lxml.html-module.html">Package html</a> ::
47 <a href="lxml.html.diff-module.html">Module diff</a> ::
48 Class InsensitiveSequenceMatcher
52 <table cellpadding="0" cellspacing="0">
53 <!-- hide/show private -->
54 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
55 onclick="toggle_private();">hide private</a>]</span></td></tr>
56 <tr><td align="right"><span class="options"
57 >[<a href="frames.html" target="_top">frames</a
58 >] | <a href="lxml.html.diff.InsensitiveSequenceMatcher-class.html"
59 target="_top">no frames</a>]</span></td></tr>
64 <!-- ==================== CLASS DESCRIPTION ==================== -->
65 <h1 class="epydoc">Class InsensitiveSequenceMatcher</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.html.diff-pysrc.html#InsensitiveSequenceMatcher">source code</a></span></p>
66 <pre class="base-tree">
67 difflib.SequenceMatcher --+
69 <strong class="uidshort">InsensitiveSequenceMatcher</strong>
73 Acts like SequenceMatcher, but tries not to find very small equal
74 blocks amidst large spans of changes
76 <!-- ==================== INSTANCE METHODS ==================== -->
77 <a name="section-InstanceMethods"></a>
78 <table class="summary" border="1" cellpadding="3"
79 cellspacing="0" width="100%" bgcolor="white">
80 <tr bgcolor="#70b0f0" class="table-header">
81 <td colspan="2" class="table-header">
82 <table border="0" cellpadding="0" cellspacing="0" width="100%">
84 <td align="left"><span class="table-header">Instance Methods</span></td>
85 <td align="right" valign="top"
86 ><span class="options">[<a href="#section-InstanceMethods"
87 class="privatelink" onclick="toggle_private();"
88 >hide private</a>]</span></td>
94 <td width="15%" align="right" valign="top" class="summary">
95 <span class="summary-type"> </span>
96 </td><td class="summary">
97 <table width="100%" cellpadding="0" cellspacing="0" border="0">
99 <td><span class="summary-sig"><a href="lxml.html.diff.InsensitiveSequenceMatcher-class.html#get_matching_blocks" class="summary-sig-name">get_matching_blocks</a>(<span class="summary-sig-arg">self</span>)</span><br />
100 Return list of triples describing matching subsequences.</td>
101 <td align="right" valign="top">
102 <span class="codelink"><a href="lxml.html.diff-pysrc.html#InsensitiveSequenceMatcher.get_matching_blocks">source code</a></span>
111 <td colspan="2" class="summary">
112 <p class="indent-wrapped-lines"><b>Inherited from <code>difflib.SequenceMatcher</code></b>:
113 <code>__init__</code>,
114 <code>find_longest_match</code>,
115 <code>get_grouped_opcodes</code>,
116 <code>get_opcodes</code>,
117 <code>quick_ratio</code>,
119 <code>real_quick_ratio</code>,
120 <code>set_seq1</code>,
121 <code>set_seq2</code>,
122 <code>set_seqs</code>
127 <!-- ==================== CLASS VARIABLES ==================== -->
128 <a name="section-ClassVariables"></a>
129 <table class="summary" border="1" cellpadding="3"
130 cellspacing="0" width="100%" bgcolor="white">
131 <tr bgcolor="#70b0f0" class="table-header">
132 <td colspan="2" class="table-header">
133 <table border="0" cellpadding="0" cellspacing="0" width="100%">
135 <td align="left"><span class="table-header">Class Variables</span></td>
136 <td align="right" valign="top"
137 ><span class="options">[<a href="#section-ClassVariables"
138 class="privatelink" onclick="toggle_private();"
139 >hide private</a>]</span></td>
145 <td width="15%" align="right" valign="top" class="summary">
146 <span class="summary-type"> </span>
147 </td><td class="summary">
148 <a name="threshold"></a><span class="summary-name">threshold</span> = <code title="2">2</code>
152 <!-- ==================== METHOD DETAILS ==================== -->
153 <a name="section-MethodDetails"></a>
154 <table class="details" border="1" cellpadding="3"
155 cellspacing="0" width="100%" bgcolor="white">
156 <tr bgcolor="#70b0f0" class="table-header">
157 <td colspan="2" class="table-header">
158 <table border="0" cellpadding="0" cellspacing="0" width="100%">
160 <td align="left"><span class="table-header">Method Details</span></td>
161 <td align="right" valign="top"
162 ><span class="options">[<a href="#section-MethodDetails"
163 class="privatelink" onclick="toggle_private();"
164 >hide private</a>]</span></td>
170 <a name="get_matching_blocks"></a>
172 <table class="details" border="1" cellpadding="3"
173 cellspacing="0" width="100%" bgcolor="white">
175 <table width="100%" cellpadding="0" cellspacing="0" border="0">
176 <tr valign="top"><td>
177 <h3 class="epydoc"><span class="sig"><span class="sig-name">get_matching_blocks</span>(<span class="sig-arg">self</span>)</span>
179 </td><td align="right" valign="top"
180 ><span class="codelink"><a href="lxml.html.diff-pysrc.html#InsensitiveSequenceMatcher.get_matching_blocks">source code</a></span>
184 <p>Return list of triples describing matching subsequences.</p>
185 <p>Each triple is of the form (i, j, n), and means that
186 a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in
187 i and in j. New in Python 2.5, it's also guaranteed that if
188 (i, j, n) and (i', j', n') are adjacent triples in the list, and
189 the second is not the last triple in the list, then i+n != i' or
190 j+n != j'. IOW, adjacent triples never describe adjacent equal
192 <p>The last triple is a dummy, (len(a), len(b), 0), and is the only
193 triple with n==0.</p>
194 <pre class="py-doctest">
195 <span class="py-prompt">>>> </span>s = SequenceMatcher(None, <span class="py-string">"abxcd"</span>, <span class="py-string">"abcd"</span>)
196 <span class="py-prompt">>>> </span>s.get_matching_blocks()
197 <span class="py-output">[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]</span></pre>
200 difflib.SequenceMatcher.get_matching_blocks
201 <dd><em class="note">(inherited documentation)</em></dd>
207 <!-- ==================== NAVIGATION BAR ==================== -->
208 <table class="navbar" border="0" width="100%" cellpadding="0"
209 bgcolor="#a0c0ff" cellspacing="0">
212 <th> <a
213 href="lxml-module.html">Home</a> </th>
216 <th> <a
217 href="module-tree.html">Trees</a> </th>
220 <th> <a
221 href="identifier-index.html">Indices</a> </th>
224 <th> <a
225 href="help.html">Help</a> </th>
227 <!-- Project homepage -->
228 <th class="navbar" align="right" width="100%">
229 <table border="0" cellpadding="0" cellspacing="0">
230 <tr><th class="navbar" align="center"
231 ><a class="navbar" target="_top" href="/">lxml API</a></th>
235 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
237 <td align="left" class="footer">
238 Generated by Epydoc 3.0.1 on Tue Jul 31 10:14:19 2012
240 <td align="right" class="footer">
241 <a target="mainFrame" href="http://epydoc.sourceforge.net"
242 >http://epydoc.sourceforge.net</a>
247 <script type="text/javascript">
249 // Private objects are initially displayed (because if
250 // javascript is turned off then we want them to be
251 // visible); but by default, we want to hide them. So hide
252 // them unless we have a cookie that says to show them.