spelling

package
v0.0.0-...-a9edc40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

GType values.

View Source
var (
	GTypeDictionary = coreglib.Type(C.spelling_dictionary_get_type())
)

GType values.

GType values.

GType values.

View Source
var (
	GTypeTextBufferAdapter = coreglib.Type(C.spelling_text_buffer_adapter_get_type())
)

GType values.

Functions

func Init

func Init()

Init: call this function before using any other libspelling functions in your applications. It will initialize everything needed to operate the library.

Types

type Checker

type Checker struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Checker: SpellingChecker is the core class of libspelling. It provides high-level APIs for spellchecking.

func CheckerGetDefault

func CheckerGetDefault() *Checker

CheckerGetDefault gets a default SpellingChecker using the default provider and language.

The function returns the following values:

  • checker: SpellingChecker.

func NewChecker

func NewChecker(provider Providerer, language string) *Checker

NewChecker: create a new SpellingChecker.

The function takes the following parameters:

  • provider
  • language

The function returns the following values:

  • checker: newly created SpellingChecker.

func (*Checker) AddWord

func (self *Checker) AddWord(word string)

AddWord adds word to the active dictionary.

The function takes the following parameters:

  • word to be added.

func (*Checker) CheckWord

func (self *Checker) CheckWord(word string) bool

CheckWord checks if the active dictionary contains word.

The function takes the following parameters:

  • word to be checked.

The function returns the following values:

  • ok: TRUE if the dictionary contains the word.

func (*Checker) ExtraWordChars

func (self *Checker) ExtraWordChars() string

ExtraWordChars gets the extra word characters of the active dictionary.

The function returns the following values:

  • utf8: extra word characters.

func (*Checker) IgnoreWord

func (self *Checker) IgnoreWord(word string)

IgnoreWord requests the active dictionary to ignore word.

The function takes the following parameters:

  • word to be ignored.

func (*Checker) Language

func (self *Checker) Language() string

Language gets the language being used by the spell checker.

The function returns the following values:

  • utf8 (optional): string describing the current language.

func (*Checker) ListCorrections

func (self *Checker) ListCorrections(word string) []string

ListCorrections retrieves a list of possible corrections for word.

The function takes the following parameters:

  • word to be checked.

The function returns the following values:

  • utf8s (optional): A list of possible corrections, or NULL.

func (*Checker) Provider

func (self *Checker) Provider() Providerer

Provider gets the spell provider used by the spell checker.

Currently, only Enchant-2 is supported.

The function returns the following values:

  • provider: SpellingProvider.

func (*Checker) SetLanguage

func (self *Checker) SetLanguage(language string)

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

The function takes the following parameters:

  • language to use.

type CheckerClass

type CheckerClass struct {
	// contains filtered or unexported fields
}

CheckerClass: instance of this type is always passed by reference.

type CheckerOverrides

type CheckerOverrides struct {
}

CheckerOverrides contains methods that are overridable.

type Dictionarier

type Dictionarier interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Dictionarier describes types inherited from class Dictionary.

To get the original type, the caller must assert this to an interface or another type.

type Dictionary

type Dictionary struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Dictionary: abstract base class for spellchecking dictionaries.

func BaseDictionary

func BaseDictionary(obj Dictionarier) *Dictionary

BaseDictionary returns the underlying base object.

func (*Dictionary) AddWord

func (self *Dictionary) AddWord(word string)

AddWord adds word to the dictionary.

The function takes the following parameters:

  • word to be added.

func (*Dictionary) Code

func (self *Dictionary) Code() string

Code gets the language code of the dictionary, or NULL if undefined.

The function returns the following values:

  • utf8 (optional): language code of the dictionary.

func (*Dictionary) ContainsWord

func (self *Dictionary) ContainsWord(word string) bool

ContainsWord checks if the dictionary contains word.

The function takes the following parameters:

  • word to be checked.

The function returns the following values:

  • ok: TRUE if the dictionary contains the word.

func (*Dictionary) ExtraWordChars

func (self *Dictionary) ExtraWordChars() string

ExtraWordChars gets the extra word characters of the dictionary.

The function returns the following values:

  • utf8: extra word characters.

func (*Dictionary) IgnoreWord

func (self *Dictionary) IgnoreWord(word string)

IgnoreWord requests the dictionary to ignore word.

The function takes the following parameters:

  • word to be ignored.

func (*Dictionary) ListCorrections

func (self *Dictionary) ListCorrections(word string) []string

ListCorrections retrieves a list of possible corrections for word.

The function takes the following parameters:

  • word to be checked.

The function returns the following values:

  • utf8s (optional): A list of possible corrections, or NULL.

type Language

type Language struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Language represents a spellchecking language.

func (*Language) Code

func (self *Language) Code() string

Code gets the code of the language, or NULL if undefined.

The function returns the following values:

  • utf8 (optional): code of the language.

func (*Language) Group

func (self *Language) Group() string

Group gets the group of the language, or NULL if undefined.

The function returns the following values:

  • utf8 (optional): group of the language.

func (*Language) Name

func (self *Language) Name() string

Name gets the name of the language, or NULL if undefined.

The function returns the following values:

  • utf8 (optional): name of the language.

type LanguageClass

type LanguageClass struct {
	// contains filtered or unexported fields
}

LanguageClass: instance of this type is always passed by reference.

type LanguageOverrides

type LanguageOverrides struct {
}

