Sonnet::Speller

Search for usage in LXR

Sonnet::Speller Class Reference

#include <Sonnet/Speller>

Public Types

enum  Attribute { CheckUppercase , SkipRunTogether , AutoDetectLanguage }
 

Public Member Functions

 Speller (const QString &lang=QString())
 
 Speller (const Speller &speller)
 
bool addToPersonal (const QString &word)
 
bool addToSession (const QString &word)
 
QStringList availableBackends () const
 
QMap< QString, QStringavailableDictionaries () const
 
QStringList availableLanguageNames () const
 
QStringList availableLanguages () const
 
bool checkAndSuggest (const QString &word, QStringList &suggestions) const
 
QString defaultClient () const
 
QString defaultLanguage () const
 
bool isCorrect (const QString &word) const
 
bool isMisspelled (const QString &word) const
 
bool isValid () const
 
QString language () const
 
Spelleroperator= (const Speller &speller)
 
QMap< QString, QStringpreferredDictionaries () const
 
void restore ()
 
void save ()
 
void setAttribute (Attribute attr, bool b=true)
 
void setDefaultClient (const QString &client)
 
void setDefaultLanguage (const QString &lang)
 
void setLanguage (const QString &lang)
 
bool storeReplacement (const QString &bad, const QString &good)
 
QStringList suggest (const QString &word) const
 
bool testAttribute (Attribute attr) const
 

Detailed Description

Spell checker object.

class used for actual spell checking

Definition at line 27 of file speller.h.

Member Enumeration Documentation

◆ Attribute

enum Sonnet::Speller::Attribute

Definition at line 96 of file speller.h.

Constructor & Destructor Documentation

◆ Speller() [1/2]

Sonnet::Speller::Speller ( const QString & lang = QString())
explicit

Definition at line 66 of file speller.cpp.

◆ ~Speller()

Sonnet::Speller::~Speller ( )

Definition at line 72 of file speller.cpp.

◆ Speller() [2/2]

Sonnet::Speller::Speller ( const Speller & speller)

Definition at line 77 of file speller.cpp.

Member Function Documentation

◆ addToPersonal()

bool Sonnet::Speller::addToPersonal ( const QString & word)

Adds word to the list of of personal words.

Returns
true on success

Definition at line 131 of file speller.cpp.

◆ addToSession()

bool Sonnet::Speller::addToSession ( const QString & word)

Adds word to the words recognizable in the current session.

Returns
true on success

Definition at line 139 of file speller.cpp.

◆ availableBackends()

QStringList Sonnet::Speller::availableBackends ( ) const
Returns
names of all supported backends (e.g. ISpell, ASpell)

Definition at line 170 of file speller.cpp.

◆ availableDictionaries()

QMap< QString, QString > Sonnet::Speller::availableDictionaries ( ) const
Returns
a map of all available dictionaries with language descriptions and their codes. The key is the description, the code the value.

Definition at line 252 of file speller.cpp.

◆ availableLanguageNames()

QStringList Sonnet::Speller::availableLanguageNames ( ) const
Returns
a localized list of names of supported languages.

Note: use availableDictionaries

Definition at line 182 of file speller.cpp.

◆ availableLanguages()

QStringList Sonnet::Speller::availableLanguages ( ) const
Returns
a list of supported languages.

Note: use availableDictionaries

Definition at line 176 of file speller.cpp.

◆ checkAndSuggest()

bool Sonnet::Speller::checkAndSuggest ( const QString & word,
QStringList & suggestions ) const

Convenience method calling isCorrect() and suggest() if the word isn't correct.

Definition at line 115 of file speller.cpp.

◆ defaultClient()

QString Sonnet::Speller::defaultClient ( ) const

Definition at line 207 of file speller.cpp.

◆ defaultLanguage()

QString Sonnet::Speller::defaultLanguage ( ) const

Definition at line 195 of file speller.cpp.

◆ isCorrect()

bool Sonnet::Speller::isCorrect ( const QString & word) const

Checks the given word.

Returns
false if the word is misspelled. true otherwise

Definition at line 91 of file speller.cpp.

◆ isMisspelled()

bool Sonnet::Speller::isMisspelled ( const QString & word) const

Checks the given word.

Returns
true if the word is misspelled. false otherwise

Definition at line 99 of file speller.cpp.

◆ isValid()

bool Sonnet::Speller::isValid ( ) const
Returns
true if the speller supports currently selected language.

Definition at line 241 of file speller.cpp.

◆ language()

QString Sonnet::Speller::language ( ) const
Returns
language supported by this speller.

Definition at line 147 of file speller.cpp.

◆ operator=()

Speller & Sonnet::Speller::operator= ( const Speller & speller)

Definition at line 84 of file speller.cpp.

◆ preferredDictionaries()

QMap< QString, QString > Sonnet::Speller::preferredDictionaries ( ) const
Returns
a map of user preferred dictionaries with language descriptions and their codes. The key is the description, the code the value.
Since
5.54

Definition at line 265 of file speller.cpp.

◆ restore()

void Sonnet::Speller::restore ( )

Definition at line 162 of file speller.cpp.

◆ save()

void Sonnet::Speller::save ( )

Definition at line 155 of file speller.cpp.

◆ setAttribute()

void Sonnet::Speller::setAttribute ( Attribute attr,
bool b = true )

Definition at line 212 of file speller.cpp.

◆ setDefaultClient()

void Sonnet::Speller::setDefaultClient ( const QString & client)

Definition at line 200 of file speller.cpp.

◆ setDefaultLanguage()

void Sonnet::Speller::setDefaultLanguage ( const QString & lang)

Definition at line 188 of file speller.cpp.

◆ setLanguage()

void Sonnet::Speller::setLanguage ( const QString & lang)

Sets the language supported by this speller.

Definition at line 246 of file speller.cpp.

◆ storeReplacement()

bool Sonnet::Speller::storeReplacement ( const QString & bad,
const QString & good )

Stores user defined good replacement for the bad word.

Returns
true on success

Definition at line 123 of file speller.cpp.

◆ suggest()

QStringList Sonnet::Speller::suggest ( const QString & word) const

Fetches suggestions for the word.

Returns
list of all suggestions for the word

Definition at line 107 of file speller.cpp.

◆ testAttribute()

bool Sonnet::Speller::testAttribute ( Attribute attr) const

Definition at line 228 of file speller.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Mar 28 2025 11:59:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.