uTools-Manuals/docs/php/enchant_dict_quick_check.html
2019-04-28 19:00:34 +08:00

144 lines
6.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Check the word is correctly spelled and provide suggestions</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.enchant-dict-quick-check" class="refentry">
<div class="refnamediv">
<h1 class="refname">enchant_dict_quick_check</h1>
<p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PECL enchant:0.2.0-1.0.1)</p><p class="refpurpose"><span class="refname">enchant_dict_quick_check</span> &mdash; <span class="dc-title">Check the word is correctly spelled and provide suggestions</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.enchant-dict-quick-check-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>enchant_dict_quick_check</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$dict</code></span>
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$word</code></span>
[, <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$suggestions</code></span>
] ) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
If the word is correctly spelled return <strong><code>TRUE</code></strong>, otherwise return <strong><code>FALSE</code></strong>, if suggestions variable
is provided, fill it with spelling alternatives.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.enchant-dict-quick-check-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">dict</code></dt>
<dd>
<p class="para">
Dictionary resource
</p>
</dd>
<dt>
<code class="parameter">word</code></dt>
<dd>
<p class="para">
The word to check
</p>
</dd>
<dt>
<code class="parameter">suggestions</code></dt>
<dd>
<p class="para">
If the word is not correctly spelled, this variable will
contain an array of suggestions.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.enchant-dict-quick-check-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns <strong><code>TRUE</code></strong> if the word is correctly spelled or <strong><code>FALSE</code></strong>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.enchant-dict-quick-check-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-2882">
<p><strong>Example #1 A <span class="function"><strong>enchant_dict_quick_check()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$tag&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$r&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_broker_init</span><span style="color: #007700">();<br /><br />if&nbsp;(</span><span style="color: #0000BB">enchant_broker_dict_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">,</span><span style="color: #0000BB">$tag</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$d&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">enchant_broker_request_dict</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$tag</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">enchant_dict_quick_check</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'soong'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$suggs</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$suggs</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[0] =&gt; song
[1] =&gt; snog
[2] =&gt; soon
[3] =&gt; Sang
[4] =&gt; Sung
[5] =&gt; sang
[6] =&gt; sung
[7] =&gt; sponge
[8] =&gt; spongy
[9] =&gt; snag
[10] =&gt; snug
[11] =&gt; sonic
[12] =&gt; sing
[13] =&gt; songs
[14] =&gt; Son
[15] =&gt; Sonja
[16] =&gt; Synge
[17] =&gt; son
[18] =&gt; Sejong
[19] =&gt; sarong
[20] =&gt; sooner
[21] =&gt; Sony
[22] =&gt; sown
[23] =&gt; scone
[24] =&gt; song&#039;s
)
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.enchant-dict-quick-check-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="enchant_dict_check.html" class="function" rel="rdfs-seeAlso">enchant_dict_check()</a> - Check whether a word is correctly spelled or not</span></li>
<li class="member"><span class="function"><a href="enchant_dict_suggest.html" class="function" rel="rdfs-seeAlso">enchant_dict_suggest()</a> - Will return a list of values if any of those pre-conditions are not met</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>