diff options
author | rsiddharth <s@ricketyspace.net> | 2020-09-06 22:33:11 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-09-06 22:33:11 -0400 |
commit | f454e221b54c19398fc5113c6375cf77856ead84 (patch) | |
tree | e2f3024c9dadda92f63e6530fa703b012e598547 /lib/str.go | |
parent | d421c201ea1b1503a17aa42a0f132f3f60826199 (diff) |
lib: isAlpha -> isAlphaPunch
* lib/str.go (isAlpha): Rename to...
(isAlphaPunch): ...this.
(AlphaScore): change isAlpha call to isAlphaPunch call.
Diffstat (limited to 'lib/str.go')
-rw-r--r-- | lib/str.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -43,14 +43,15 @@ func stripSpaceChars(s string) string { func AlphaScore(bs []byte) int { s := 0 for i := 0; i < len(bs); i++ { - if isAlpha(bs[i]) { + if isAlphaPunch(bs[i]) { s += 1 } } return s } -func isAlpha(c byte) bool { +// 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 |