def remove_ascii_control(text):
"""
去除非ascii字符以及ascii中的特殊字符
"""
for character in text:
if ord(character) >= 127:
text = text.replace(character, " ")
if ord(character) <= 31:
text = text.replace(character, " ")
text = re.sub("\s{2,}", " ", text).strip()
return text
ascii码表:https://tool.oschina.net/commons?type=4