mirror of
https://github.com/wahyd4/go-pinyin.git
synced 2026-08-09 04:35:55 +10:00
fix handle Heteronym arg
This commit is contained in:
@@ -22,3 +22,5 @@ _testmain.go
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
*~
|
||||
*.swp
|
||||
|
||||
@@ -146,9 +146,8 @@ func SinglePinyin(r rune, a Args) []string {
|
||||
value, ok := PinyinDict[int(r)]
|
||||
pys := []string{}
|
||||
if ok {
|
||||
if len(value) < 1 || a.Heteronym {
|
||||
pys = strings.Split(value, ",")
|
||||
} else {
|
||||
pys = strings.Split(value, ",")
|
||||
if !a.Heteronym {
|
||||
pys = strings.Split(value, ",")[:1]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user