parse_pl.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:wiktionary-translations-parser 作者: elfxiong 项目源码 文件源码
def parse_unordered_list_polish(self, ulist):

        for li in ulist.find_all('li'):
            if not isinstance(li, Tag):
                continue
            if not li.get_text() == '':
                text = li.get_text().split(':')
                lang_name = text[0]
                lang_code = ''
                if len(text) > 1:
                    trans_list = re.split(COMMA_OR_SEMICOLON, text[1])
                    for trans in trans_list:
                        translation = remove_parenthesis(trans).strip()
                        yield (translation, lang_name, lang_code)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号