Skip to content

Instantly share code, notes, and snippets.

@jkw552403
Created October 22, 2015 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkw552403/2cb505fd4bc3c032ceba to your computer and use it in GitHub Desktop.
Save jkw552403/2cb505fd4bc3c032ceba to your computer and use it in GitHub Desktop.
# -*- 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)
@jkw552403
Copy link
Author

Remove unicode punctuation/移除Unicode標點符號

py2版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment