123456789101112131415161718192021 |
- package chinese
- import (
- "github.com/go-ego/gpy"
- "strings"
- )
- func FirstPinYin(r string) string {
- args := gpy.NewArgs()
- ss := gpy.Pinyin(r, args)
- if len(ss) == 0 {
- return "#"
- }
- if len(ss[0]) == 0 {
- return "#"
- }
- return strings.ToUpper(string(ss[0][0][0]))
- }
|