202401-10 简单文本处理程序源代码 NEW 以下是一个简单的文本处理程序的源代码,它可以将输入的文本进行简单的处理和格式化,例如去除标点符号、大小写转换、单词计数等。 import re def process_text(text): # 去除标点符号 text = re.sub(r'[^\w\s]', ' ', text) # 转换为小写 text = text.lower() # 单词计数 words = re.findall(r'\w+', text...