-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathplural_rules.go
More file actions
47 lines (44 loc) · 1.28 KB
/
plural_rules.go
File metadata and controls
47 lines (44 loc) · 1.28 KB
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
package stringfy
var pluralRules = map[string]string{
`$`: "s",
`s$`: "s",
`^(ax|test)is$`: "${1}es",
`(octop|vir)us$`: "${1}i",
`(octop|vir)i$`: "${1}i",
`(alias|status)$`: "${1}es",
`(bu)s$`: "${1}ses",
`(buffal|tomat)o$`: "${1}oes",
`([ti])um$`: "${1}a",
`([ti])a$`: "${1}a",
`(.+)sis$`: "${1}ses",
`(?:([^f])fe|([lr])f|([aei])f)$`: "$1$2${3}ves",
`(hive)$`: "${1}s",
`([^aeiouy]|qu)y$`: "${1}ies",
`([a-z]{2,}x|ch|ss|sh)$`: "${1}es",
`(matr|vert|ind)(?:ix|ex)$`: "${1}ices",
`^(m|l)ouse$`: "${1}ice",
`^(m|l)ice$`: "${1}ice",
`^(ox)$`: "${1}en",
`^(oxen)$`: "$1",
`^(quiz)$`: "${1}zes",
}
var irregularRules = map[string]string{
"person": "people",
"man": "men",
"child": "children",
"sex": "sexes",
"move": "moves",
"zombie": "zombies",
}
var uncountableList = []string{
"equipment",
"information",
"rice",
"money",
"species",
"series",
"fish",
"sheep",
"jeans",
"police",
}