Date: 07/26/00
- Next message: Vlad Krupin: "[PHP-DOC] cvs: phpdoc /en/functions aspell.xml"
- Previous message: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
vlad Wed Jul 26 14:20:50 2000 EDT
Modified files:
/phpdoc/en/functions pspell.xml
Log:
- New syntax for pspell_new()
- Removed pspell_mode() and pspell_runtogether() and their
functionality moved to pspell_new()
- fixed a few typos in the text borrowed from pspell website
Index: phpdoc/en/functions/pspell.xml
diff -u phpdoc/en/functions/pspell.xml:1.2 phpdoc/en/functions/pspell.xml:1.3
--- phpdoc/en/functions/pspell.xml:1.2 Fri Jul 14 14:56:42 2000
+++ phpdoc/en/functions/pspell.xml Wed Jul 26 14:20:50 2000
@@ -4,8 +4,8 @@
<partintro>
<simpara>
- The <function>pspell</function> functions allows you to check the
- spelling on a word and offer suggestions.
+ The <function>pspell</function> functions allow you to check the
+ spelling of a word and offer suggestions.
</simpara>
<simpara>
You need the aspell and pspell libraries, available from: <ulink
@@ -39,6 +39,11 @@
<optional>encoding</optional>
</parameter>
</paramdef>
+ <paramdef>int
+ <parameter>
+ <optional>mode</optional>
+ </parameter>
+ </paramdef>
</funcprototype>
</funcsynopsis>
<simpara>
@@ -49,115 +54,66 @@
<para>
The language parameter is the language code which consists of the
two letter ISO 639 language code and an optional two letter ISO
- 3166 country code after a dash or underscore. The spelling
- parameter is the requested spelling for languages with more than
- one spelling such as English. Known values are ``american'',
- ``britsh'', and ``canadian''. The jargon parameter contains extra
- information two distinguish two different words lists that have
- the same language-tag and spelling. The encoding parameter is the
- encoding that words are expected to be in. Valid values are
- 'utf-8', 'iso8859-*', 'koi8-r', 'viscii', 'cp1252', 'machine
- unsigned 16', 'machine unsigned 32'. This parameter is largely
- untested, so be careful when using. For more information and
- examples, check out inline manual pspell website:<ulink
- url="&url.pspell;">&url.pspell;</ulink>.
+ 3166 country code after a dash or underscore.
+ </para>
+ <para>
+ The spelling parameter is the requested spelling for languages
+ with more than one spelling such as English. Known values are 'american',
+ 'british', and 'canadian'.
+ </para>
+ <para>
+ The jargon parameter contains extra information to distinguish two
+ different words lists that have the same language and spelling
+ parameters.
+ </para>
+ <para>
+ The encoding parameter is the encoding that words are expected to be in.
+ Valid values are 'utf-8', 'iso8859-*', 'koi8-r', 'viscii', 'cp1252',
+ 'machine unsigned 16', 'machine unsigned 32'. This parameter is largely
+ untested, so be careful when using.
</para>
- <para>
- <example>
- <title><function>Pspell_new</function></title>
- <programlisting role="php">
-$pspell_link = pspell_new ("english");
- </programlisting>
- </example>
- </para>
- </refsect1>
- </refentry>
-
- <refentry id="function.pspell-mode">
- <refnamediv>
- <refname>pspell_mode</refname>
- <refpurpose>Change spellchecking mode</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>boolean <function>pspell_mode</function></funcdef>
- <paramdef>int <parameter>dictionary_link</parameter></paramdef>
- <paramdef>int <parameter>mode</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <simpara>
- <function>Pspell_mode</function> changes the spellchecking mode.
- </simpara>
- <para>There are three modes available:
+ <para>The mode parameter is the mode in which spellchecker will work.
+ There are several modes available:
<itemizedlist>
<listitem>
+ <simpara>
+ PSPELL_FAST - Fast mode (least number of suggestions)
+ </simpara>
+ </listitem>
+ <listitem>
<simpara>
- PSPELL_FAST - Fast mode (least number of suggestions)
+ PSPELL_NORMAL - Normal mode (more suggestions)
</simpara>
</listitem>
<listitem>
<simpara>
- PSPELL_NORMAL - Normal mode (more suggestions)
+ PSPELL_BAD_SPELLERS - Slow mode (a lot of suggestions)
</simpara>
</listitem>
<listitem>
<simpara>
- PSPELL_BAD_SPELLERS - Slow mode (a lot of suggestions)
+ PSPELL_RUN_TOGETHER - Consider run-together words as legal compounds.
+ That is, "thecat" will be a legal compound, athough there should be a
+ space between the two words. Changing this setting only affects the
+ results returned by
+ <function>pspell_check</function>;
+ <function>pspell_suggest</function> will still return suggestions.
</simpara>
</listitem>
</itemizedlist>
- </para>
- <para>
- <example>
- <title><function>Pspell_mode</function></title>
- <programlisting role="php">
-$pspell_link = pspell_new ("english");
-pspell_mode (PSPELL_FAST);
-
-if (!pspell_check ($pspell_link, "testt")) {
- $suggestions = pspell_suggest ($pspell_link, "testt");
-}
- </programlisting>
- </example>
- </para>
- </refsect1>
- </refentry>
-
- <refentry id="function.pspell-runtogether">
- <refnamediv>
- <refname>pspell_runtogether</refname>
- <refpurpose>
- Consider run-together words as legal compounds
- </refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <funcsynopsis>
- <funcprototype>
- <funcdef>boolean <function>pspell_runtogether</function></funcdef>
- <paramdef>int <parameter>dictionary_link</parameter></paramdef>
- <paramdef>int <parameter>mode</parameter></paramdef>
- </funcprototype>
- </funcsynopsis>
- <simpara>
- <function>Pspell_runtogether</function> Consider run-together
- words as legal compounds. That is, "thecat" will be a legal
- compound, athough there should be a space between the two
- words. Changing this setting only affects the results returned by
- <function>pspell_check</function>;
- <function>pspell_suggest</function> will still return
- suggestions, and they are not affected by the calls to
- <function>php_runtogether</function>.
- </simpara>
+ Mode is a bitmask constructed from different constants listed above.
+ However, PSPELL_FAST, PSPELL_NORMAL and PSPELL_BAD_SPELLERS are mutually
+ exclusive, so you should select only one of them.
+ </para>
+ <para>
+ For more information and examples, check out inline manual pspell
+ website:<ulink url="&url.pspell;">&url.pspell;</ulink>.
+ </para>
<para>
<example>
- <title><function>Pspell_runtogether</function></title>
+ <title><function>Pspell_new</function></title>
<programlisting role="php">
-$pspell_link = pspell_new ("english");
-pspell_runtogether (true);
-echo pspell_runtogether ($pspell_link, "thecat") ? "correct" : "wrong";
+$pspell_link = pspell_new ("en", "", "", "", (PSPELL_FAST | PSPELL_RUN_TOGETHER));
</programlisting>
</example>
</para>
@@ -186,7 +142,7 @@
<example>
<title><function>Pspell_check</function></title>
<programlisting role="php">
-$pspell_link = pspell_new ("english");
+$pspell_link = pspell_new ("en");
if (pspell_check ($pspell_link, "testt")) {
echo "This is a valid spelling";
@@ -221,7 +177,7 @@
<example>
<title><function>Pspell_suggest</function></title>
<programlisting role="php">
-$pspell_link = pspell_new ("english");
+$pspell_link = pspell_new ("en");
if (!pspell_check ($pspell_link, "testt")){
$suggestions = pspell_suggest ($pspell_link, "testt");
- Next message: Vlad Krupin: "[PHP-DOC] cvs: phpdoc /en/functions aspell.xml"
- Previous message: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions pcre.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

