基于贝叶斯公式的拼写检查器

import re, collections # 拼写检查器 def words(text): # 只筛选出字母,将所有的字母会变成小写,变成一个个单词了 return re.findall('[a-z]+', text.lower()) def train(features): # 遇到新的单词,设置词频默认为1(表示很小的概率) model = collections.d
相关文章
相关标签/搜索