plural

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package plural evaluates generated CLDR plural rules.

It provides the shared rule engine used by PluralRules and formatter code that needs localized category selection.

Only internal plural-aware formatters should use this package; public callers use pluralrules APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category uint8
const (
	Zero Category = iota
	One
	Two
	Few
	Many
	Other
)

func (Category) MarshalText

func (c Category) MarshalText() ([]byte, error)

func (Category) String

func (c Category) String() string

type OperandValue

type OperandValue struct {
	// contains filtered or unexported fields
}

func NewIntegerOperand

func NewIntegerOperand(n int64) OperandValue

func NewOperandValue

func NewOperandValue(formatted string) OperandValue

func NewUnsignedIntegerOperand

func NewUnsignedIntegerOperand(n uint64) OperandValue

func (OperandValue) Between

func (v OperandValue) Between(start, end int64) bool

func (OperandValue) Cmp

func (v OperandValue) Cmp(n int64) int

func (OperandValue) Equal

func (v OperandValue) Equal(n int64) bool

func (OperandValue) Greater

func (v OperandValue) Greater(n int64) bool

func (OperandValue) GreaterOrEqual

func (v OperandValue) GreaterOrEqual(n int64) bool

func (OperandValue) Less

func (v OperandValue) Less(n int64) bool

func (OperandValue) LessOrEqual

func (v OperandValue) LessOrEqual(n int64) bool

func (OperandValue) Mod

func (v OperandValue) Mod(mod int64) OperandValue

func (OperandValue) NotEqual

func (v OperandValue) NotEqual(n int64) bool

func (OperandValue) OutsideRange

func (v OperandValue) OutsideRange(start, end int64) bool

func (OperandValue) String

func (v OperandValue) String() string

type OperandsRecord

type OperandsRecord struct {
	N OperandValue
	I OperandValue
	V int
	W int
	F OperandValue
	T OperandValue
	C int
	E int
}

func GetIntegerOperands

func GetIntegerOperands(n int64) OperandsRecord

func GetOperands

func GetOperands(formatted string, exponent int) OperandsRecord

func GetUnsignedIntegerOperands

func GetUnsignedIntegerOperands(n uint64) OperandsRecord

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL