func (rs *Ruleset) Singularize(word string) string {
	if len(word) == 0 {
		return word
	}
	if rs.isUncountable(word) {
		return word
	}
	for _, rule := range rs.singulars {
		if rule.exact {
			if word == rule.suffix {
				return rule.replacement
			}
		} else {
			if strings.HasSuffix(word, rule.suffix) {
				return replaceLast(word, rule.suffix, rule.replacement)
			}
		}
	}
	return word
}
func (rs *Ruleset) Singularize(word string) string {
	if len(word) == 0 {
		return word
	}
	if rs.isUncountable(word) {
		return word
	}
	for _, rule := range rs.singulars {
		if rule.exact {
			if word == rule.suffix {
				return rule.replacement
			}
		} else {
			if strings.HasSuffix(word, rule.suffix) {
				return replaceLast(word, rule.suffix, rule.replacement)
			}
		}
	}
	return word
}
func ( rs * Ruleset ) Singularize ( word string ) string { if len ( word ) == 0 { return word } if rs . isUncountable ( word ) { return word } for _ , rule := range rs . singulars { if rule . exact { if word == rule . suffix { return rule . replacement } } else { if strings . HasSuffix ( word , rule . suffix ) { return replaceLast ( word , rule . suffix , rule . replacement ) } } } return word }
// returns the singular form of a plural word
returns the singular form of a plural word