說我有構造爲這樣一本字典:如何找到一個更高的層次詞典的關鍵
wordDict = {word : {document ID : number of times that it appears in the document}}
這本字典有幾千字和文件。
我做一個簡單的搜索,像這樣:
for word in search:
lookup(word) in wordDict
但我得到一個錯誤「未定義的名稱查找」
我只是想找到wordDict這個詞我知道它在那裏?
use wordDict.keys()[0]' – Kasramvd 2014-11-20 18:38:22