php-doc-en/functions/aspell.sgml
cslawi 9256eb3b12 Normalized according to the DocBook 3.1 DTD. This mostly just adds
closing tags and attribute quotes, but lets a stock 3.1 install
compile the PHP docs. It still compiles with DocBook 3.0, as well.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@14693 c90b9560-bf6c-de11-be94-00142212c4b1
1999-10-20 22:41:42 +00:00

156 lines
4.5 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>
<simpara>
You need the aspell library, available from: <ulink url="http://metalab.unc.edu/kevina/aspell/">http://metalab.unc.edu/kevina/aspell/</ulink></simpara>
</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.</simpara>
<para>
<example>
<title>aspell_new</title>
<programlisting>
$aspell_link=aspell_new("english");
</programlisting>
</example></para>
</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.</simpara>
<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></para>
</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.</simpara>
<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></para>
</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.</simpara>
<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></para>
</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:
-->