rcube_spellchecker

Helper class for spellchecking with Googielspell and PSpell support.

package

Framework

subpackage

Utils

Methods

Constructor

__construct(string $lang = 'en') 

Arguments

$lang

string

Language code

Return a list of supported languages

languages() 

Set content and check spelling

check(string $text, bool $is_html = false) : bool

Arguments

$text

string

Text content for spellchecking

$is_html

bool

Enables HTML-to-Text conversion

Response

bool

True when no mispelling found, otherwise false

Number of mispellings found (after check)

found() : int

Response

int

Number of mispellings

Returns suggestions for the specified word

get_suggestions(string $word) : array

Arguments

$word

string

The word

Response

array

Suggestions list

Returns misspelled words

get_words(string $text = null, $is_html = false) : array

Arguments

$text

string

The content for spellchecking. If empty content

                used for check() method will be used.

$is_html

Response

array

List of misspelled words

Returns checking result in XML (Googiespell) format

get_xml() : string

Response

string

XML content

Returns checking result (misspelled words with suggestions)

get() : array

Response

array

Spellchecking result. An array indexed by word.

Returns error message

error() : string

Response

string

Error message

html2text

html2text($text) 

Arguments

$text

Check if the specified word is an exception accoring to spellcheck options.

is_exception(string $word) : bool

Arguments

$word

string

The word

Response

bool

True if the word is an exception, False otherwise

Add a word to dictionary

add_word(string $word) 

Arguments

$word

string

The word to add

Remove a word from dictionary

remove_word(string $word) 

Arguments

$word

string

The word to remove

Update dictionary row in DB

update_dict() 

Get dictionary from DB

load_dict() 

Properties

matches

matches : 

engine

engine : 

backend

backend : 

lang

lang : 

rc

rc : 

error

error : 

options

options : 

dict

dict : 

have_dict

have_dict :