[PHP-DOC] cvs: phpdoc / global.ent manual.xml.in /en chapters.ent /en/functions pspell.xml From: Vlad Krupin (phpdevel <email protected>)
Date: 07/14/00

vlad Fri Jul 14 14:32:54 2000 EDT

  Added files:
    /phpdoc/en/functions pspell.xml

  Modified files:
    /phpdoc global.ent manual.xml.in
    /phpdoc/en chapters.ent
  Log:
  Added documentation for PSPELL module
  
  
  
Index: phpdoc/global.ent
diff -u phpdoc/global.ent:1.34 phpdoc/global.ent:1.35
--- phpdoc/global.ent:1.34 Wed Jul 12 15:15:32 2000
+++ phpdoc/global.ent Fri Jul 14 14:32:53 2000
@@ -1,6 +1,6 @@
 <!-- -*- SGML -*-
 
- $Id: global.ent,v 1.34 2000/07/12 22:15:32 hirokawa Exp $
+ $Id: global.ent,v 1.35 2000/07/14 21:32:53 vlad Exp $
 
  Contains global "macros" for all the SGML documents.
 
@@ -75,6 +75,7 @@
 <!ENTITY url.php.stats "../images/phpstats-200002.gif">
 <!ENTITY url.php.snaps.manual "http://snaps.php.net/manual/">
 <!ENTITY url.pgsql "http://www.postgresql.org/">
+<!ENTITY url.pspell "http://pspell.sourceforge.net/">
 <!ENTITY url.qmail "http://www.qmail.org/">
 <!ENTITY url.rec-xml "http://www.w3.org/TR/1998/REC-xml-19980210">
 <!ENTITY url.rfc 'http://www.faqs.org/rfcs/'>
Index: phpdoc/manual.xml.in
diff -u phpdoc/manual.xml.in:1.11 phpdoc/manual.xml.in:1.12
--- phpdoc/manual.xml.in:1.11 Thu Jul 13 13:03:21 2000
+++ phpdoc/manual.xml.in Fri Jul 14 14:32:53 2000
@@ -132,6 +132,7 @@
   &reference.info;
   &reference.posix;
   &reference.pgsql;
+ &reference.pspell;
   &reference.exec;
   &reference.recode;
   &reference.pcre;
Index: phpdoc/en/chapters.ent
diff -u phpdoc/en/chapters.ent:1.7 phpdoc/en/chapters.ent:1.8
--- phpdoc/en/chapters.ent:1.7 Thu Jul 13 13:03:21 2000
+++ phpdoc/en/chapters.ent Fri Jul 14 14:32:53 2000
@@ -76,6 +76,7 @@
 <!ENTITY reference.recode SYSTEM "functions/recode.xml">
 <!ENTITY reference.info SYSTEM "functions/info.xml">
 <!ENTITY reference.pgsql SYSTEM "functions/pgsql.xml">
+<!ENTITY reference.pspell SYSTEM "functions/pspell.xml">
 <!ENTITY reference.regex SYSTEM "functions/regex.xml">
 <!ENTITY reference.sem SYSTEM "functions/sem.xml">
 <!ENTITY reference.session SYSTEM "functions/session.xml">

Index: phpdoc/en/functions/pspell.xml
+++ phpdoc/en/functions/pspell.xml
 <reference id="ref.pspell">
  <title>Pspell functions</title>
  <titleabbrev>Pspell</titleabbrev>

  <partintro>
   <simpara>
    The <function>pspell</function> functions allows you to check the
    spelling on a word and offer suggestions.
   </simpara>
   <simpara>
    You need the aspell and pspell libraries, available from: <ulink
    url="&url.pspell;">&url.pspell;</ulink>.
   </simpara>
  </partintro>

  <refentry id="function.pspell_new">
   <refnamediv>
    <refname>pspell_new</refname>
    <refpurpose>Load a new dictionary</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>pspell_new</function></funcdef>
      <paramdef>string <parameter>language</parameter></paramdef>
      <paramdef>string
       <parameter>
        <optional>spelling</optional>
       </parameter>
      </paramdef>
      <paramdef>string
       <parameter>
        <optional>jargon</optional>
       </parameter>
      </paramdef>
      <paramdef>string
       <parameter>
        <optional>encoding</optional>
       </parameter>
      </paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>Pspell_new</function> opens up a new dictionary and
     returns the dictionary link identifier for use in other pspell
     functions.</simpara>
    <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>.
        </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:
     <itemizedlist>
      <listitem>
       <simpara>
        PSPELL_FAST - Fast mode (least number of suggestions)
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        PSPELL_NORMAL - Normal mode (more suggestions)
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        PSPELL_BAD_SPELLERS - Slow mode (a lot of suggestions)
       </simpara>
      </listitem>
     </itemizedlist>
    </para>
    <para>
     <example>
      <title><function>Pspell_mode</function></title>
      <programlisting>
$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 pspell_check(); pspell_suggest()
         will still return suggestions, and they are not affected by the calls
         to php_runtogether().
    </simpara>
    <para>
     <example>
      <title><function>Pspell_runtogether</function></title>
      <programlisting>
$pspell_link = pspell_new("english");
pspell_runtogether(true);
echo pspell_runtogether($pspell_link, "thecat") ? "correct" : "wrong";
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.pspell-check">
   <refnamediv>
    <refname>pspell_check</refname>
    <refpurpose>Check a word</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>boolean <function>pspell_check</function></funcdef>
      <paramdef>int <parameter>dictionary_link</parameter></paramdef>
      <paramdef>string <parameter>word</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>pspell_check</function> checks the spelling of a word
     and returns true if the spelling is correct, false if not.
    </simpara>
    <para>
     <example>
      <title><function>Pspell_check</function></title>
      <programlisting>
$pspell_link = pspell_new("english");

if(pspell_check($pspell_link, "testt")){
    echo "This is a valid spelling";
}else{
    echo "Sorry, wrong spelling";
}
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.pspell-suggest">
   <refnamediv>
    <refname>pspell_suggest</refname>
    <refpurpose>Suggest spellings of a word</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>array <function>pspell_suggest</function></funcdef>
      <paramdef>int <parameter>dictionary_link</parameter></paramdef>
      <paramdef>string <parameter>word</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>Pspell_suggest</function> returns an array of possible
     spellings for the given word.
    </simpara>
    <para>
     <example>
      <title><function>Pspell_suggest</function></title>
      <programlisting role="php">
$pspell_link = pspell_new("english");

if(!pspell_check ($pspell_link, "testt")){
    $suggestions = pspell_suggest($pspell_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:
-->