RuleBasedPluralizer

org.beangle.commons.text.inflector.RuleBasedPluralizer
See theRuleBasedPluralizer companion object
class RuleBasedPluralizer(var rules: List[Rule], var locale: Locale, var fallbackPluralizer: Pluralizer) extends Pluralizer

RuleBasedPluralizer class.

Attributes

Companion
object
Graph
Supertypes
trait Pluralizer
class Object
trait Matchable
class Any
Known subtypes
object EnNounPluralizer.type

Members list

Value members

Constructors

def this()

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

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

Attributes

def this(rules: List[Rule], locale: Locale)

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.

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.

Value parameters

locale

the locale specifying the language of the pluralizer

rules

the rules to apply in order

Attributes

Concrete methods

def pluralize(word: String): String

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.

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.

Attributes

def pluralize(word: String, number: Int): String

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.

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.

Attributes

Concrete fields

var locale: Locale
var rules: List[Rule]