mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
144 lines
6.1 KiB
HTML
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 >= 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> — <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"><?php<br />$tag </span><span style="color: #007700">= </span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$r </span><span style="color: #007700">= </span><span style="color: #0000BB">enchant_broker_init</span><span style="color: #007700">();<br /><br />if (</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">)) {<br /> </span><span style="color: #0000BB">$d </span><span style="color: #007700">= </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">, </span><span style="color: #0000BB">$tag</span><span style="color: #007700">);<br /> </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">, </span><span style="color: #DD0000">'soong'</span><span style="color: #007700">, </span><span style="color: #0000BB">$suggs</span><span style="color: #007700">);<br /> </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">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
Array
|
|
(
|
|
[0] => song
|
|
[1] => snog
|
|
[2] => soon
|
|
[3] => Sang
|
|
[4] => Sung
|
|
[5] => sang
|
|
[6] => sung
|
|
[7] => sponge
|
|
[8] => spongy
|
|
[9] => snag
|
|
[10] => snug
|
|
[11] => sonic
|
|
[12] => sing
|
|
[13] => songs
|
|
[14] => Son
|
|
[15] => Sonja
|
|
[16] => Synge
|
|
[17] => son
|
|
[18] => Sejong
|
|
[19] => sarong
|
|
[20] => sooner
|
|
[21] => Sony
|
|
[22] => sown
|
|
[23] => scone
|
|
[24] => song'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> |