Moodle PHP Documentation 4.1
Moodle 4.1dev (Build: 20220512) (5e5e12e0)
Public Member Functions | List of all members
SpellChecker Class Reference
Inheritance diagram for SpellChecker:
EnchantSpell GoogleSpell PSpell PSpellShell

Public Member Functions

 __construct (&$config)
 Constructor. More...
 
checkWords ($lang, $words)
 Spellchecks an array of words. More...
 
getSuggestions ($lang, $word)
 Returns suggestions of for a specific word. More...
 
loopback ()
 Simple loopback function everything that gets in will be send back. More...
 
 SpellChecker (&$config)
 Old syntax of class constructor. More...
 
 throwError ($str)
 Throws an error message back to the user. More...
 

Constructor & Destructor Documentation

◆ __construct()

SpellChecker::__construct ( $config)

Constructor.

Parameters
$configConfiguration name/value array.

Member Function Documentation

◆ checkWords()

& SpellChecker::checkWords (   $lang,
  $words 
)

Spellchecks an array of words.

Parameters
{String}$lang Language code like sv or en.
{Array}$words Array of words to spellcheck.
Return values
{Array}Array of misspelled words.

Reimplemented in EnchantSpell, GoogleSpell, PSpell, and PSpellShell.

◆ getSuggestions()

& SpellChecker::getSuggestions (   $lang,
  $word 
)

Returns suggestions of for a specific word.

Parameters
{String}$lang Language code like sv or en.
{String}$word Specific word to get suggestions for.
Return values
{Array}Array of suggestions for the specified word.

Reimplemented in EnchantSpell, GoogleSpell, PSpell, and PSpellShell.

◆ loopback()

& SpellChecker::loopback ( )

Simple loopback function everything that gets in will be send back.

Parameters
$args..Arguments.
Return values
{Array}Array of all input arguments.

◆ SpellChecker()

SpellChecker::SpellChecker ( $config)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ throwError()

SpellChecker::throwError (   $str)

Throws an error message back to the user.

This will stop all execution.

Parameters
{String}$str Message to send back to user.

The documentation for this class was generated from the following file: