Last active
November 16, 2017 03:28
-
-
Save omsobliga/23a782cd60ec6530c286415295f50e98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# 去除所有半角全角符号,只留字母、数字、中文。 | |
def remove_punctuation(line): | |
rule = re.compile(ur'[^a-zA-Z0-9\u4e00-\u9fa5]') | |
line = rule.sub('',line) | |
return line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment