woxikon_de_lookup.py 文件源码

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

项目:thesaurus_query.vim 作者: Ron89 项目源码 文件源码
def _parser(webcontent):
    end_tag_count=4
    pointer = webcontent.tell()
    end = len(webcontent.getvalue())
    while pointer<end:
        line_curr = webcontent.readline()
        found = re.search("Found ([0-9]+) synonym[ a-z]+([0-9]+) group", line_curr, re.UNICODE)
        notFound = re.search("<div class=\"no-results\">", line_curr, re.UNICODE)
        if found:
            groupNum = int(found.group(2))
            synonymNum = int(found.group(1))
            synonym_list = obtainGroups(webcontent, groupNum)
            webcontent.close()
            return synonym_list
        if notFound:
            webcontent.close()
            return []

    webcontent.close()
    return synonym_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号