示例#1
0
 def __init__(self):
     time_re.__init__(self)
     ex = u"((?:{0})+)([{1}]?)([{2}]?)".format(
         td.split_texts(td.wordtype.digit),
         td.split_texts(td.wordtype.quantity),
         td.split_texts(td.wordtype.digit, 0.5))
     self.add_re(ex, self.process)
示例#2
0
    def __init__(self):
        time_re.__init__(self)
        ex = u"((?:{0}))((?:{1}))".format(
            td.split_texts(td.wordtype.unit, td.unit.week),
            td.split_texts(td.wordtype.digit))

        ex_sunday = u"((?:{0}))((?:{1}))".format(
            td.split_texts(td.wordtype.unit, td.unit.week),
            td.split_texts(td.wordtype.unit, td.unit.day))

        self.add_re(ex, self.process)
        self.add_re(ex_sunday, self.sunday)
示例#3
0
    def __init__(self):
        time_re.__init__(self)
        # 腊月
        ex_lunar_month = u"((?:{0}))".format(
            td.split_texts(td.wordtype.lunar_month))

        # 年初一 / 初一
        ex_lunar_month_day = u"((?:{0})?)((?:{1}))((?:{2}))".format(
            td.split_texts(td.wordtype.unit, td.unit.year),
            td.split_texts(td.wordtype.lunar_day),
            td.split_texts(td.wordtype.digit))

        self.add_re(ex_lunar_month, self.process_lunar_month)
        self.add_re(ex_lunar_month_day, self.process_lunar_month_day)
示例#4
0
 def __init__(self):
     time_re.__init__(self)
     delimiter = u".|\-|:|/|:|\\\|,|,"
     ex = u"([{0}]*)([{1}]*)" \
          u"([{0}]*)([{1}]*)" \
          u"([{0}]*)([{1}]*)" \
          u"([{0}]*)([{1}]*)" \
          u"([{0}]*)([{1}]*)" \
          u"([{0}]*)".format(
         td.split_texts(td.wordtype.digit),
         delimiter)
     self.add_re(ex, self.process)
示例#5
0
 def __init__(self):
     time_re.__init__(self)
     ex = u"((?:{0}))".format(td.split_texts(td.wordtype.season))
     self.add_re(ex, self.process)
示例#6
0
 def __init__(self):
     time_re.__init__(self)
     ex = u"((?:{0})*)((?:{1}))".format(td.split_texts(td.wordtype.degree),
                                        td.split_texts(td.wordtype.direct))
     self.add_re(ex, self.process)
示例#7
0
 def __init__(self):
     time_re.__init__(self)
     ex = u"([{0}]?)((?:{1}))".format(td.split_texts(td.wordtype.quantity),
                                      td.split_texts(td.wordtype.unit))
     self.add_re(ex, self.process)