From 0f2da060a8501f85f03b51d051bb612f88ebff0b Mon Sep 17 00:00:00 2001 From: Stephen Brown II Date: Fri, 29 Jan 2021 19:37:41 -0700 Subject: [PATCH 1/2] Sort singlePluralAssertions, add "device", "service" --- flect_test.go | 214 ++++++++++++++++++++++++-------------------------- 1 file changed, 102 insertions(+), 112 deletions(-) diff --git a/flect_test.go b/flect_test.go index 0bc30b1..ded0888 100644 --- a/flect_test.go +++ b/flect_test.go @@ -53,138 +53,128 @@ func Test_LoadAcronyms(t *testing.T) { var singlePluralAssertions = []tt{ {"", ""}, - {"human", "humans"}, - {"movie", "movies"}, - {"ox", "oxen"}, - {"user", "users"}, - {"cat", "cats"}, - {"truss", "trusses"}, - {"bus", "buses"}, - {"marsh", "marshes"}, - {"lunch", "lunches"}, - {"tax", "taxes"}, - {"blitz", "blitzes"}, - {"fez", "fezzes"}, - {"wolf", "wolves"}, - {"roof", "roofs"}, + {"ability", "abilities"}, + {"address", "addresses"}, + {"agency", "agencies"}, + {"alias", "aliases"}, + {"analysis", "analyses"}, + {"archive", "archives"}, + {"axis", "axes"}, + {"basis", "bases"}, {"belief", "beliefs"}, + {"blitz", "blitzes"}, + {"box", "boxes"}, + {"boy", "boys"}, + {"buffalo", "buffaloes"}, + {"bus", "buses"}, + {"cactus", "cacti"}, + {"case", "cases"}, + {"cat", "cats"}, + {"category", "categories"}, {"chef", "chefs"}, {"chief", "chiefs"}, + {"child", "children"}, + {"circus", "circuses"}, {"city", "cities"}, - {"puppy", "puppies"}, - {"ray", "rays"}, - {"boy", "boys"}, - {"potato", "potatoes"}, - {"tomato", "tomatoes"}, - {"photo", "photos"}, - {"piano", "pianos"}, - {"halo", "halos"}, - {"cactus", "cacti"}, - {"focus", "foci"}, - {"datum", "data"}, - {"analysis", "analyses"}, - {"ellipsis", "ellipses"}, - {"phenomenon", "phenomena"}, + {"comment", "comments"}, + {"crisis", "crises"}, {"criterion", "criteria"}, - {"sheep", "sheep"}, - {"series", "series"}, - {"species", "species"}, + {"custom_field", "custom_fields"}, + {"database", "databases"}, + {"datum", "data"}, + {"day", "days"}, {"dear", "dears"}, {"deer", "deer"}, - {"child", "children"}, - {"goose", "geese"}, - {"woman", "women"}, - {"tooth", "teeth"}, + {"device", "devices"}, + {"diagnosis_a", "diagnosis_as"}, + {"diagnosis", "diagnoses"}, + {"dwarf", "dwarves"}, + {"edge", "edges"}, + {"elf", "elves"}, + {"ellipsis", "ellipses"}, + {"equipment", "equipment"}, + {"experience", "experiences"}, + {"fez", "fezzes"}, + {"field", "fields"}, + {"fish", "fish"}, + {"fix", "fixes"}, + {"focus", "foci"}, + {"foobar", "foobars"}, {"foot", "feet"}, + {"fox", "foxes"}, + {"funky jeans", "funky jeans"}, + {"fuse", "fuses"}, + {"goose", "geese"}, + {"great_person", "great_people"}, + {"half", "halves"}, + {"halo", "halos"}, + {"horse", "horses"}, + {"house", "houses"}, + {"human", "humans"}, + {"index", "indices"}, + {"information", "information"}, + {"jeans", "jeans"}, + {"louse", "lice"}, + {"lunch", "lunches"}, + {"marsh", "marshes"}, + {"matrix", "matrices"}, + {"media", "media"}, {"mouse", "mice"}, - {"person", "people"}, - {"search", "searches"}, - {"switch", "switches"}, - {"fix", "fixes"}, + {"move", "moves"}, + {"movie", "movies"}, + {"news", "news"}, + {"newsletter", "newsletters"}, + {"node_child", "node_children"}, + {"octopus", "octopi"}, {"ovum", "ova"}, - {"box", "boxes"}, - {"fox", "foxes"}, + {"ox", "oxen"}, + {"payment_information", "payment_information"}, + {"person", "people"}, + {"perspective", "perspectives"}, + {"phenomenon", "phenomena"}, + {"photo", "photos"}, + {"piano", "pianos"}, + {"plus", "pluses"}, + {"portfolio", "portfolios"}, + {"potato", "potatoes"}, + {"prize", "prizes"}, {"process", "processes"}, - {"address", "addresses"}, - {"case", "cases"}, - {"stack", "stacks"}, - {"wish", "wishes"}, - {"fish", "fish"}, - {"jeans", "jeans"}, - {"funky jeans", "funky jeans"}, - {"category", "categories"}, + {"prometheus", "prometheuses"}, + {"puppy", "puppies"}, {"query", "queries"}, - {"ability", "abilities"}, - {"agency", "agencies"}, - {"movie", "movies"}, - {"archive", "archives"}, - {"index", "indices"}, - {"wife", "wives"}, + {"quiz", "quizzes"}, + {"ray", "rays"}, + {"rice", "rice"}, + {"roof", "roofs"}, {"safe", "saves"}, - {"half", "halves"}, - {"move", "moves"}, {"salesperson", "salespeople"}, - {"person", "people"}, - {"spokesman", "spokesmen"}, - {"basis", "bases"}, - {"diagnosis", "diagnoses"}, - {"diagnosis_a", "diagnosis_as"}, - {"datum", "data"}, - {"stadium", "stadia"}, - {"analysis", "analyses"}, - {"node_child", "node_children"}, - {"child", "children"}, - {"experience", "experiences"}, - {"day", "days"}, - {"comment", "comments"}, - {"foobar", "foobars"}, - {"newsletter", "newsletters"}, - {"news", "news"}, + {"search", "searches"}, {"series", "series"}, + {"service", "services"}, + {"sheep", "sheep"}, + {"shoe", "shoes"}, {"species", "species"}, - {"quiz", "quizzes"}, - {"perspective", "perspectives"}, - {"ox", "oxen"}, - {"photo", "photos"}, - {"buffalo", "buffaloes"}, - {"tomato", "tomatoes"}, - {"dwarf", "dwarves"}, - {"elf", "elves"}, - {"information", "information"}, - {"equipment", "equipment"}, - {"bus", "buses"}, + {"spokesman", "spokesmen"}, + {"sportsEquipment", "sportsEquipment"}, + {"spouse", "spouses"}, + {"stack", "stacks"}, + {"stadium", "stadia"}, + {"status_code", "status_codes"}, {"status", "statuses"}, {"Status", "Statuses"}, - {"status_code", "status_codes"}, - {"mouse", "mice"}, - {"louse", "lice"}, - {"house", "houses"}, - {"spouse", "spouses"}, - {"octopus", "octopi"}, - {"virus", "viri"}, - {"alias", "aliases"}, - {"portfolio", "portfolios"}, - {"matrix", "matrices"}, - {"axis", "axes"}, + {"switch", "switches"}, + {"tax", "taxes"}, {"testis", "testes"}, - {"crisis", "crises"}, - {"rice", "rice"}, - {"shoe", "shoes"}, - {"horse", "horses"}, - {"prize", "prizes"}, - {"edge", "edges"}, - {"database", "databases"}, - {"circus", "circuses"}, - {"plus", "pluses"}, - {"fuse", "fuses"}, - {"prometheus", "prometheuses"}, + {"tomato", "tomatoes"}, + {"tooth", "teeth"}, + {"truss", "trusses"}, + {"user", "users"}, {"vedalia", "vedalias"}, - {"media", "media"}, - {"field", "fields"}, - {"custom_field", "custom_fields"}, - {"sportsEquipment", "sportsEquipment"}, - {"payment_information", "payment_information"}, - {"great_person", "great_people"}, + {"virus", "viri"}, + {"wife", "wives"}, + {"wish", "wishes"}, + {"wolf", "wolves"}, + {"woman", "women"}, } var pluralSingularAssertions = []tt{} From da5e97164dce23900fba6866aad376c4496a9a8f Mon Sep 17 00:00:00 2001 From: Stephen Brown II Date: Fri, 29 Jan 2021 19:38:59 -0700 Subject: [PATCH 2/2] Add "vice", "vices" suffix to fix "device", "service" --- plural_rules.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plural_rules.go b/plural_rules.go index 8cd3ba7..ff67928 100644 --- a/plural_rules.go +++ b/plural_rules.go @@ -199,6 +199,7 @@ var singularToPluralSuffixList = []singularToPluralSuffix{ {"shoe", "shoes"}, {"stis", "stes"}, {"tive", "tives"}, + {"vice", "vices"}, {"wife", "wives"}, {"afe", "aves"}, {"bfe", "bves"},