minor phraser tweaks

This commit is contained in:
nate smith 2024-04-19 16:16:15 -07:00
parent e6c14a51ce
commit dde13f4c64

View File

@ -35,8 +35,8 @@ func main() {
'=': true, '=': true,
'`': true, '`': true,
'-': true, '-': true,
// TODO try adding |. it breaks up content that we don't generally want, '|': true,
// anyway, and will lead to short garby phrases being discarded. i think. '>': true,
} }
s := bufio.NewScanner(os.Stdin) s := bufio.NewScanner(os.Stdin)
@ -123,13 +123,15 @@ func clean(bs []byte) string {
s := string(bs) s := string(bs)
s = strings.ReplaceAll(s, "", "'") s = strings.ReplaceAll(s, "", "'")
s = strings.ReplaceAll(s, "\"", "") s = strings.ReplaceAll(s, "\"", "")
s = strings.ReplaceAll(s, "(", "")
s = strings.ReplaceAll(s, "[", "")
s = strings.ReplaceAll(s, "{", "")
s = strings.ReplaceAll(s, "<", "")
s = strings.ReplaceAll(s, "_", "")
s = strings.ReplaceAll(s, "*", "")
s = strings.TrimSpace(s) s = strings.TrimSpace(s)
s = strings.ToLower(s) s = strings.ToLower(s)
// TODO strip _
// TODO strip *
// TODO strip (,{,[
if alphaPercent(s) < 50.0 { if alphaPercent(s) < 50.0 {
return "" return ""
} }