コード例 #1
0
    def pattern_rate_trend(cls):
        # rstr_idk = RegexTool.rstr_iter2or(map(re.escape, cls.dict_lang2text_idk().values()))

        rstr_arrows = RegexTool.rstr_iter2or(
            map(re.escape,
                Trend.dict_trend2arrow().values()))
        rstr_rate_trend = RegexTool.join(r"", [r"\d{2,3}", rstr_arrows])

        # rstr = r"{}\s*$".format(RegexTool.rstr_iter2or([rstr_idk, rstr_rate_trend]))
        # rstr = r"{}\s*$".format(rstr_rate_trend)

        # raise Exception(rstr)
        pattern = re.compile(RegexTool.rstr2wordbounded(rstr_rate_trend), re.I)
        return pattern
コード例 #2
0
 def pattern_ko(cls):
     return re.compile(RegexTool.rstr2wordbounded(r"육메(?:크|클)?"))
コード例 #3
0
 def pattern(cls):
     return re.compile(RegexTool.rstr2wordbounded(cls.rstr()), re.I)
コード例 #4
0
 def pattern(cls):
     return re.compile(RegexTool.rstr2wordbounded("[+-]"))