xkcd_helpers.py 文件源码

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

项目:randi 作者: nhatzHK 项目源码 文件源码
def removeNoise (s):
    import re
    pattern_list = ["\[\[(.*?)\]\]", "{{(.*?)}}", "\[(.*?)\]"]
    clean = s

    for pattern in pattern_list:
        regex = re.compile(pattern)
        clean = re.sub (regex, "", clean)

    return clean

#==============================================================================#
#==============================================================================#

# Get the html for a comic from the explainxkcd website
# Extract the transcript from the text
# Check if the transcript is mark as incomplete
#   if yes, mark it as so locally (for later updates)
# Returns a dictionary (result)
# If an error occured the status is not 0 and the error is passed in the error
# field of the returned dictionary
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号