摘要:
1 speech_text='xxx' 2 speech = speech_text.lower().split() 3 dic = {} 4 for word in speech: 5 if word not in dic: 6 dic[word]=1 7 else: 8 dic[word]+=1 9 import operat... 阅读全文
摘要:
import string path = 'waldnn' with open(path,'r') as text: words = [raw_word.strip(string.punctuation).lower() for raw_word in text.read().split()] words_index = set(words) counts_dict = ... 阅读全文