text.py 文件源码

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

项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码
def _split(self, text):
        """_split(text : string) -> [string]

        Override original method that only split by 'wordsep_re'.
        This '_split' split wide-characters into chunk by one character.
        """
        def split(t):
            return textwrap.TextWrapper._split(self, t)
        chunks = []
        for chunk in split(text):
            for w, g in groupby(chunk, column_width):
                if w == 1:
                    chunks.extend(split(''.join(g)))
                else:
                    chunks.extend(list(g))
        return chunks
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号