This commit is contained in:
白茶清欢 2023-07-01 23:30:50 +08:00
parent 0c25220b9a
commit 7ed8ccbd87
2 changed files with 7 additions and 4 deletions

View File

@ -44,6 +44,8 @@ var (
Browser *browser
// StringConvert 字符串转为任意类型
StringConvert *stringConvert
// PinYin 汉字转拼音
PinYin *pinYin
)
func init() {
@ -74,4 +76,5 @@ func init() {
}
// StringConvert
StringConvert = &stringConvert{}
PinYin = &pinYin{}
}

View File

@ -160,7 +160,7 @@ func PinYinStyleWithHeteronym() PinYinArg {
// Author : go_developer@163.com<白茶清欢>
//
// Date : 17:23 2023/6/25
type PinYin struct {
type pinYin struct {
}
// Convert 汉字生成拼音
@ -168,7 +168,7 @@ type PinYin struct {
// Author : go_developer@163.com<白茶清欢>
//
// Date : 17:26 2023/6/25
func (py *PinYin) Convert(text string, argFuncList ...PinYinArg) string {
func (py *pinYin) Convert(text string, argFuncList ...PinYinArg) string {
arg := pinyin.NewArgs()
arg.Separator = " "
for _, argFunc := range argFuncList {
@ -183,7 +183,7 @@ func (py *PinYin) Convert(text string, argFuncList ...PinYinArg) string {
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:02 2023/6/25
func (py *PinYin) ConvertSingle(text string, argFuncList ...PinYinArg) []string {
func (py *pinYin) ConvertSingle(text string, argFuncList ...PinYinArg) []string {
arg := pinyin.NewArgs()
arg.Separator = " "
for _, argFunc := range argFuncList {
@ -198,7 +198,7 @@ func (py *PinYin) ConvertSingle(text string, argFuncList ...PinYinArg) []string
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:02 2023/6/25
func (py *PinYin) ConvertWithHeteronym(text string, argFuncList ...PinYinArg) [][]string {
func (py *pinYin) ConvertWithHeteronym(text string, argFuncList ...PinYinArg) [][]string {
arg := pinyin.NewArgs()
arg.Separator = " "
for _, argFunc := range argFuncList {