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

Add a word to dictionary

add_word(string $word) 

Arguments

$word

string

The word to add

Set content and check spelling

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

Arguments

$text

string

Text content for spellchecking

$is_html

boolean

Enables HTML-to-Text conversion

Response

boolean

True when no mispelling found, otherwise false

Returns error message

error() : string

Response

string

Error message

Number of mispellings found (after check)

found() : integer

Response

integer

Number of mispellings

Returns checking result (misspelled words with suggestions)

get() : array

Response

array

Spellchecking result. An array indexed by word.

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

html2text

html2text( $text) 

Arguments

$text

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

is_exception(string $word) : boolean

Arguments

$word

string

The word

Response

boolean

True if the word is an exception, False otherwise

Return a list of supported languages

languages() 

Get dictionary from DB

load_dict() 

Remove a word from dictionary

remove_word(string $word) 

Arguments

$word

string

The word to remove

Update dictionary row in DB

update_dict() 

Properties

matches

matches : 

Type(s)

engine

engine : 

Type(s)

backend

backend : 

Type(s)

lang

lang : 

Type(s)

rc

rc : 

Type(s)

error

error : 

Type(s)

options

options : 

Type(s)

dict

dict : 

Type(s)

have_dict

have_dict : 

Type(s)