libvarnam

package
v0.0.0-...-c8c7d09 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: AGPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchemeFileDirectory

func GetSchemeFileDirectory() string

GetSchemeFileDirectory returns the folder where scheme file (.vst) are stored

Types

type CorpusDetails

type CorpusDetails struct {
	WordsCount int `json:"wordsCount"`
}

CorpusDetails returns corpus details.

type LearnStatus

type LearnStatus struct {
	TotalWords int
	Failed     int
}

LearnStatus .

type SchemeDetails

type SchemeDetails struct {
	LangCode     string
	Identifier   string
	DisplayName  string
	Author       string
	CompiledDate string
	IsStable     bool
}

SchemeDetails returns language and other changes.

func GetAllSchemeDetails

func GetAllSchemeDetails() []*SchemeDetails

GetAllSchemeDetails returns all scheme related details.

type Varnam

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

Varnam app binding.

func Init

func Init(schemeIdentifier string) (*Varnam, error)

Init initializes varnam bindings.

func (*Varnam) DeleteWord

func (v *Varnam) DeleteWord(text string) error

DeleteWord from given input text.

func (*Varnam) Destroy

func (v *Varnam) Destroy()

Destroy closes handle.

func (*Varnam) GetCorpusDetails

func (v *Varnam) GetCorpusDetails() (*CorpusDetails, error)

GetCorpusDetails will return corpus details.

func (*Varnam) GetSchemeFilePath

func (v *Varnam) GetSchemeFilePath() string

GetSchemeFilePath returns the scheme file (.vst)

func (*Varnam) GetSuggestionsFilePath

func (v *Varnam) GetSuggestionsFilePath() string

GetSuggestionsFilePath returns suggestions.

func (*Varnam) ImportFromFile

func (v *Varnam) ImportFromFile(filePath string) error

ImportFromFile Import learnigns from file (varnam exported file)

func (*Varnam) Learn

func (v *Varnam) Learn(text string) error

Learn from given input text.

func (*Varnam) LearnFromFile

func (v *Varnam) LearnFromFile(filePath string) (*LearnStatus, error)

LearnFromFile learns from file from the given filepath.

func (*Varnam) ReverseTransliterate

func (v *Varnam) ReverseTransliterate(text string) (string, error)

ReverseTransliterate given string.

func (*Varnam) Train

func (v *Varnam) Train(pattern, word string) error

Train methods adds a word with pattern, eg: pattern=firefox, word=ഫയർഫോക്സ്

func (*Varnam) Transliterate

func (v *Varnam) Transliterate(text string) ([]string, error)

Transliterate given string to corresponding language.

type VarnamError

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

VarnamError satisfies error interface.

func (*VarnamError) Error

func (e *VarnamError) Error() string

Jump to

Keyboard shortcuts

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