Module | Language::English::Inflect |
In: |
lib/merb-core/vendor/facets/inflect.rb
|
Define a plurualization rule.
singular<String>: | ending of the word in singular form |
plural<String>: | ending of the word in plural form |
Once the following rule is defined: Language::English::Inflector.singular_rule ‘fe’, ‘ves‘
You can see the following results: irb> "wife".plural
Define a general rule.
singular<String>: | ending of the word in singular form |
plural<String>: | ending of the word in plural form |
Once the following rule is defined: Language::English::Inflector.rule ‘y’, ‘ies‘
You can see the following results: irb> "fly".plural
irb> "cry".plural
Define a singularization rule.
singular<String>: | ending of the word in singular form |
plural<String>: | ending of the word in plural form |
Once the following rule is defined: Language::English::Inflector.singular_rule ‘o’, ‘oes‘
You can see the following results: irb> "heroes".singular
Defines a general inflection exception case.
singular<String>: | singular form of the word |
plural<String>: | plural form of the word |
Here we define erratum/errata exception case:
Language::English::Inflector.word "erratum", "errata"
In case singular and plural forms are the same omit second argument on call:
Language::English::Inflector.word ‘information‘