Skip to content

Irregular plural words: plural? and plural both fail (people => peoples) #3

@DannyBen

Description

@DannyBen

Of course you also have a gem for string inflection...

You are my one stop shop for "gem supplies" 🛒

Problem

Strings::Inflection.plural? on irregular plurals fails.

Reproduction

require 'strings-inflection'
require 'strings/inflection/extensions'
using Strings::Inflection::Extensions

# These fail
p 'people'.pluralize == 'people' # => false
p 'people'.plural? == true       # => false
p 'children'.plural? == true     # => false

# These are all ok, just here as a "full test suite"
p 'person'.singular? == true    
p 'child'.singular? == true     
p 'people'.singular? == false   
p 'children'.singular? == false 
p 'person'.plural? == false     
p 'child'.plural? == false

Additional information

The underlying root cause of this problem, is that the gem returns "peoples" as the plural form of people, which is wrong. In ActiveSupport Inflector, it is returned properly:

>> require 'active_support/inflector'
=> true
>> "people".singularize
=> "person"
>> "people".pluralize
=> "people"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions