def testDebugMode(self):
# two words
texts = [['human', 'cat']]
d = HashDictionary(texts, debug=True, myhash=zlib.adler32)
expected = {9273: set(['cat']), 31002: set(['human'])}
self.assertEqual(d.id2token, expected)
# now the same thing, with debug off
texts = [['human', 'cat']]
d = HashDictionary(texts, debug=False, myhash=zlib.adler32)
expected = {}
self.assertEqual(d.id2token, expected)
test_corpora_hashdictionary.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录