php-doc-en/functions/aspell.sgml
James Gingerich 82c6591284 Many minor cleanups.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@9864 c90b9560-bf6c-de11-be94-00142212c4b1
1999-06-20 03:04:56 +00:00

157 lines
4.4 KiB
Text

<reference id="ref.aspell">
<title>Aspell functions</title>
<titleabbrev>aspell</titleabbrev>
<partintro>
<simpara>
The <function>aspell</function> functions allows you to check the
spelling on a word and offer suggestions.
<simpara>
You need the aspell library, available from: <ulink
url="http://metalab.unc.edu/kevina/aspell/">http://metalab.unc.edu/kevina/aspell/</ulink>
</partintro>
<refentry id="function.aspell-new">
<refnamediv>
<refname>aspell_new</refname>
<refpurpose>load a new dictionary</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>aspell_new</function></funcdef>
<paramdef>string <parameter>master</parameter></paramdef>
<paramdef>string <parameter>personal</parameter></paramdef>
</funcsynopsis>
<simpara>
<function>aspell_new</function> opens up a new dictionary and
returns the dictionary link identifier for use in other aspell
functions.
<para>
<example>
<title>aspell_new</title>
<programlisting>
$aspell_link=aspell_new("english");
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.aspell-check">
<refnamediv>
<refname>aspell_check</refname>
<refpurpose>check a word</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>boolean <function>aspell_check</function></funcdef>
<paramdef>int <parameter>dictionary_link</parameter></paramdef>
<paramdef>string <parameter>word</parameter></paramdef>
</funcsynopsis>
<simpara>
<function>aspell_check</function> checks the spelling of a word
and returns true if the spelling is correct, false if not.
<para>
<example>
<title>aspell_check</title>
<programlisting>
$aspell_link=aspell_new("english");
if (aspell_check($aspell_link,"testt")) {
echo "This is a valid spelling";
} else {
echo "Sorry, wrong spelling";
}
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.aspell-check-raw">
<refnamediv>
<refname>aspell_check-raw</refname>
<refpurpose>check a word without changing its case or trying to
trim it</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>boolean <function>aspell_check_raw</function></funcdef>
<paramdef>int <parameter>dictionary_link</parameter></paramdef>
<paramdef>string <parameter>word</parameter></paramdef>
</funcsynopsis>
<simpara>
<function>aspell_check_raw</function> checks the spelling of a
word, without changing its case or trying to trim it in any way
and returns true if the spelling is correct, false if not.
<para>
<example>
<title>aspell_check_raw</title>
<programlisting>
$aspell_link=aspell_new("english");
if (aspell_check_raw($aspell_link,"testt")) {
echo "This is a valid spelling";
} else {
echo "Sorry, wrong spelling";
}
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.aspell-suggest">
<refnamediv>
<refname>aspell_suggest</refname>
<refpurpose>suggest spellings of a word</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>aspell_suggest</function></funcdef>
<paramdef>int <parameter>dictionary_link</parameter></paramdef>
<paramdef>string <parameter>word</parameter></paramdef>
</funcsynopsis>
<simpara>
<function>aspell_suggest</function> returns an array of possible
spellings for the given word.
<para>
<example>
<title>aspell_suggest</title>
<programlisting>
$aspell_link=aspell_new("english");
if (!aspell_check($aspell_link,"testt")) {
$suggestions=aspell_suggest($aspell_link,"testt");
for($i=0; $i &lt; count($suggestions); $i++) {
echo "Possible spelling: " . $suggestions[$i] . "&lt;br>";
}
}
</programlisting>
</example>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->