packages feed

highlighting-kate-0.5.14: tests/abc.python.html

<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #40a070; }
code > span.fl { color: #40a070; }
code > span.ch { color: #4070a0; }
code > span.st { color: #4070a0; }
code > span.co { color: #60a0b0; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #06287e; }
code > span.er { color: #ff0000; font-weight: bold; }
</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">def</span> mkword(w, b):
    <span class="kw" title="KeywordTok">if</span> not w: <span class="kw" title="KeywordTok">return</span> []

    c,w = w[<span class="dv" title="DecValTok">0</span>],w[<span class="dv" title="DecValTok">1</span>:]
    <span class="kw" title="KeywordTok">for</span> i in <span class="dt" title="DataTypeTok">range</span>(<span class="dt" title="DataTypeTok">len</span>(b)):
        <span class="kw" title="KeywordTok">if</span> c in b[i]:
            m = mkword(w, b[<span class="dv" title="DecValTok">0</span>:i] + b[i<span class="dv" title="DecValTok">+1</span>:])
            <span class="kw" title="KeywordTok">if</span> m != <span class="ot" title="OtherTok">None</span>: <span class="kw" title="KeywordTok">return</span> [b[i]] + m

<span class="kw" title="KeywordTok">def</span> abc(w, blk):
    <span class="kw" title="KeywordTok">return</span> mkword(w.upper(), [a.upper() <span class="kw" title="KeywordTok">for</span> a in blk])

blocks = <span class="st" title="StringTok">&#39;BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM&#39;</span>.split()

<span class="kw" title="KeywordTok">for</span> w in <span class="st" title="StringTok">&quot;, A, bark, book, treat, common, SQUAD, conFUsEd&quot;</span>.split(<span class="st" title="StringTok">&#39;, &#39;</span>):
    <span class="dt" title="DataTypeTok">print</span> <span class="st" title="StringTok">&#39;</span><span class="ch" title="CharTok">\&#39;</span><span class="st" title="StringTok">&#39;</span> + w + <span class="st" title="StringTok">&#39;</span><span class="ch" title="CharTok">\&#39;</span><span class="st" title="StringTok">&#39;</span> + <span class="st" title="StringTok">&#39; -&gt;&#39;</span>, abc(w, blocks)</code></pre></div></body>