minor phraser tweaks
This commit is contained in:
parent
e6c14a51ce
commit
dde13f4c64
@ -35,8 +35,8 @@ func main() {
|
||||
'=': true,
|
||||
'`': true,
|
||||
'-': true,
|
||||
// TODO try adding |. it breaks up content that we don't generally want,
|
||||
// anyway, and will lead to short garby phrases being discarded. i think.
|
||||
'|': true,
|
||||
'>': true,
|
||||
}
|
||||
|
||||
s := bufio.NewScanner(os.Stdin)
|
||||
@ -123,13 +123,15 @@ func clean(bs []byte) string {
|
||||
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.TrimSpace(s)
|
||||
s = strings.ToLower(s)
|
||||
|
||||
// TODO strip _
|
||||
// TODO strip *
|
||||
// TODO strip (,{,[
|
||||
|
||||
if alphaPercent(s) < 50.0 {
|
||||
return ""
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user