Package adalid.commons.i18n
Class EnglishNoun
- java.lang.Object
-
- adalid.commons.i18n.EnglishNoun
-
public class EnglishNoun extends Object
An experimental class that provides static methods for testing and computing various properties of strings that are presumed to be English nouns.- Version:
- 1.01 2002 Feb capitalize and pluralOfMultiwordExpression added by Jorge Campins (don't blame Mr. Mason for the shortcomings of these methods)
- Author:
- James A. Mason
-
-
Constructor Summary
Constructors Constructor Description EnglishNoun()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringcapitalize(String noun)Returns the nicely capitalized form of a noun.static booleanisPlural(String word)Tests whether the given (presumed) English noun is plural.static booleanisSingular(String word)Tests whether the given (presumed) English noun is singular.static StringpluralOf(String word)Returns the plural of a given (presumed) English word.static StringpluralOfMultiwordExpression(String mwe)static StringsingularOf(String word)Returns the singular of a given (presumed) English word.
-
-
-
Method Detail
-
capitalize
public static String capitalize(String noun)
Returns the nicely capitalized form of a noun.- Parameters:
noun- a noun- Returns:
- capitalized noun
-
isPlural
public static boolean isPlural(String word)
Tests whether the given (presumed) English noun is plural. A word like "sheep" that can be either singular or plural yields true.- Parameters:
word- a word- Returns:
- true if word is plural; false otherwise
-
isSingular
public static boolean isSingular(String word)
Tests whether the given (presumed) English noun is singular. A word like "sheep" that can be either singular or plural yields true.- Parameters:
word- a word- Returns:
- true if word is singular; false otherwise
-
pluralOf
public static String pluralOf(String word)
Returns the plural of a given (presumed) English word. The given word may be singular or (already) plural.- Parameters:
word- a word- Returns:
- the plural of word
-
singularOf
public static String singularOf(String word)
Returns the singular of a given (presumed) English word. The given word may be plural or (already) singular.- Parameters:
word- a word- Returns:
- the singular of word
-
-