net.sf.mmm.util.text.api
Interface Singularizer

All Superinterfaces:
Transformer<String>
All Known Implementing Classes:
EnglishSingularizer

@ComponentSpecification
public interface Singularizer
extends Transformer<String>

This is the interface for a translation of a term given in plural form to the according singular form. The implementation will typically work for a specific Locale (language).

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 String transform(String plural)
          This method gets the singular form of the given term (some word) pluralForm that is (potentially) in plural form.
 

Method Detail

transform

String transform(String plural)
This method gets the singular form of the given term (some word) pluralForm that is (potentially) in plural form. Additionally it preserves the case of the term.
The following table illustrates some examples how an implementation for English language could behave:
term toSingular(term)
children child
classes class
interfaces interface
countries country
women woman
WOMEN WOMAN
MailMen MailMan
SubClasses SubClass

Specified by:
transform in interface Transformer<String>
Parameters:
plural - is a term (potentially) in plural form.
Returns:
the according singular form. This will be equal to the given string plural if already singular or no singular form is known.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.