class Strings::Inflection::Verb

Public Instance Methods

plural() click to toggle source

Inflect a word to its plural form

@example

Strings::Inflection::Verb.new("goes").plural
# => "go"

@return [String]

the verb inflected to plural form

@api public

# File lib/strings/inflection/verb.rb, line 47
def plural
  return word if word.to_s.empty? || uninflected?

  find_match(Verbs.plurals) || word
end
singular() click to toggle source

Inflect a word to its singular form

@example

Strings::Inflection::Verb.new("go").singular
# => "goes"

@return [String]

the verb inflected to singular form

@api public

# File lib/strings/inflection/verb.rb, line 31
def singular
  return word if word.to_s.empty? || uninflected?

  find_match(Verbs.singulars) || word
end
uninflected?() click to toggle source

Check if word is uninflected

@param [String] word

the word to check

@return [Boolean]

@api private

# File lib/strings/inflection/verb.rb, line 17
def uninflected?
  Verbs.uninflected.include?(word)
end