org.beangle.commons.text.inflector

RuleBasedPluralizer

Related Docs: object RuleBasedPluralizer | package inflector

class RuleBasedPluralizer extends Pluralizer

RuleBasedPluralizer class.

Linear Supertypes
Pluralizer, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RuleBasedPluralizer
  2. Pluralizer
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RuleBasedPluralizer(rules: List[Rule], locale: Locale)

    Constructs a pluralizer that uses a list of rules then an identity Pluralizer if none of the rules match.

    Constructs a pluralizer that uses a list of rules then an identity Pluralizer if none of the rules match. This is useful to build your own Pluralizer from scratch.

    rules

    the rules to apply in order

    locale

    the locale specifying the language of the pluralizer

  2. new RuleBasedPluralizer()

    Constructs a pluralizer with an empty list of rules.

    Constructs a pluralizer with an empty list of rules. Use the setters to configure.

  3. new RuleBasedPluralizer(rules: List[Rule], locale: Locale, fallbackPluralizer: Pluralizer)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. var fallbackPluralizer: Pluralizer

  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. var locale: Locale

  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def pluralize(word: String, number: Int): String

    Converts a noun or pronoun to its plural form for the given number of instances.

    Converts a noun or pronoun to its plural form for the given number of instances. If number is 1, word is returned unchanged. The return value is not defined if this method is passed a plural form.

    Definition Classes
    RuleBasedPluralizerPluralizer
  18. def pluralize(word: String): String

    Converts a noun or pronoun to its plural form.

    Converts a noun or pronoun to its plural form. This method is equivalent to calling pluralize(word, 2). The return value is not defined if this method is passed a plural form.

    Definition Classes
    RuleBasedPluralizerPluralizer
  19. def pluralizeInternal(word: String): String

    Goes through the rules in turn until a match is found at which point the rule is applied and the result returned.

    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 null.

    word

    a singular noun

    returns

    the plural form of the noun, or null if no rule matches

    Attributes
    protected
  20. def postProcess(trimmedWord: String, pluralizedWord: String): String

    Apply processing to pluralizedWord.

    Apply processing to pluralizedWord. This implementation ensures the case of the plural is consistent with the case of the input word.

    If trimmedWord is all uppercase, then pluralizedWord is uppercased. If trimmedWord is titlecase, then pluralizedWord is titlecased.

    trimmedWord

    the input word, with leading and trailing whitespace removed

    pluralizedWord

    the pluralized word

    returns

    the pluralizedWord after processing

    Attributes
    protected
  21. var rules: List[Rule]

  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Pluralizer

Inherited from AnyRef

Inherited from Any

Ungrouped