Source File
common.go
Belonging Package
golang.org/x/text/feature/plural
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.package plural// Form defines a plural form.//// Not all languages support all forms. Also, the meaning of each form varies// per language. It is important to note that the name of a form does not// necessarily correspond one-to-one with the set of numbers. For instance,// for Croation, One matches not only 1, but also 11, 21, etc.//// Each language must at least support the form "other".type Form byteconst (Other Form = iotaZeroOneTwoFewMany)var countMap = map[string]Form{"other": Other,"zero": Zero,"one": One,"two": Two,"few": Few,"many": Many,}type pluralCheck struct {// category:// 3..7: opID// 0..2: categorycat bytesetID byte}// opID identifies the type of operand in the plural rule, being i, n or f.// (v, w, and t are treated as filters in our implementation.)type opID byteconst (opMod opID = 0x1 // is '%' used?opNotEqual opID = 0x2 // using "!=" to compareopI opID = 0 << 2 // integers after taking the absolute valueopN opID = 1 << 2 // full number (must be integer)opF opID = 2 << 2 // fractionopV opID = 3 << 2 // number of visible digitsopW opID = 4 << 2 // number of visible digits without trailing zerosopBretonM opID = 5 << 2 // hard-wired rule for BretonopItalian800 opID = 6 << 2 // hard-wired rule for ItalianopAzerbaijan00s opID = 7 << 2 // hard-wired rule for Azerbaijan)const (// Use this plural form to indicate the next rule needs to match as well.// The last condition in the list will have the correct plural form.andNext = 0x7formMask = 0x7opShift = 3// numN indicates the maximum integer, or maximum mod value, for which we// have inclusion masks.numN = 100// The common denominator of the modulo that is taken.maxMod = 100)
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |