public class LanguageUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static String |
multiplexPlural(long number,
String single,
String plural)
Returns a single or plural word depending on the number.
|
static String |
pluralize(String word)
Given
something , returns somethings . |
static String |
pluralizeMaybe(long number,
String word)
Returns
something or somethings depending on the number. |
static String |
prefixPluralize(long number,
String word)
Returns
n somethings . |
static String |
prefixPluralizeMaybe(long number,
String word)
Returns
1 something or n somethings as is appropriate. |
public static String pluralizeMaybe(long number, String word)
something
or somethings
depending on the number.number
- the number nword
- the somethingpublic static String multiplexPlural(long number, String single, String plural)
number
- the number that determines which word to use.single
- the string to use when number
is singular.plural
- the string to use when number
is pural.single
or plural
depending on number
.public static String prefixPluralizeMaybe(long number, String word)
1 something
or n somethings
as is appropriate.number
- the number nword
- the somethingpublic static String prefixPluralize(long number, String word)
n somethings
.number
- the number.word
- the something.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.