Maliit Plugins  0.92.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Private Attributes
MaliitKeyboard::Logic::SpellChecker Class Reference

#include <spellchecker.h>

List of all members.

Public Member Functions

 SpellChecker (const QString &dictionary_path=QString("/usr/share/hunspell/en_GB"), const QString &user_dictionary=QString("%1/.config/hunspell/en_GB.dic").arg(QDir::homePath()))
 ~SpellChecker ()
bool spell (const QString &word)
 Checks spelling of given word.
QStringList suggest (const QString &word, int limit=-1)
 Gives some suggestions for given word.
void ignoreWord (const QString &word)
void addToUserWordlist (const QString &word)

Private Attributes

const QScopedPointer
< SpellCheckerPrivate > 
d_ptr

Detailed Description

Checks spelling and suggest words. Currently Spellchecker is implemented by using Hunspell.


Constructor & Destructor Documentation

MaliitKeyboard::Logic::SpellChecker::SpellChecker ( const QString &  dictionary_path = QString("/usr/share/hunspell/en_GB"),
const QString &  user_dictionary = QString("%1/.config/hunspell/en_GB.dic").arg(QDir::homePath()) 
)
explicit

Creates a spellchecker using passed dictionary and extensible user dictionary.

Parameters:
dictionary_pathpath to dictionary
user_dictionarypath to user dictionary
MaliitKeyboard::Logic::SpellChecker::~SpellChecker ( )

Member Function Documentation

void MaliitKeyboard::Logic::SpellChecker::addToUserWordlist ( const QString &  word)

Adds given word to user dictionary.

Parameters:
wordword to be added to user dictionary - it will be used for spellchecking and suggesting.
void MaliitKeyboard::Logic::SpellChecker::ignoreWord ( const QString &  word)

Marks given word as ignored.

Parameters:
wordword to ignore - it will not be checked for spelling.
bool MaliitKeyboard::Logic::SpellChecker::spell ( const QString &  word)

Checks spelling of given word.

Ignored words are treated as having correct spelling.

See also:
ignoreWord
Parameters:
wordword to check for spelling.
Returns:
true if the word has correct spelling (or is ignored), otherwise false.
QStringList MaliitKeyboard::Logic::SpellChecker::suggest ( const QString &  word,
int  limit = -1 
)

Gives some suggestions for given word.

Parameters:
wordBase for suggestions.
limitSuggestion count limit (-1 for no limits).
Returns:
a list of suggestions.

Member Data Documentation

const QScopedPointer<SpellCheckerPrivate> MaliitKeyboard::Logic::SpellChecker::d_ptr
private

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