pinyin

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PINYIN = 1

Variables

View Source
var (
	ReadUint16 = util.ReadUint16
	ReadUint32 = util.ReadUint32
	BytesToInt = util.BytesToInt
)
View Source
var FormatList = make([]Format, 0, 20)

Functions

func ReadIntN

func ReadIntN[T constraints.Integer](r io.Reader, size T) int

func ReadN

func ReadN[T constraints.Integer](r io.Reader, size T) []byte

func To2Bytes

func To2Bytes[T constraints.Integer](i T) []byte

func To4Bytes

func To4Bytes[T constraints.Integer](i T) []byte

Types

type BaiduBdict

type BaiduBdict struct {
	Template
	// contains filtered or unexported fields
}

func NewBaiduBcd

func NewBaiduBcd() *BaiduBdict

func NewBaiduBdict

func NewBaiduBdict() *BaiduBdict

func (*BaiduBdict) Unmarshal

func (f *BaiduBdict) Unmarshal(r *bytes.Reader) []*Entry

type Custom

type Custom struct {
	Template
	Sep   byte // 分隔符
	PySep byte // 拼音分隔符

	// w 词,c 无前缀拼音,p 有前缀拼音,f 词频
	Rule []string
}

func NewBaidu

func NewBaidu() *Custom

func NewGoogle

func NewGoogle() *Custom

func NewQQ

func NewQQ() *Custom

func NewRime

func NewRime() *Custom

func NewSogou

func NewSogou() *Custom

func (*Custom) Marshal

func (f *Custom) Marshal(di []*Entry) []byte

拼音通用格式生成

func (*Custom) Unmarshal

func (f *Custom) Unmarshal(r *bytes.Reader) []*Entry

type Entry

type Entry struct {
	Word   string
	Pinyin []string
	Freq   int
}

func (*Entry) GetWord

func (e *Entry) GetWord() string

type Format

type Format interface {
	GetName() string
	GetID() string
	GetCanMarshal() bool
	Marshal([]*Entry) []byte

	Unmarshal(*bytes.Reader) []*Entry
	GetKind() int
}

func New

func New(format string) Format

type JiaJia

type JiaJia struct{ Template }

func NewJiaJia

func NewJiaJia() *JiaJia

func (JiaJia) Marshal

func (JiaJia) Marshal(di []*Entry) []byte

func (*JiaJia) Unmarshal

func (f *JiaJia) Unmarshal(r *bytes.Reader) []*Entry

type Kafan

type Kafan struct {
	Template
	// contains filtered or unexported fields
}

func NewKafan

func NewKafan() *Kafan

func (*Kafan) Unmarshal

func (f *Kafan) Unmarshal(r *bytes.Reader) []*Entry

type MspyUDL

type MspyUDL struct {
	Template
	// contains filtered or unexported fields
}

func NewMspyUDL

func NewMspyUDL() *MspyUDL

func (*MspyUDL) GetIndex

func (f *MspyUDL) GetIndex(py []string) []byte

func (*MspyUDL) Marshal

func (f *MspyUDL) Marshal(di []*Entry) []byte

func (*MspyUDL) Unmarshal

func (f *MspyUDL) Unmarshal(r *bytes.Reader) []*Entry

自学习词库,纯汉字

type QqQpyd

type QqQpyd struct{ Template }

func NewQqQpyd

func NewQqQpyd() *QqQpyd

func (*QqQpyd) Unmarshal

func (f *QqQpyd) Unmarshal(r *bytes.Reader) []*Entry

type SogouBak

type SogouBak struct {
	Template
	// contains filtered or unexported fields
}

func NewSogouBak

func NewSogouBak() *SogouBak

func (*SogouBak) Unmarshal

func (f *SogouBak) Unmarshal(r *bytes.Reader) []*Entry

type SogouScel

type SogouScel struct{ Template }

func NewQqQcel

func NewQqQcel() *SogouScel

func NewSogouScel

func NewSogouScel() *SogouScel

func (*SogouScel) Unmarshal

func (f *SogouScel) Unmarshal(r *bytes.Reader) []*Entry

type Template

type Template struct {
	Name       string // 名称
	ID         string // 唯一 ID
	CanMarshal bool   // 是否可以序列化
}

func (*Template) GetCanMarshal

func (t *Template) GetCanMarshal() bool

func (*Template) GetID

func (t *Template) GetID() string

func (*Template) GetKind

func (t *Template) GetKind() int

func (*Template) GetName

func (t *Template) GetName() string

func (*Template) Marshal

func (t *Template) Marshal([]*Entry) []byte

type ZiguangUwl

type ZiguangUwl struct {
	Template
	// contains filtered or unexported fields
}

func NewZiguangUwl

func NewZiguangUwl() *ZiguangUwl

func (*ZiguangUwl) Unmarshal

func (f *ZiguangUwl) Unmarshal(r *bytes.Reader) []*Entry

Jump to

Keyboard shortcuts

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