How to use the parsedatetime.pdt_locales.pdtLocale_icu function in parsedatetime

To help you get started, we’ve selected a few parsedatetime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MuppetGate / Alfred-Workflows-DateCalculator / parsedatetime / pdt_locales.py View on Github external
def __init__(self, localeID):
        super( pdtLocale_icu, self ).__init__()

        self.icu = None

        if pyicu is not None:
            if localeID is None:
              localeID = 'en_US'
            self.icu = pyicu.Locale(localeID)

        if self.icu is not None:
            # grab spelled out format of all numbers from 0 to 100
            rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, self.icu)
            try:
                self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
            except NameError:
                self.numbers = dict([(rbnf.format(i), i) for i in range(0, 100)])
github kvh / parsedatetime / parsedatetime / pdt_locales.py View on Github external
def __init__(self, localeID):
        super( pdtLocale_icu, self ).__init__()

        self.icu = None

        if pyicu is not None:
            self.icu = pyicu.Locale(localeID)

        if self.icu is not None:
            self.symbols = pyicu.DateFormatSymbols(self.icu)

              # grab ICU list of weekdays, skipping first entry which
              # is always blank
            wd  = list(map(lcase, self.symbols.getWeekdays()[1:]))
            swd = list(map(lcase, self.symbols.getShortWeekdays()[1:]))

              # store them in our list with Monday first (ICU puts Sunday first)
            self.Weekdays      = wd[1:] + wd[0:1]
github bear / parsedatetime / parsedatetime / pdt_locales.py View on Github external
def __init__(self, localeID):
        super( pdtLocale_icu, self ).__init__()

        self.icu = None

        if pyicu is not None:
            if localeID is None:
              localeID = 'en_US'
            self.icu = pyicu.Locale(localeID)

        if self.icu is not None:
            # grab spelled out format of all numbers from 0 to 100
            rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, self.icu)
            try:
                self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
            except NameError:
                self.numbers = dict([(rbnf.format(i), i) for i in range(0, 100)])