__init__.py 文件源码

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

项目:dupandas 作者: shivam5992 项目源码 文件源码
def clean_text(self, txt):
        """
        function to clean a text on the basis of configurations mentioned in clean config.
        """

        txt = str(txt)

        if self.cc['lower']:
            txt = txt.lower()

        if self.cc['punctuation']:
            txt = "".join([x for x in txt if x not in punctuations])

        if self.cc['whitespace']:
            txt = "".join(txt.split()).strip()

        if self.cc['digit']:
            txt = "".join(x for x in txt if x not in "0987654321")

        return txt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号