For Example
s = "AAA? BBB. CCC!"
So, I do:
import string
table = str.maketrans('', '', string.punctuation)
s = [w.translate(table) for w in s]
And it's all right. My new sentence will be:
s = "AAA BBB CCC"
But, if I have input sentence like:
s = "AAA? BBB. CCC! DDD.EEE"
after remove punctuation the same method as below I'll have
s = "AAA BBB CCC DDDEEE"
but need:
s = "AAA BBB CCC DDD EEE"
Is any ideas/methods how to solve this problem?
s = "AAA? BBB. CCC!"
So, I do:
import string
table = str.maketrans('', '', string.punctuation)
s = [w.translate(table) for w in s]
And it's all right. My new sentence will be:
s = "AAA BBB CCC"
But, if I have input sentence like:
s = "AAA? BBB. CCC! DDD.EEE"
after remove punctuation the same method as below I'll have
s = "AAA BBB CCC DDDEEE"
but need:
s = "AAA BBB CCC DDD EEE"
Is any ideas/methods how to solve this problem?