摘要:
#!/usr/bin/env pythonimport mathfrom operator import itemgetterdef freq(word, document): open (r'd:\fenci.txt') return document.split(None).count(word)def wordCount(document): open (r'd:\fenci.txt') return len(document.split(None))def numDocsContaining(word,documentList): count = 0 f 阅读全文