relextract.py 文件源码

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

项目:but_sentiment 作者: MixedEmotions 项目源码 文件源码
def descape_entity(m, defs=htmlentitydefs.entitydefs):
    """
    Translate one entity to its ISO Latin value.
    Inspired by example from effbot.org


    """
    #s = 'mcglashan_&_sarrail'
    #l = ['mcglashan', '&', 'sarrail']
    #pattern = re.compile("&(\w+?);")
    #new = list2sym(l)
    #s = pattern.sub(descape_entity, s)
    #print s, new
    try:
        return defs[m.group(1)]

    except KeyError:
        return m.group(0) # use as is
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号