LanguageOverrides contains methods that are overridable.

type Provider

type Provider struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Provider: abstract base class for spellchecking providers.

func BaseProvider

func BaseProvider(obj Providerer) *Provider

BaseProvider returns the underlying base object.

func (*Provider) DefaultCode

func (self *Provider) DefaultCode() string

DefaultCode gets the default language code for the detected system locales, or NULL if the provider doesn't support any of them.

The function returns the following values:

  • utf8 (optional): default language code.

func (*Provider) DisplayName

func (self *Provider) DisplayName() string

DisplayName gets the display name of the provider, or NULL if undefined.

The function returns the following values:

  • utf8 (optional): display name of the provider.

func (*Provider) ListLanguages

func (self *Provider) ListLanguages() *gio.ListModel

ListLanguages gets a GListModel of languages supported by the provider.

The function returns the following values:

  • listModel: GListModel of SpellingLanguage.

func (*Provider) LoadDictionary

func (self *Provider) LoadDictionary(language string) Dictionarier

LoadDictionary gets a SpellingDictionary for the requested language, or NULL if the language is not supported.

The function takes the following parameters:

  • language to load such as en_US.

The function returns the following values:

  • dictionary (optional): SpellingDictionary or NULL.

func (*Provider) SupportsLanguage

func (self *Provider) SupportsLanguage(language string) bool

SupportsLanguage checks of language is supported by the provider.

The function takes the following parameters:

  • language such as en_US.

The function returns the following values:

  • ok: TRUE if language is supported, otherwise FALSE.

type Providerer

type Providerer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Providerer describes types inherited from class Provider.

To get the original type, the caller must assert this to an interface or another type.

func ProviderGetDefault

func ProviderGetDefault() Providerer

ProviderGetDefault gets the default spell provider.

The function returns the following values:

  • provider: SpellingProvider.

type TextBufferAdapter

type TextBufferAdapter struct {
	*coreglib.Object

	gio.ActionGroup
	// contains filtered or unexported fields
}

TextBufferAdapter: SpellingTextBufferAdapter implements helpers to easily add spellchecking capabilities to a GtkSourceBuffer.

func NewTextBufferAdapter

func NewTextBufferAdapter(buffer *gtksource.Buffer, checker *Checker) *TextBufferAdapter

NewTextBufferAdapter: create a new SpellingTextBufferAdapter.

The function takes the following parameters:

  • buffer: GtkSourceBuffer.
  • checker: SpellingChecker.

The function returns the following values:

  • textBufferAdapter: newly created SpellingTextBufferAdapter.

func (*TextBufferAdapter) Buffer

func (self *TextBufferAdapter) Buffer() *gtksource.Buffer

Buffer gets the underlying buffer for the adapter.

The function returns the following values:

  • buffer (optional): GtkSourceBuffer.

func (*TextBufferAdapter) Checker

func (self *TextBufferAdapter) Checker() *Checker

Checker gets the checker used by the adapter.

The function returns the following values:

  • checker (optional): SpellingChecker or NULL.

func (*TextBufferAdapter) Enabled

func (self *TextBufferAdapter) Enabled() bool

Enabled gets if the spellcheck is enabled.

The function returns the following values:

  • ok: TRUE if enabled.

func (*TextBufferAdapter) InvalidateAll

func (self *TextBufferAdapter) InvalidateAll()

InvalidateAll: invalidate the spelling engine, to force parsing again.

Invalidation is automatically done on gtksource.Buffer:loading change.

func (*TextBufferAdapter) Language

func (self *TextBufferAdapter) Language() string

Language gets the checker language.

The function returns the following values:

  • utf8 (optional): language code.

func (*TextBufferAdapter) MenuModel

func (self *TextBufferAdapter) MenuModel() gio.MenuModeller

MenuModel gets the menu model containing corrections.

The function returns the following values:

  • menuModel: GMenuModel.

func (*TextBufferAdapter) SetChecker

func (self *TextBufferAdapter) SetChecker(checker *Checker)

SetChecker: set the spelling.Checker used for spellchecking.

The function takes the following parameters:

  • checker: SpellingChecker.

func (*TextBufferAdapter) SetEnabled

func (self *TextBufferAdapter) SetEnabled(enabled bool)

SetEnabled: if TRUE spellcheck is enabled.

The function takes the following parameters:

  • enabled: whether the spellcheck is enabled.

func (*TextBufferAdapter) SetLanguage

func (self *TextBufferAdapter) SetLanguage(language string)

SetLanguage sets the language code to use by the checker, such as en_US.

The function takes the following parameters:

  • language to use.

func (*TextBufferAdapter) Tag

func (self *TextBufferAdapter) Tag() *gtk.TextTag

Tag gets the tag used for potentially misspelled words.

The function returns the following values:

  • textTag (optional): GtkTextTag or NULL.

func (*TextBufferAdapter) UpdateCorrections

func (self *TextBufferAdapter) UpdateCorrections()

UpdateCorrections looks at the current cursor position and updates the list of corrections based on the current word.

Use this to force an update immediately rather than after the automatic timeout caused by cursor movements.

type TextBufferAdapterClass

type TextBufferAdapterClass struct {
	// contains filtered or unexported fields
}

TextBufferAdapterClass: instance of this type is always passed by reference.

type TextBufferAdapterOverrides

type TextBufferAdapterOverrides struct {
}

TextBufferAdapterOverrides contains methods that are overridable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL