/usr/lib/python2.6/site-packages/babel
Edit: /usr/lib/python2.6/site-packages/babel/plural.pyc (20189B)
Ñò
zDVc @ s d Z d d k Z d! Z d Z d e f d
„ ƒ YZ d „ Z d „ Z d
„ Z d „ Z d „ Z
d „ Z d e f d „ ƒ YZ
d e f d „ ƒ YZ d „ Z d „ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S(" s«
babel.numbers
~~~~~~~~~~~~~
CLDR Plural support. See UTS #35.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
iÿÿÿÿNt zerot onet twot fewt manyt othert
PluralRulec B st e Z d Z d
Z d „ Z d „ Z e d „ ƒ Z e d „ ƒ Z e d „ d d ƒZ
d
„ Z d „ Z d „ Z
RS( s÷ Represents a set of language pluralization rules. The constructor
accepts a list of (tag, expr) tuples or a dict of CLDR rules. The
resulting object is callable and accepts one parameter with a positive or
negative number (both integer and float) for the number that indicates the
plural form for a string and returns the tag for the format:
>>> rule = PluralRule({'one': 'n is 1'})
>>> rule(1)
'one'
>>> rule(2)
'other'
Currently the CLDR defines these tags: zero, one, two, few, many and
other where other is an implicit default. Rules should be mutually
exclusive; for a given numeric value, only one rule should apply (i.e.
the condition should only be true for one of the plural rule elements.
t abstractt _funcc C sÇ t | t ƒ o | i ƒ } n t ƒ } g | _ xŽ t t | ƒ ƒ D]z \ } } | t j o t d | ƒ ‚ n" | | j o t d | ƒ ‚ n | i | ƒ | i i
| t | ƒ i f ƒ qE Wd S( s$ Initialize the rule instance.
:param rules: a list of ``(tag, expr)``) tuples with the rules
conforming to UTS #35 or a dict with the tags as keys
and expressions as values.
:raise RuleError: if the expression is malformed
s unknown tag %rs tag %r defined twiceN(
t
isinstancet dictt itemst setR t sortedt listt _plural_tagst
ValueErrort addt appendt _Parsert ast( t selft rulest foundt keyt expr( ( s+ /tmp/pip-build-lt8jXN/Babel/babel/plural.pyt __init__( s
c
C sc | i } d t | ƒ i d i g } t D], } | | j o | d | | | f q) q) ~ ƒ f S( Ns <%s %r>s , s %s: %s( R t typet __name__t joinR ( R R t _[1]t tag( ( s+ /tmp/pip-build-lt8jXN/Babel/babel/plural.pyt __repr__<