#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_path | path to dictionary |
user_dictionary | path 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:
-
word | word 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:
-
word | word 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:
-
word | word 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:
-
word | Base for suggestions. |
limit | Suggestion 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: