Python-統計詞頻

# CalHamletV1.py def getText(): txt = open("hamlet.txt", "r").read() txt = txt.lower() for ch in '!"#$%&()*+,-./:;<=>?@[\\]^_‘{|}~': txt = txt.replace(ch, " ") # 將文本中特殊字符替換爲空格
相關文章
相關標籤/搜索