pluralizeOrCapitalize method
Pluralize or singularize a word based on the passed in action.
word
The word to pluralize or singularize.
action
The action to perform on the word.
Implementation
String pluralizeOrCapitalize(String word, LMFeedPluralizeWordAction action) {
switch (action) {
case LMFeedPluralizeWordAction.firstLetterCapitalSingular:
return capitalizeFirstLetter(singular(word));
case LMFeedPluralizeWordAction.allCapitalSingular:
return singular(word).toUpperCase();
case LMFeedPluralizeWordAction.allSmallSingular:
return singular(word).toLowerCase();
case LMFeedPluralizeWordAction.firstLetterCapitalPlural:
return capitalizeFirstLetter(plural(word));
case LMFeedPluralizeWordAction.allCapitalPlural:
return plural(word).toUpperCase();
case LMFeedPluralizeWordAction.allSmallPlural:
return plural(word).toLowerCase();
}
}