Spelling.Checker

g GObject.Object GObject.Object Spelling.Checker Spelling.Checker GObject.Object->Spelling.Checker

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_default ()

class

new (provider, language)

add_word (word)

check_word (word, word_len)

get_extra_word_chars ()

get_language ()

get_provider ()

ignore_word (word)

list_corrections (word)

set_language (language)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

language

str

r/w/en

The language code

provider

Spelling.Provider

r/w/co

The spell check provider

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Spelling.Checker(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Spelling.CheckerClass

classmethod get_default()
Returns:

a Spelling.Checker

Return type:

Spelling.Checker

Gets a default Spelling.Checker using the default provider and language.

classmethod new(provider, language)
Parameters:
Returns:

a newly created Spelling.Checker

Return type:

Spelling.Checker

Create a new Spelling.Checker.

add_word(word)
Parameters:

word (str) –

check_word(word, word_len)
Parameters:
  • word (str) –

  • word_len (int) –

Return type:

bool

get_extra_word_chars()
Return type:

str

get_language()
Returns:

a string describing the current language.

Return type:

str or None

Gets the language being used by the spell checker.

get_provider()
Returns:

an Spelling.Provider

Return type:

Spelling.Provider

Gets the spell provider used by the spell checker.

Currently, only Enchant-2 is supported.

ignore_word(word)
Parameters:

word (str) –

list_corrections(word)
Parameters:

word (str) – a word to be checked

Returns:

A list of possible corrections, or None.

Return type:

[str] or None

Retrieves a list of possible corrections for word.

set_language(language)
Parameters:

language (str) – the language to use

Sets the language code to use when communicating with the provider, such as en_US.

Property Details

Spelling.Checker.props.language
Name:

language

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The “language” to use when checking words with the configured Spelling.Provider. For example, en_US.

Spelling.Checker.props.provider
Name:

provider

Type:

Spelling.Provider

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The “provider” property contains the provider that is providing information to the spell checker.

Currently, only Enchant is supported, and requires using the #SpellingEnchantProvider. Setting this to None will get the default provider.