Documentation ¶
Index ¶
- Constants
- Variables
- func CharGlobalID(w rune, f string) (int64, error)
- func SplitPinyin(pf string) (sm, ym, sd string, err error)
- type Coder
- func (c *Coder) AddChar(w, r, p, f string) (int64, string, error)
- func (c *Coder) AddCharOverlay(w, r, p, f string) (int64, string, error)
- func (c *Coder) AddRadical(r rune, e string) error
- func (c *Coder) Close() error
- func (c *Coder) Decode(es EmoziString, forcedecode bool) (string, error)
- func (c *Coder) DelChar(id int64) error
- func (c *Coder) DelCharOverlay(id int64) error
- func (c *Coder) DelRadical(r rune) error
- func (c *Coder) Encode(enableRandom bool, s string, selections ...int) (EmoziString, []int, error)
- func (c *Coder) GetCharByID(id int64) (w, r rune, p, f, desc string, err error)
- func (c *Coder) LookupChar(ch rune) (explains []string, err error)
- func (c *Coder) LookupRadical(r rune) string
- func (c *Coder) StabilizeCharFromOverlay(id int64) (string, error)
- type EmoziString
Constants ¶
View Source
const ( G = 'ɡ' A = 'ɑ' )
Variables ¶
View Source
var EmoziDatabasePath = "字.db"
DatabasePath 字数据库的路径 如找不到会向对应路径写入内嵌的字数据库
View Source
var (
ErrInvalidEmoziString = errors.New("invalid EmoziString")
)
View Source
var (
ErrNoSuchChar = errors.New("no such char")
)
Functions ¶
Types ¶
type Coder ¶
type Coder struct {
// contains filtered or unexported fields
}
Coder encoder/decoder
func (*Coder) AddCharOverlay ¶
AddCharOverlay 向附加库添加一个新字, 覆盖在主库之上
w: 字, r: 部首, p: 不带声调的拼音(可空), f: 带声调的拼音 返回: 字表ID, 文字描述, error
func (*Coder) Decode ¶
func (c *Coder) Decode(es EmoziString, forcedecode bool) (string, error)
Decode 从 EmoziString 解码得到可能的文字序列
func (*Coder) DelCharOverlay ¶
DelCharOverlay 删除附加库的一个字
func (*Coder) GetCharByID ¶
GetCharByID ...
func (*Coder) LookupChar ¶
LookupChar 查一个汉字 (可能是多音字)
type EmoziString ¶
type EmoziString string
EmoziString 一个颜文字汉字转写串, 包含串头 校验字节数*2 字节校验和
func WrapRawEmoziString ¶
func WrapRawEmoziString(s string) EmoziString
WrapRawEmoziString 为不包含串头的转写串加一个头使其成为合法 EmoziString
Source Files ¶
Click to show internal directories.
Click to hide internal directories.