MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / chineseChar2Int

Function chineseChar2Int

plugin/manager/timer/parse.go:155–166  ·  view source on GitHub ↗

chineseChar2Int 处理单个字符的映射0~10

(c rune)

Source from the content-addressed store, hash-verified

153
154// chineseChar2Int 处理单个字符的映射0~10
155func chineseChar2Int(c rune) int {
156 if c == rune('日') || c == rune('天') { // 周日/周天
157 return 7
158 }
159 match := []rune("零一二三四五六七八九十")
160 for i, m := range match {
161 if c == m {
162 return i
163 }
164 }
165 return 0
166}

Callers 1

chineseNum2IntFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected