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