runeconverter

package module
Version: v0.0.0-...-0aedeec Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: MIT Imports: 8 Imported by: 0

README

runeconverter

golang字符串转换工具

功能

  • 简繁转换(参考https://github.com/nadoo/convtrad)
  • 汉语大小写数字转换
  • 全角半角转换
  • 异体数字到标准数字的转换
  • 汉语转拼音(未完成)

Documentation

Index

Constants

View Source
const (
	BCModeDBC2SBC = iota
	BCModeSBC2DBC
)
View Source
const (
	NormalizeZhLow2Big = iota
	NormalizeZhBig2Low
)
View Source
const (
	PinyinStyleNormal = iota
	PinyinStyleTone
)

拼音风格

Variables

This section is empty.

Functions

func Convert

func Convert(input []byte, output *bytes.Buffer, runefunc func(rune, *bytes.Buffer)) *bytes.Buffer

Types

type BC

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

func NewBC

func NewBC(mode int) *BC

func (*BC) Convert

func (bc *BC) Convert(r rune) rune

type CaseLower

type CaseLower int

func (*CaseLower) Convert

func (cl *CaseLower) Convert(r rune) rune

type CaseUpper

type CaseUpper int

func (*CaseUpper) Convert

func (cl *CaseUpper) Convert(r rune) rune

type Converter

type Converter interface {
	Convert(rune) rune
}

type Multi

type Multi struct {
	Converters []Converter
}

func (*Multi) Add

func (m *Multi) Add(c Converter) *Multi

func (*Multi) Convert

func (m *Multi) Convert(r rune) rune

type NormalizeNum

type NormalizeNum int

func (*NormalizeNum) Convert

func (tn *NormalizeNum) Convert(r rune) rune

type NormalizeZhNum

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

func NewNormalizeZhNum

func NewNormalizeZhNum(mode int) *NormalizeZhNum

func (*NormalizeZhNum) Convert

func (nz *NormalizeZhNum) Convert(r rune) rune

type Num2Zh

type Num2Zh int

func (*Num2Zh) Convert

func (n2z *Num2Zh) Convert(r rune) rune

type Pinyin

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

func NewPinyin

func NewPinyin(dbpath string, style int) (*Pinyin, error)

func (*Pinyin) Convert

func (py *Pinyin) Convert(r rune, buf *bytes.Buffer)

type Simple2Traditional

type Simple2Traditional int

func (*Simple2Traditional) Convert

func (st *Simple2Traditional) Convert(r rune) rune

type Traditional2Simple

type Traditional2Simple int

func (*Traditional2Simple) Convert

func (ts *Traditional2Simple) Convert(r rune) rune

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL