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