diff --git a/lib/dry/inflector/inflections/defaults.rb b/lib/dry/inflector/inflections/defaults.rb index bb0d573..f79f476 100644 --- a/lib/dry/inflector/inflections/defaults.rb +++ b/lib/dry/inflector/inflections/defaults.rb @@ -69,7 +69,7 @@ def self.singular(inflect) inflect.singular(/(ss)\z/i, '\1') inflect.singular(/(x|ch|ss|sh)es\z/i, '\1') inflect.singular(/([m|l])ice\z/i, '\1ouse') - inflect.singular(/(bus)(es)?\z/i, '\1') + inflect.singular(/(us)(es)?\z/i, '\1') inflect.singular(/(o)es\z/i, '\1') inflect.singular(/(shoe)s\z/i, '\1') inflect.singular(/(cris|ax|test)(is|es)\z/i, '\1is') diff --git a/spec/support/fixtures/singularize.rb b/spec/support/fixtures/singularize.rb index cb2daf6..78f78a9 100644 --- a/spec/support/fixtures/singularize.rb +++ b/spec/support/fixtures/singularize.rb @@ -62,7 +62,12 @@ def self.pending "testis" => "testis", "thesis" => "thesis", "analysis" => "analysis", - "octopus" => "octopus", + "octopuses" => "octopus", + "pluses" => "plus", + "cactuses" => "cactus", + "bonuses" => "bonus", + "geniuses" => "genius", + "walruses" => "walrus", # ==== rules @@ -166,11 +171,9 @@ def self.pending # Missing exceptions or missing rules? PENDING = { "cacti" => "cactus", - "cactuses" => "cactus", "thesauri" => "thesaurus", "phenomena" => "phenomenon", "drives" => "drive", - "pluses" => "plus", "thieves" => "thief", "criteria" => "criterion", "postgres" => "postgres"