Displaying 1 result from an estimated 1 matches for "is_plur".
Did you mean:
is_lru
2006 Sep 05
1
Inflector::pluralize("Agencies")=="Agency" ?
...ize again and it goes back to the singular ?
Is this as expected ?
Also, I have a need to know if a word is singular or plural, and to
convert it to one or the other regardless of it already being so.
Anyway, I''ve written these which seem to work. Do they already exist
somewhere ?
def is_plural?(astring)
Inflector::singularize(astring)!=astring
end
def is_singular?(astring)
Inflector::singularize(astring)==astring
end
def pluralize2(astring)
is_singular?(astring) ? Inflector::pluralize(astring) : astring
end
def singularize2(astring)
is_plural?(astring) ? Inflector::singularize(ast...