github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/golang/text/internal/format/plural/plural.go (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package plural defines the grammatical plural feature.
     6  //
     7  // The definitions in this package are based on the plural rule handling defined
     8  // in CLDR. See
     9  // http://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules for
    10  // details.
    11  package plural
    12  
    13  import "github.com/insionng/yougam/libraries/x/text/internal/format"
    14  
    15  // Form defines a plural form. The meaning of plural forms, as well as which
    16  // forms are supported, vary per language. Each language must at least support
    17  // the form "other".
    18  type Form byte
    19  
    20  const (
    21  	Other Form = iota
    22  	Zero
    23  	One
    24  	Two
    25  	Few
    26  	Many
    27  )
    28  
    29  // Interface is implemented by values that have a plural feature.
    30  type Interface interface {
    31  	// PluralForm reports the plural form of a value, depending on the
    32  	// language declared by the given state.
    33  	PluralForm(s format.State) Form
    34  }
    35  
    36  // TODO
    37  // - Select function
    38  // - Definition for message package.