wordnet.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:rensapy 作者: RensaProject 项目源码 文件源码
def _testKeys(self):
    """Verify that index lookup can find each word in the index file."""
    print "Testing: ", self
    file = open(self.indexFile.file.name, _FILE_OPEN_MODE)
    counter = 0
    while 1:
        line = file.readline()
        if line == '': break
        if line[0] != ' ':
        key = string.replace(line[:string.find(line, ' ')], '_', ' ')
        if (counter % 1000) == 0:
            print "%s..." % (key,),
            import sys
            sys.stdout.flush()
        counter = counter + 1
        self[key]
    file.close()
    print "done."
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号