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 <td width="15%" align="right" valign="top" class="summary">
153 <span class="summary-type"> </span>
154 </td><td class="summary">
155 <a name="__qualname__"></a><span class="summary-name">__qualname__</span> = <code title="'InsensitiveSequenceMatcher'"><code class="variable-quote">'</code><code class="variable-string">InsensitiveSequenceMatcher</code><code class="variable-quote">'</code></code>
159 <!-- ==================== METHOD DETAILS ==================== -->
160 <a name="section-MethodDetails"></a>
161 <table class="details" border="1" cellpadding="3"
162 cellspacing="0" width="100%" bgcolor="white">
163 <tr bgcolor="#70b0f0" class="table-header">
164 <td colspan="2" class="table-header">
165 <table border="0" cellpadding="0" cellspacing="0" width="100%">
167 <td align="left"><span class="table-header">Method Details</span></td>
168 <td align="right" valign="top"
169 ><span class="options">[<a href="#section-MethodDetails"
170 class="privatelink" onclick="toggle_private();"
171 >hide private</a>]</span></td>
177 <a name="get_matching_blocks"></a>
179 <table class="details" border="1" cellpadding="3"
180 cellspacing="0" width="100%" bgcolor="white">
182 <table width="100%" cellpadding="0" cellspacing="0" border="0">
183 <tr valign="top"><td>
184 <h3 class="epydoc"><span class="sig"><span class="sig-name">get_matching_blocks</span>(<span class="sig-arg">self</span>)</span>
186 </td><td align="right" valign="top"
187 ><span class="codelink"><a href="lxml.html.diff-pysrc.html#InsensitiveSequenceMatcher.get_matching_blocks">source code</a></span>
191 <p>Return list of triples describing matching subsequences.</p>
192 <p>Each triple is of the form (i, j, n), and means that
193 a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in
194 i and in j. New in Python 2.5, it's also guaranteed that if
195 (i, j, n) and (i', j', n') are adjacent triples in the list, and
196 the second is not the last triple in the list, then i+n != i' or
197 j+n != j'. IOW, adjacent triples never describe adjacent equal
199 <p>The last triple is a dummy, (len(a), len(b), 0), and is the only
200 triple with n==0.</p>
201 <pre class="py-doctest">
202 <span class="py-prompt">>>> </span>s = SequenceMatcher(None, <span class="py-string">"abxcd"</span>, <span class="py-string">"abcd"</span>)
203 <span class="py-prompt">>>> </span>s.get_matching_blocks()
204 <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>
207 difflib.SequenceMatcher.get_matching_blocks
208 <dd><em class="note">(inherited documentation)</em></dd>
214 <!-- ==================== NAVIGATION BAR ==================== -->
215 <table class="navbar" border="0" width="100%" cellpadding="0"
216 bgcolor="#a0c0ff" cellspacing="0">
219 <th> <a
220 href="lxml-module.html">Home</a> </th>
223 <th> <a
224 href="module-tree.html">Trees</a> </th>
227 <th> <a
228 href="identifier-index.html">Indices</a> </th>
231 <th> <a
232 href="help.html">Help</a> </th>
234 <!-- Project homepage -->
235 <th class="navbar" align="right" width="100%">
236 <table border="0" cellpadding="0" cellspacing="0">
237 <tr><th class="navbar" align="center"
238 ><a class="navbar" target="_top" href="/">lxml API</a></th>
242 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
244 <td align="left" class="footer">
245 Generated by Epydoc 3.0.1
246 on Wed Jan 29 12:26:21 2020
248 <td align="right" class="footer">
249 <a target="mainFrame" href="http://epydoc.sourceforge.net"
250 >http://epydoc.sourceforge.net</a>
255 <script type="text/javascript">
257 // Private objects are initially displayed (because if
258 // javascript is turned off then we want them to be
259 // visible); but by default, we want to hide them. So hide
260 // them unless we have a cookie that says to show them.