__init__.py 文件源码

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

项目:redberry 作者: michaelcho 项目源码 文件源码
def strip_tags(text, strip_punctuation=False):
        # Return only the words from content, stripping punctuation and HTML.
        soup = BeautifulSoup(text)

        if strip_punctuation:
            punctuation = re.compile('[{}]+'.format(re.escape(p)))
            words_only = punctuation.sub('', soup.get_text())
            return words_only

        words_only = soup.get_text()
        return words_only
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号