fix handle Heteronym arg

This commit is contained in:
huangzg
2015-06-12 16:08:51 +08:00
parent d096bb24e7
commit 5ceb64fe80
2 changed files with 4 additions and 3 deletions
+2
View File
@@ -22,3 +22,5 @@ _testmain.go
*.exe
*.test
*.prof
*~
*.swp
+2 -3
View File
@@ -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]
}
}