class String

def singularize(locale = :en)

Experimental RBS support (using type sampling data from the type_fusion project).

def singularize: (?Symbol locale) -> String

This signature was generated using 3 samples from 1 application.

See ActiveSupport::Inflector.singularize.

'leyes'.singularize(:es) # => "ley"
'CamelOctopi'.singularize # => "CamelOctopus"
'the blue mailmen'.singularize # => "the blue mailman"
'word'.singularize # => "word"
'sheep'.singularize # => "sheep"
'octopi'.singularize # => "octopus"
'posts'.singularize # => "post"

You must define your own inflection rules for languages other than English.
By default, this parameter is set to :en.
the word will be singularized as a word of that language.
If the optional parameter +locale+ is specified,

The reverse of +pluralize+, returns the singular form of a word in a string.
def singularize(locale = :en)
  ActiveSupport::Inflector.singularize(self, locale)
end