Package org.atteo.evo.inflector
Class English
java.lang.Object
org.atteo.evo.inflector.TwoFormInflector
org.atteo.evo.inflector.English
Transforms English words from singular to plural form.
Examples:
English.plural("word") = "words";
English.plural("cat", 1) = "cat";
English.plural("cat", 2) = "cats";
Based on An Algorithmic Approach to English Pluralization by Damian Conway.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static final String[]private static English -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns plural form of the given word.Returns singular or plural form of the word based on count.static StringReturns plural form of the given word.static StringReturns singular or plural form of the word based on count.static voidsetMode(English.MODE mode) Methods inherited from class org.atteo.evo.inflector.TwoFormInflector
categoryRule, irregular, irregular, rule, rule, uncountable
-
Field Details
-
CATEGORY_EX_ICES
-
CATEGORY_IX_ICES
-
CATEGORY_UM_A
-
CATEGORY_US_I
-
CATEGORY_ON_A
-
CATEGORY_A_AE
-
CATEGORY_O_OS
-
CATEGORY_O_I
-
CATEGORY_EN_INA
-
CATEGORY_A_ATA
-
CATEGORY_IS_IDES
-
CATEGORY_US_US
-
CATEGORY_NONE_I
-
CATEGORY_NONE_IM
-
CATEGORY_EX_EXES
-
CATEGORY_IX_IXES
-
CATEGORY_S_ES
-
CATEGORY_MAN_MANS
-
inflector
-
-
Constructor Details
-
English
public English() -
English
-
-
Method Details
-
getPlural
Returns plural form of the given word.- Overrides:
getPluralin classTwoFormInflector- Parameters:
word- word in singular form- Returns:
- plural form of the word
-
getPlural
Returns singular or plural form of the word based on count.- Parameters:
word- word in singular formcount- word count- Returns:
- form of the word correct for given count
-
plural
Returns plural form of the given word.For instance:
English.plural("cat") == "cats";- Parameters:
word- word in singular form- Returns:
- plural form of given word
-
plural
Returns singular or plural form of the word based on count.For instance:
English.plural("cat", 1) == "cat"; English.plural("cat", 2) == "cats";- Parameters:
word- word in singular formcount- word count- Returns:
- form of the word correct for given count
-
setMode
-