diff options
-rw-r--r-- | lib/str.go | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -89,30 +89,11 @@ func StripSpaceChars(s string) string { func AlphaPunchScore(bs []byte) int { s := 0 for i := 0; i < len(bs); i++ { - if isAlphaPunch(bs[i]) { - s += 1 - } + s += AsciiScores[bs[i]] } return s } -// Returns true if byte 'c' is a non-numeric character in the English language. -func isAlphaPunch(c byte) bool { - switch { - case 'A' <= c && c <= 'Z': - return true - case 'a' <= c && c <= 'z': - return true - case c == ' ' || c == '.': - return true - case c == ',' || c == '\'': - return true - case c == '"': - return true - } - return false -} - func NumToChar(n int64) byte { if 0 <= n && n <= 9 { return byte(48 + n) |