摘要: #!/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 阅读全文
posted @ 2011-11-06 23:19 ilxx1988 阅读(1184) 评论(0) 推荐(0) 编辑