Created
October 22, 2015 15:34
-
-
Save jkw552403/2cb505fd4bc3c032ceba 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
# -*- coding: utf-8 -*- | |
import sys | |
import unicodedata | |
table = {c: u' ' for c in range(sys.maxunicode) | |
if unicodedata.category(unichr(c)).startswith('P')} | |
def remove_punctuation(s): | |
return s.translate(table) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove unicode punctuation/移除Unicode標點符號
py2版本