b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: main ] [ index: main ] [ all elements ]

Source for file SpellChecker.php

Documentation is available at SpellChecker.php

  1. <?php
  2. /**
  3.  * $Id: SpellChecker.php,v 1.1 2009/08/07 01:59:36 sam2kb Exp $
  4.  *
  5.  * @author Moxiecode
  6.  * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  7.  */
  8.  
  9. class SpellChecker {
  10.     /**
  11.      * Constructor.
  12.      *
  13.      * @param $config Configuration name/value array.
  14.      */
  15.     function SpellChecker(&$config{
  16.         $this->_config $config;
  17.     }
  18.  
  19.     /**
  20.      * Simple loopback function everything that gets in will be send back.
  21.      *
  22.      * @param $args.. Arguments.
  23.      * @return {Array} Array of all input arguments.
  24.      */
  25.     function &loopback(/* args.. */{
  26.         return func_get_args();
  27.     }
  28.  
  29.     /**
  30.      * Spellchecks an array of words.
  31.      *
  32.      * @param {String} $lang Language code like sv or en.
  33.      * @param {Array} $words Array of words to spellcheck.
  34.      * @return {Array} Array of misspelled words.
  35.      */
  36.     function &checkWords($lang$words{
  37.         return $words;
  38.     }
  39.  
  40.     /**
  41.      * Returns suggestions of for a specific word.
  42.      *
  43.      * @param {String} $lang Language code like sv or en.
  44.      * @param {String} $word Specific word to get suggestions for.
  45.      * @return {Array} Array of suggestions for the specified word.
  46.      */
  47.     function &getSuggestions($lang$word{
  48.         return array();
  49.     }
  50.  
  51.     /**
  52.      * Throws an error message back to the user. This will stop all execution.
  53.      *
  54.      * @param {String} $str Message to send back to user.
  55.      */
  56.     function throwError($str{
  57.         die('{"result":null,"id":null,"error":{"errstr":"' addslashes($str'","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
  58.     }
  59. }
  60.  
  61. ?>

Documentation generated on Sat, 06 Mar 2010 03:57:40 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).