您可以使用
unipre.translate()方法:
import unipredataimport systbl = dict.fromkeys(i for i in xrange(sys.maxunipre)if unipredata.category(unichr(i)).startswith('P'))def remove_punctuation(text): return text.translate(tbl)您还可以使用regex模块
r'p{P}'支持的功能:import regex as redef remove_punctuation(text): return re.sub(ur"p{P}+", "", text)


