public class English extends TwoFormInflector
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.
Modifier and Type | Class and Description |
---|---|
static class |
English.MODE |
Constructor and Description |
---|
English() |
English(English.MODE mode) |
Modifier and Type | Method and Description |
---|---|
String |
getPlural(String word)
Returns plural form of the given word.
|
String |
getPlural(String word,
int count)
Returns singular or plural form of the word based on count.
|
static String |
plural(String word)
Returns plural form of the given word.
|
static String |
plural(String word,
int count)
Returns singular or plural form of the word based on count.
|
static void |
setMode(English.MODE mode) |
categoryRule, irregular, irregular, rule, rule, uncountable
public English()
public English(English.MODE mode)
public String getPlural(String word)
getPlural
in class TwoFormInflector
word
- word in singular formpublic String getPlural(String word, int count)
word
- word in singular formcount
- word countpublic static String plural(String word)
For instance:
English.plural("cat") == "cats";
word
- word in singular formpublic static String plural(String word, int count)
For instance:
English.plural("cat", 1) == "cat";
English.plural("cat", 2) == "cats";
word
- word in singular formcount
- word countpublic static void setMode(English.MODE mode)
Copyright © 2014 Atteo. All Rights Reserved.