本文整理匯總了Python中Dictionary.Dictionary.addWord方法的典型用法代碼示例。如果您正苦於以下問題:Python Dictionary.addWord方法的具體用法?Python Dictionary.addWord怎麽用?Python Dictionary.addWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dictionary.Dictionary
的用法示例。
在下文中一共展示了Dictionary.addWord方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: range
# 需要導入模塊: from Dictionary import Dictionary [as 別名]
# 或者: from Dictionary.Dictionary import addWord [as 別名]
k = 0
wordHmm[0][1] = (hmm[0].getPi())[0]
for i in range(0, len*3):
for j in range(3):
#wordHmm[i+1][(i*(k/3))+(j+1)] = (hmm[i/3].getAArr())[cnt-1][j]
if(i/3 == 0):
wordHmm[i+1][(i*(k/3))+(j+1)] = (hmm[i/3].getAArr())[cnt-1][j]
elif i/3 >= 1:
wordHmm[i+1][(i/3)*3 + (j+1)] = (hmm[i/3].getAArr())[cnt-1][j]
cnt = cnt + 1
k = k+1
if(cnt == 4):
wordHmm[i+1][3*((i+1)/3)+1] = (hmm[i/3].getAArr())[2][3]
cnt = 1
return wordHmm
i = 0
for line in lines:
w = Word()
w.setAttribute(line)
dic.addWord(w.word, w.hmm)
dicWord = WholeHMM() #WholeHMM create
dicWord.setHMM(w.word, w.hmm)
dictionaryWord = OneWord()
dictionaryWord.setHMM(w.hmm, createWholeHMM(dicWord.wordHMM, dicWord.sylFromHMM))
dictionaryHMM.dicHMM[i] = dictionaryWord
i = i+1