summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-09-06 22:33:11 -0400
committerrsiddharth <s@ricketyspace.net>2020-09-06 22:33:11 -0400
commitf454e221b54c19398fc5113c6375cf77856ead84 (patch)
treee2f3024c9dadda92f63e6530fa703b012e598547
parentd421c201ea1b1503a17aa42a0f132f3f60826199 (diff)
lib: isAlpha -> isAlphaPunch
* lib/str.go (isAlpha): Rename to... (isAlphaPunch): ...this. (AlphaScore): change isAlpha call to isAlphaPunch call.
-rw-r--r--lib/str.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/str.go b/lib/str.go
index 1d5fd17..67b6753 100644
--- a/lib/str.go
+++ b/lib/str.go
@@ -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