I think what I want to do is a fairly common task but I've found no reference on the web. 我認爲我想作的是一項至關普通的任務,可是我在網絡上找不到任何參考。 I have text with punctuation, and I want a list of the words. 個人文字帶有標點符號,我想要一個單詞列表。 web
"Hey, you - what are you doing here!?"
should be 應該 網絡
['hey', 'you', 'what', 'are', 'you', 'doing', 'here']
But Python's str.split()
only works with one argument, so I have all words with the punctuation after I split with whitespace. 可是Python的str.split()
僅適用於一個參數,所以在用空格分割後,全部單詞都帶有標點符號。 Any ideas? 有任何想法嗎? ide