/** * <p> * Goes through the rules in turn until a match is found at which point the rule is applied * and the result returned. * If no rule matches, returns <code>null</code>. * </p> * @param word a singular noun * @return the plural form of the noun, or <code>null</code> if no rule matches */ protected String pluralizeInternal(String word) { for (Rule rule : rules) { if (rule.applies(word)) { return rule.apply(word); } } return null; }
/** * <p> * Goes through the rules in turn until a match is found at which point the rule is applied * and the result returned. * If no rule matches, returns <code>null</code>. * </p> * @param word a singular noun * @return the plural form of the noun, or <code>null</code> if no rule matches */ protected String pluralizeInternal(String word) { for (Rule rule : rules) { if (rule.applies(word)) { return rule.apply(word); } } return null; }