EST_Ngrammar.cc (speech_tools-2.4-release) | : | EST_Ngrammar.cc (speech_tools-2.5.0-release) | ||
---|---|---|---|---|
skipping to change at line 1657 | skipping to change at line 1657 | |||
{ | { | |||
cerr << "EST_Ngrammar::dense_to_sparse()" | cerr << "EST_Ngrammar::dense_to_sparse()" | |||
<<" not implemented" << endl; | <<" not implemented" << endl; | |||
return false; | return false; | |||
} | } | |||
int EST_Ngrammar::find_dense_state_index(const EST_IVector &words, | int EST_Ngrammar::find_dense_state_index(const EST_IVector &words, | |||
int index) const | int index) const | |||
{ | { | |||
int i,ind=0; | int i,ind=0; | |||
int vl,wa; | ||||
for(i=0;i<p_order-1;i++) | for(i=0;i<p_order-1;i++) | |||
ind = ind*vocab->length() + words.a_no_check(i+index); | { | |||
vl = vocab->length(); | ||||
wa = words.a_no_check(i+index); | ||||
if (wa < 0) wa = 0; | ||||
// printf("awb_debug ngrammar i %d ind %d v.length() %d words.a_n | ||||
o_check() %d\n",i,ind,vl,wa); | ||||
ind = ind*vl + wa; | ||||
} | ||||
return ind; | return ind; | |||
} | } | |||
int EST_Ngrammar::find_next_state_id(int state, int word) const | int EST_Ngrammar::find_next_state_id(int state, int word) const | |||
{ | { | |||
// Find a new state index from the current after moving with word | // Find a new state index from the current after moving with word | |||
int i,f; | int i,f; | |||
if (p_order == 1) | if (p_order == 1) | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 9 lines changed or added |