data

package
v0.0.0-...-bc0f8f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NUM_CPU = runtime.NumCPU()

逻辑 CPU 数量(线程数)

Functions

This section is empty.

Types

type Dict

type Dict struct {
	// 码表文件
	Text *Text
	// default, jisu, duoduo|bingling, jidian
	Format string
	// 起顶码长
	Push int
	// 选重键
	SelectKeys string

	// 是否只用码表里的单字
	Single bool
	// 匹配算法 greedy|ordered|dynamic
	Algorithm string
	// 空格按键方式 both|left|right
	SpacePref string
	// 转换码表是否覆盖
	Overwrite bool

	Matcher matcher.Matcher
	Length  int  // 词条数
	IsInit  bool // 是否已经初始化
	// contains filtered or unexported fields
}

func (*Dict) Init

func (d *Dict) Init()

初始化 Dict

type Entry

type Entry struct {
	Word string
	Code string
	Pos  int
}

type Text

type Text struct {
	// 自定义名字
	Name string
	// 路径
	Path string
	// 上传的文件
	Bytes []byte
	// 剪切板文本
	String string

	IsInit bool // 是否已经初始化

	Order int // 初始化文本或码表是并行的,此字段用于排序
	// contains filtered or unexported fields
}

func (*Text) Init

func (t *Text) Init()

func (*Text) Iter

func (t *Text) Iter() ([]byte, error)

从Text读取器中读取,直到达到一个控制字符、特定的UTF-8字符,或者超过缓冲区的容量。

最后一次读取返回 io.EOF

func (*Text) ReInit

func (t *Text) ReInit()

重新初始化文本

Jump to

Keyboard shortcuts

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