1 | <?php |
||
10 | class SpellChecker { |
||
11 | /** |
||
12 | * Constructor. |
||
13 | * |
||
14 | * @param $config Configuration name/value array. |
||
15 | */ |
||
16 | function SpellChecker(&$config) { |
||
19 | |||
20 | /** |
||
21 | * Simple loopback function everything that gets in will be send back. |
||
22 | * |
||
23 | * @param $args.. Arguments. |
||
24 | * @return {Array} Array of all input arguments. |
||
25 | */ |
||
26 | function &loopback(/* args.. */) { |
||
29 | |||
30 | /** |
||
31 | * Spellchecks an array of words. |
||
32 | * |
||
33 | * @param {String} $lang Language code like sv or en. |
||
34 | * @param {Array} $words Array of words to spellcheck. |
||
35 | * @return {Array} Array of misspelled words. |
||
36 | */ |
||
37 | function &checkWords($lang, $words) { |
||
40 | |||
41 | /** |
||
42 | * Returns suggestions of for a specific word. |
||
43 | * |
||
44 | * @param {String} $lang Language code like sv or en. |
||
45 | * @param {String} $word Specific word to get suggestions for. |
||
46 | * @return {Array} Array of suggestions for the specified word. |
||
47 | */ |
||
48 | function &getSuggestions($lang, $word) { |
||
51 | |||
52 | /** |
||
53 | * Throws an error message back to the user. This will stop all execution. |
||
54 | * |
||
55 | * @param {String} $str Message to send back to user. |
||
56 | */ |
||
57 | function throwError($str) { |
||
60 | } |
||
61 | |||
63 |