gpinyin:golang 汉字转拼音工具类
HELLO WORLD
实现一个golang版本的汉字转拼音类
支持功能:
》简繁体转换
》带音标与不带音标的转换
使用方式: go get github.com/jmz331/gpinyin
import "github.com/jmz331/gpinyin"
const s = "台我要1234!#$翻译成繁体的汉字堡垒asdf"
r1 := ConvertToPinyinString ( s , "-" , PINYIN_WITHOUT_TONE )
//tai-wo-yao-1234!#$-fan-yi-cheng-fan-ti-de-han-zi-bao-lei-asdf
r2 := ConvertToPinyinString ( s , "-" , PINYIN_WITH_TONE_MARK )
//tái-wǒ-yào-1234!#$-fān-yì-chéng-fán-