Sonnet.Speller

KDE 4.2 PyKDE API Reference

- KDE's Python API

# Speller Class Reference

`from PyKDE4.kdecore import *`

Namespace: Sonnet

## Detailed Description

Spell checker object.

class used for actuall spell checking

## Enumerations
Attribute | { CheckUppercase, SkipRunTogether }
## Methods
| __init__ (self, QString lang=QString())
| __init__ (self, Sonnet.Speller speller)
bool | addToPersonal (self, QString word)
bool | addToSession (self, QString word)
QStringList | availableBackends (self)
QMap | availableDictionaries (self)
QStringList | availableLanguageNames (self)
QStringList | availableLanguages (self)
bool | checkAndSuggest (self, QString word, QStringList suggestions)
QString | defaultClient (self)
QString | defaultLanguage (self)
bool | isCorrect (self, QString word)
bool | isMisspelled (self, QString word)
bool | isValid (self)
QString | language (self)
| restore (self, KConfig config)
| save (self, KConfig config)
| setAttribute (self, Sonnet.Speller.Attribute attr, bool b=1)
| setDefaultClient (self, QString client)
| setDefaultLanguage (self, QString lang)
| setLanguage (self, QString lang)
bool | storeReplacement (self, QString bad, QString good)
QStringList | suggest (self, QString word)
bool | testAttribute (self, Sonnet.Speller.Attribute attr)

## Method Documentation

__init__ | ( | self, |
|  | QString | lang=QString()
| ) |  |  |

__init__ | ( | self, |
|  | Sonnet.Speller | speller
| ) |  |  |

bool addToPersonal | ( | self, |
|  | QString | word
| ) |  |  |

Adds word to the list of of personal words.

Returns:
  true on success

bool addToSession | ( | self, |
|  | QString | word
| ) |  |  |

Adds word to the words recognizable in the current session.

Returns:
  true on success

QStringList availableBackends | ( |  | self ) |

Returns names of all supported backends (e.g. ISpell, ASpell)

QMap availableDictionaries | ( |  | self ) |

Returns a map of all available language descriptions and their codes

QStringList availableLanguageNames | ( |  | self ) |

Returns a localized list of names of supported languages.

Note: use availableDictionaries

QStringList availableLanguages | ( |  | self ) |

Returns a list of supported languages.

Note: use availableDictionaries

bool checkAndSuggest | ( | self, |
|  | QString | word,
|  | QStringList | suggestions
| ) |  |  |

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

QString defaultClient | ( |  | self ) |

QString defaultLanguage | ( |  | self ) |

bool isCorrect | ( | self, |
|  | QString | word
| ) |  |  |

Checks the given word.

Returns:
  false if the word is misspelled. true otherwise

bool isMisspelled | ( | self, |
|  | QString | word
| ) |  |  |

Checks the given word.

Returns:
  true if the word is misspelled. false otherwise

bool isValid | ( |  | self ) |

Returns true is the speller supports currently selected language.

QString language | ( |  | self ) |

Returns language supported by this speller.

restore | ( | self, |
|  | KConfig | config
| ) |  |  |

save | ( | self, |
|  | KConfig | config
| ) |  |  |

setAttribute | ( | self, |
|  | Sonnet.Speller.Attribute | attr,
|  | bool | b=1
| ) |  |  |

setDefaultClient | ( | self, |
|  | QString | client
| ) |  |  |

setDefaultLanguage | ( | self, |
|  | QString | lang
| ) |  |  |

setLanguage | ( | self, |
|  | QString | lang
| ) |  |  |

Sets the language supported by this speller.

bool storeReplacement | ( | self, |
|  | QString | bad,
|  | QString | good
| ) |  |  |

Stores user defined good replacement for the bad word.

Returns:
  true on success

QStringList suggest | ( | self, |
|  | QString | word
| ) |  |  |

Fetches suggestions for the word.

Returns:
  list of all suggestions for the word

bool testAttribute | ( | self, |
|  | Sonnet.Speller.Attribute | attr
| ) |  |  |

## Enumeration Documentation

Attribute

Enumerator:

  CheckUppercase |
  SkipRunTogether |