class HunSpellProvider implements SpellProvider (View source)

Implements spellcheck using the hunspell library

Properties

Methods

protected
int
invoke(string $locale, string $input, string $stdout, string $stderr)

Invoke hunspell library

protected
array
getResults(string $locale, array $words)

Get results from hunspell

public
array
checkWords(string $locale, array $words)

Spellchecks an array of words.

public
array
getSuggestions(string $locale, string $word)

Returns suggestions of for a specific word.

Details

protected int invoke(string $locale, string $input, string $stdout, string $stderr)

Invoke hunspell library

Parameters

string $locale
string $input

Input text

string $stdout output
string $stderr error

Return Value

int

Exit code

protected array getResults(string $locale, array $words)

Get results from hunspell

Parameters

string $locale
array $words

Return Value

array

List of incorrect words, each with their list of suggestions

Exceptions

SpellException

array checkWords(string $locale, array $words)

Spellchecks an array of words.

Parameters

string $locale

Locale code to check

array $words

List of words to spellcheck.

Return Value

array

List of misspelled words.

array getSuggestions(string $locale, string $word)

Returns suggestions of for a specific word.

Parameters

string $locale

Locale code to check

string $word

Specific word to get suggestions for.

Return Value

array

List of suggestions for the specified word.