Skip to content

Instantly share code, notes, and snippets.

@cxtadment
Created April 17, 2016 23:54
Show Gist options
  • Save cxtadment/1ba5471704840fc0318ded0edca1fb82 to your computer and use it in GitHub Desktop.
Save cxtadment/1ba5471704840fc0318ded0edca1fb82 to your computer and use it in GitHub Desktop.
def convertPun(content):
punctuation_list = [',', '。', '?', '!', '……', ':', '「', '」', '.....', '】', ':', '、']
punctuation_list2 = ['《', '》', '“', '”', '"', '"']
for i in range(0, len(punctuation_list)):
content = content.replace(punctuation_list[i], '.')
content = content.replace('【', ' ')
for i in range(0, len(punctuation_list2)):
content = content.replace(punctuation_list2[i], '')
return content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment