-
Notifications
You must be signed in to change notification settings - Fork 37
/
msg_verb.go
73 lines (69 loc) · 983 Bytes
/
msg_verb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package main
import (
"strings"
)
var verbs = make(map[string]struct{})
func init() {
verbList := []string{
"Anchor",
"Abandon",
"Apply",
"Autograph",
"Award",
"Cancel",
"Check",
"Close",
"Create",
"Claim",
"Demote",
"Destroy",
"Edit",
"Find",
"Flip",
"Get",
"Give",
"Grant",
"Join",
"Kick",
"Launch",
"Leave",
"List",
"Open",
"Promote",
"Publish",
"Purchase",
"Query",
"Record",
"Recycle",
"Redeem",
"Refresh",
"Release",
"Report",
"Revoke",
"Request",
"Reroll",
"Reserve",
"Retrieve",
"Select",
"Send",
"Set",
"Spectate",
"Start",
"Stop",
"Submit",
"Swap",
"Toggle",
"Track",
"Transfer",
"Upgrade",
"Vote",
}
for _, v := range verbList {
verbs[strings.ToLower(v)] = struct{}{}
}
}
// IsWordVerb checks if a word is a suspected verb, from a hardcoded dictionary of common verbs.
func IsWordVerb(word string) bool {
_, ok := verbs[strings.ToLower(word)]
return ok
}