doc-exports/docs/dws/dev/dws_06_0114.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

36 lines
3.1 KiB
HTML

<a name="EN-US_TOPIC_0000001188589024"></a><a name="EN-US_TOPIC_0000001188589024"></a>
<h1 class="topictitle1">Testing a Dictionary</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188589024__en-us_topic_0059779360_p5728933042">The <strong id="EN-US_TOPIC_0000001188589024__b84235270619211">ts_lexize</strong> function facilitates dictionary testing.</p>
<p id="EN-US_TOPIC_0000001188589024__affa7b238cfc24197b412402a17b21f4b"><strong id="EN-US_TOPIC_0000001188589024__b842352706192225">ts_lexize(dict regdictionary, token text) returns text[]</strong> <strong id="EN-US_TOPIC_0000001188589024__b84235270619231">ts_lexize</strong> returns an array of lexemes if the input <strong id="EN-US_TOPIC_0000001188589024__b842352706192318">token</strong> is known to the dictionary, or an empty array if the token is known to the dictionary but it is a stop word, or <strong id="EN-US_TOPIC_0000001188589024__b842352706192334">NULL</strong> if it is an unknown word. </p>
<p id="EN-US_TOPIC_0000001188589024__ac19eb39da6b144748bd7f620fc9d2623">For example:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589024__s39293e88b0aa4983909e8175bb3a3cb2"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span>
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">ts_lexize</span><span class="p">(</span><span class="s1">'english_stem'</span><span class="p">,</span><span class="w"> </span><span class="s1">'stars'</span><span class="p">);</span>
<span class="w"> </span><span class="n">ts_lexize</span>
<span class="c1">-----------</span>
<span class="w"> </span><span class="err">{</span><span class="n">star</span><span class="err">}</span>
<span class="k">SELECT</span><span class="w"> </span><span class="n">ts_lexize</span><span class="p">(</span><span class="s1">'english_stem'</span><span class="p">,</span><span class="w"> </span><span class="s1">'a'</span><span class="p">);</span>
<span class="w"> </span><span class="n">ts_lexize</span>
<span class="c1">-----------</span>
<span class="w"> </span><span class="err">{}</span>
</pre></div></td></tr></table></div>
</div>
<div class="notice" id="EN-US_TOPIC_0000001188589024__nc1c96457914646a696996e07d12b53bd"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589024__a1656aa11762a4de78fc4a130dd4218d9">The <strong id="EN-US_TOPIC_0000001188589024__b84235270619257">ts_lexize</strong> function expects a single <strong id="EN-US_TOPIC_0000001188589024__b842352706192524">token</strong>, not text.</p>
</div></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0111.html">Testing and Debugging Text Search</a></div>
</div>
</div>