3 * Tiny Spelling Interface for TinyMCE Spell Checking.
5 * Copyright © 2006 Moxiecode Systems AB
20 function TinyPSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
24 $this->errorMsg = array();
26 if (!function_exists("pspell_new")) {
27 $this->errorMsg[] = "PSpell not found.";
31 $this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode);
34 // Returns array with bad words or false if failed.
35 function checkWords($wordArray) {
37 $this->errorMsg[] = "No PSpell link found for checkWords.";
42 foreach($wordArray as $word) {
43 if(!pspell_check($this->plink, trim($word)))
50 // Returns array with suggestions or false if failed.
51 function getSuggestion($word) {
53 $this->errorMsg[] = "No PSpell link found for getSuggestion.";
57 return pspell_suggest($this->plink, $word);
61 // Setup classname, should be the same as the name of the spellchecker class
62 $spellCheckerConfig['class'] = "TinyPspell";