plural_noun library

Classes

AllPredicate
Always applies. This is used for the last PluralRule that add's an s
AppendConverter
Appends a suffix to the given noun to make it plural E.g. adds an s to car.
CaseType
An CaseType implementation checks if a text matches the CaseType and can convert a text in this CaseType
CaseTypes
a list of CaseTypes with a method to find a matching CaseType
ComparesPredicate
Checks if a singular noun compares with a noun to find
EndsWithPredicate
Checks if a singular noun end with a given suffix
NoChangeConverter
Returns the same noun, since the singular noun is the same as a plural noun. E.g.: deer
PluralConverter
PluralPredicate
Checks if a PluralRule applies to a given singular noun This class has several methods that are part of a fluent interface
PluralRule
A PluralRule checks if a condition (PluralPredicate) applies for an singular noun. If so, the singular noun can be converted to the plural form using a PluralConverter This class has several static methods that are part of a fluent interface See PluralRules for implementations
PluralRules
A collection of rules to convert an English single noun to the plural form. It also has a convertToPluralNoun method for the actual conversion These rules are based on https://www.grammarly.com/blog/plural-nouns/
RegexpPredicate
Checks if a singular noun matches a RegExp
ReplaceConverter
Replaces the singular noun with a different plural noun This is often used for exceptions to basic PluralRule E.g.: replace mouse with mice
ReplaceSuffixConverter
Replaces a given suffix This is often used in a basic PluralRule e.g. replace -f with -ves e.g. wolf=>wolves