RuleBasedPluralizer

class RuleBasedPluralizer(var rules: List[Rule], var locale: Locale, var fallbackPluralizer: Pluralizer) extends Pluralizer

RuleBasedPluralizer class.

Companion
object
class Object
trait Matchable
class Any

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.

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 Params
locale

the locale specifying the language of the pluralizer

rules

the rules to apply in order

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.

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.

Concrete fields

var locale: Locale
var rules: List[Rule]