| | |
| | | <?php |
| | | |
| | | /* |
| | | /** |
| | | +-----------------------------------------------------------------------+ |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2011-2013, Kolab Systems AG | |
| | |
| | | { |
| | | $this->rc = rcube::get_instance(); |
| | | $this->engine = $this->rc->config->get('spellcheck_engine', 'googie'); |
| | | $this->lang = $lang ? $lang : 'en'; |
| | | $this->lang = $lang ?: 'en'; |
| | | |
| | | $this->options = array( |
| | | 'ignore_syms' => $this->rc->config->get('spellcheck_ignore_syms'), |
| | |
| | | return $this->found() == 0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Number of mispellings found (after check) |
| | | * |
| | |
| | | { |
| | | return count($this->matches); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns suggestions for the specified word |
| | |
| | | |
| | | return array(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns misspelled words |
| | |
| | | return array(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns checking result in XML (Googiespell) format |
| | | * |
| | |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns checking result (misspelled words with suggestions) |
| | |
| | | return $result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns error message |
| | | * |
| | |
| | | */ |
| | | function error() |
| | | { |
| | | return $this->error ? $this->error : ($this->backend ? $this->backend->error() : false); |
| | | return $this->error ?: ($this->backend ? $this->backend->error() : false); |
| | | } |
| | | |
| | | |
| | | private function html2text($text) |
| | | { |
| | | $h2t = new rcube_html2text($text, false, true, 0); |
| | | $h2t = new rcube_html2text($text, false, false, 0); |
| | | return $h2t->get_text(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Check if the specified word is an exception accoring to |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Add a word to dictionary |
| | | * |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Remove a word from dictionary |
| | | * |
| | |
| | | $this->update_dict(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Update dictionary row in DB |
| | |
| | | $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary'])); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get dictionary from DB |