|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjlibs.core.lang.Noun
public class Noun
API for performing pluralization, singularization on various strings. These inflections will be useful in code generators that convert things like database table names into Java class names.
| Constructor Summary | |
|---|---|
Noun()
|
|
| Method Summary | |
|---|---|
static void |
addIrregular(String singular,
String plural)
Add the addSingular and addPlural forms of words that cannot be converted using the normal rules. |
static void |
addPlural(String match,
String rule)
Add a match pattern and replacement rule for converting addPlural forms to addSingular forms. |
static void |
addPlural(String match,
String rule,
boolean insensitive)
Add a match pattern and replacement rule for converting addPlural forms to addSingular forms. |
static void |
addSingular(String match,
String rule)
Add a match pattern and replacement rule for converting addSingular forms to addPlural forms. |
static void |
addSingular(String match,
String rule,
boolean insensitive)
Add a match pattern and replacement rule for converting addSingular forms to addPlural forms. |
static void |
addUncountable(String word)
Add a word that cannot be converted between addSingular and addPlural. |
static String |
pluralize(String word)
Return a addPlural version of the specified word. |
static String |
singularize(String word)
Return a addSingular version of the specified word. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Noun()
| Method Detail |
|---|
public static void addPlural(String match,
String rule)
Add a match pattern and replacement rule for converting addPlural forms to addSingular forms. By default, matches will be case insensitive.
match - Match pattern regular expressionrule - Replacement rule
public static void addPlural(String match,
String rule,
boolean insensitive)
Add a match pattern and replacement rule for converting addPlural forms to addSingular forms.
match - Match pattern regular expressionrule - Replacement ruleinsensitive - Flag indicating this match should be case insensitive
public static void addSingular(String match,
String rule)
Add a match pattern and replacement rule for converting addSingular forms to addPlural forms. By default, matches will be case insensitive.
match - Match pattern regular expressionrule - Replacement rule
public static void addSingular(String match,
String rule,
boolean insensitive)
Add a match pattern and replacement rule for converting addSingular forms to addPlural forms.
match - Match pattern regular expressionrule - Replacement ruleinsensitive - Flag indicating this match should be case insensitive
public static void addIrregular(String singular,
String plural)
Add the addSingular and addPlural forms of words that cannot be converted using the normal rules.
singular - Singular form of the wordplural - Plural form of the wordpublic static void addUncountable(String word)
Add a word that cannot be converted between addSingular and addPlural.
word - Word to be addedpublic static String pluralize(String word)
Return a addPlural version of the specified word.
word - Singular word to be convertedpublic static String singularize(String word)
Return a addSingular version of the specified word.
word - Plural word to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||