From f454e221b54c19398fc5113c6375cf77856ead84 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 6 Sep 2020 22:33:11 -0400 Subject: lib: isAlpha -> isAlphaPunch * lib/str.go (isAlpha): Rename to... (isAlphaPunch): ...this. (AlphaScore): change isAlpha call to isAlphaPunch call. --- lib/str.go | 5 +++-- 1 file 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 -- cgit v1.2.3