ec27435ec72c7a72602ecda97ae411fa0f7c6c77
[platform/upstream/python-lxml.git] / doc / html / api / lxml.html.diff.InsensitiveSequenceMatcher-class.html
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">
5 <head>
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>
9 </head>
10
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
12       alink="#204080">
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15        bgcolor="#a0c0ff" cellspacing="0">
16   <tr valign="middle">
17   <!-- Home link -->
18       <th>&nbsp;&nbsp;&nbsp;<a
19         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21   <!-- Tree link -->
22       <th>&nbsp;&nbsp;&nbsp;<a
23         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25   <!-- Index link -->
26       <th>&nbsp;&nbsp;&nbsp;<a
27         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29   <!-- Help link -->
30       <th>&nbsp;&nbsp;&nbsp;<a
31         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
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>
38           </tr></table></th>
39   </tr>
40 </table>
41 <table width="100%" cellpadding="0" cellspacing="0">
42   <tr valign="top">
43     <td width="100%">
44       <span class="breadcrumbs">
45         <a href="lxml-module.html">Package&nbsp;lxml</a> ::
46         <a href="lxml.html-module.html">Package&nbsp;html</a> ::
47         <a href="lxml.html.diff-module.html">Module&nbsp;diff</a> ::
48         Class&nbsp;InsensitiveSequenceMatcher
49       </span>
50     </td>
51     <td>
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&nbsp;private</a>]</span></td></tr>
56         <tr><td align="right"><span class="options"
57             >[<a href="frames.html" target="_top">frames</a
58             >]&nbsp;|&nbsp;<a href="lxml.html.diff.InsensitiveSequenceMatcher-class.html"
59             target="_top">no&nbsp;frames</a>]</span></td></tr>
60       </table>
61     </td>
62   </tr>
63 </table>
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&nbsp;code</a></span></p>
66 <pre class="base-tree">
67 difflib.SequenceMatcher --+
68                           |
69                          <strong class="uidshort">InsensitiveSequenceMatcher</strong>
70 </pre>
71
72 <hr />
73 Acts like SequenceMatcher, but tries not to find very small equal
74 blocks amidst large spans of changes
75
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%">
83       <tr valign="top">
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>
89       </tr>
90     </table>
91   </td>
92 </tr>
93 <tr>
94     <td width="15%" align="right" valign="top" class="summary">
95       <span class="summary-type">&nbsp;</span>
96     </td><td class="summary">
97       <table width="100%" cellpadding="0" cellspacing="0" border="0">
98         <tr>
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&nbsp;code</a></span>
103             
104           </td>
105         </tr>
106       </table>
107       
108     </td>
109   </tr>
110   <tr>
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>,
118       <code>ratio</code>,
119       <code>real_quick_ratio</code>,
120       <code>set_seq1</code>,
121       <code>set_seq2</code>,
122       <code>set_seqs</code>
123       </p>
124     </td>
125   </tr>
126 </table>
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%">
134       <tr valign="top">
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>
140       </tr>
141     </table>
142   </td>
143 </tr>
144 <tr>
145     <td width="15%" align="right" valign="top" class="summary">
146       <span class="summary-type">&nbsp;</span>
147     </td><td class="summary">
148         <a name="threshold"></a><span class="summary-name">threshold</span> = <code title="2">2</code>
149     </td>
150   </tr>
151 <tr>
152     <td width="15%" align="right" valign="top" class="summary">
153       <span class="summary-type">&nbsp;</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>
156     </td>
157   </tr>
158 </table>
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%">
166       <tr valign="top">
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>
172       </tr>
173     </table>
174   </td>
175 </tr>
176 </table>
177 <a name="get_matching_blocks"></a>
178 <div>
179 <table class="details" border="1" cellpadding="3"
180        cellspacing="0" width="100%" bgcolor="white">
181 <tr><td>
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>
185   </h3>
186   </td><td align="right" valign="top"
187     ><span class="codelink"><a href="lxml.html.diff-pysrc.html#InsensitiveSequenceMatcher.get_matching_blocks">source&nbsp;code</a></span>&nbsp;
188     </td>
189   </tr></table>
190   
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
198 blocks.</p>
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">&gt;&gt;&gt; </span>s = SequenceMatcher(None, <span class="py-string">&quot;abxcd&quot;</span>, <span class="py-string">&quot;abcd&quot;</span>)
203 <span class="py-prompt">&gt;&gt;&gt; </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>
205   <dl class="fields">
206     <dt>Overrides:
207         difflib.SequenceMatcher.get_matching_blocks
208         <dd><em class="note">(inherited documentation)</em></dd>
209     </dt>
210   </dl>
211 </td></tr></table>
212 </div>
213 <br />
214 <!-- ==================== NAVIGATION BAR ==================== -->
215 <table class="navbar" border="0" width="100%" cellpadding="0"
216        bgcolor="#a0c0ff" cellspacing="0">
217   <tr valign="middle">
218   <!-- Home link -->
219       <th>&nbsp;&nbsp;&nbsp;<a
220         href="lxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
221
222   <!-- Tree link -->
223       <th>&nbsp;&nbsp;&nbsp;<a
224         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
225
226   <!-- Index link -->
227       <th>&nbsp;&nbsp;&nbsp;<a
228         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
229
230   <!-- Help link -->
231       <th>&nbsp;&nbsp;&nbsp;<a
232         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
233
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>
239           </tr></table></th>
240   </tr>
241 </table>
242 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
243   <tr>
244     <td align="left" class="footer">
245     Generated by Epydoc 3.0.1
246     on Wed Jan 29 12:26:21 2020
247     </td>
248     <td align="right" class="footer">
249       <a target="mainFrame" href="http://epydoc.sourceforge.net"
250         >http://epydoc.sourceforge.net</a>
251     </td>
252   </tr>
253 </table>
254
255 <script type="text/javascript">
256   <!--
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.
261   checkCookie();
262   // -->
263 </script>
264 </body>
265 </html>