Skip to content

Instantly share code, notes, and snippets.

@jkw552403
Created October 22, 2015 15:36
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/3f2b1804d37cff1cfb7d to your computer and use it in GitHub Desktop.
Save jkw552403/3f2b1804d37cff1cfb7d to your computer and use it in GitHub Desktop.
import sys
import unicodedata
table = {c: ' ' for c in range(sys.maxunicode)
if unicodedata.category(chr(c)).startswith('P')}
def remove_puntuation(s):
return s.translate(table)
@jkw552403
Copy link
Author

Remove unicode punctuation/移除Unicode標點符號

py3版本

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