Package org.anchoranalysis.core.value
Class LanguageUtilities
Object
LanguageUtilities
Utility functions for pluralizing words in strings.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
multiplexPlural
(long number, String single, String plural) Returns a single or plural word depending on the number.static String
Givensomething
, returnssomethings
.static String
pluralizeMaybe
(long number, String word) Returnssomething
orsomethings
depending on the number.static String
prefixPluralize
(long number, String word) Returnsn somethings
.static String
prefixPluralizeMaybe
(long number, String word) Returns1 something
orn somethings
as is appropriate.
-
Method Details
-
pluralizeMaybe
Returnssomething
orsomethings
depending on the number.- Parameters:
number
- the number nword
- the something- Returns:
- the string as above
-
multiplexPlural
Returns a single or plural word depending on the number.- Parameters:
number
- the number that determines which word to use.single
- the string to use whennumber
is singular.plural
- the string to use whennumber
is pural.- Returns:
single
orplural
depending onnumber
.
-
prefixPluralizeMaybe
Returns1 something
orn somethings
as is appropriate.- Parameters:
number
- the number nword
- the something- Returns:
- the string as above
-
prefixPluralize
Returnsn somethings
.- Parameters:
number
- the number.word
- the something.- Returns:
- the string as above.
-
pluralize
Givensomething
, returnssomethings
.- Parameters:
word
- the something.- Returns:
- the string as above.
-