engine

package
v0.0.0-...-1a772e3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCongkitVersion = CongkitV5
	DefaultDatabasePath   = "./congkit.db"
)

Engine defaults

View Source
const (
	GetCharFromCongkit = `` /* 144-byte string literal not displayed */

	GetCharFromQuick = `` /* 147-byte string literal not displayed */

	GetCharWithPrediction = `` /* 147-byte string literal not displayed */

	GetSimplifiedCharFromCongkit = `` /* 144-byte string literal not displayed */

	GetSimplifiedCharFromQuick = `` /* 147-byte string literal not displayed */

	GetSimplifiedCharWithPrediction = `` /* 147-byte string literal not displayed */

)
View Source
const (
	DatabaseDSNPattern = "file:%s?mode=ro"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CongkitVersion

type CongkitVersion int
const (
	CongkitV3 CongkitVersion = 3
	CongkitV5 CongkitVersion = 5
)

type Engine

type Engine struct {
	CongkitVersion
	OutputSimplified bool // Output Simplified Chinese word
	Easy             bool // "Easy" input method mode
	Prediction       bool // Predict word while typing
	// contains filtered or unexported fields
}

func New

func New(options ...Option) *Engine

func (*Engine) Close

func (e *Engine) Close() error

func (*Engine) Encode

func (e *Engine) Encode(radicals string) (results []rune, err error)

func (*Engine) Set

func (e *Engine) Set(options ...Option)

type Option

type Option func(*Engine)

func WithCongkitV3

func WithCongkitV3() Option

func WithCongkitV5

func WithCongkitV5() Option

func WithDatabase

func WithDatabase(path string) Option

func WithEasy

func WithEasy() Option

func WithPrediction

func WithPrediction() Option

func WithSimplified

func WithSimplified() Option

Jump to

Keyboard shortcuts

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