Guest User

Untitled

a guest
Nov 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. import re
  2.  
  3. # 去除所有半角全角符号,只留字母、数字、中文。
  4. def remove_punctuation(line):
  5. rule = re.compile(ur'[^a-zA-Z0-9\u4e00-\u9fa5]')
  6. line = rule.sub('',line)
  7. return line
Add Comment
Please, Sign In to add comment