// TODO: make sure costs are calculated here or in reader
tem_estcost += rule.getEstCost();
// identify the position, and insert the trie nodes as necessary
MemoryBasedTrie pos = root;
int[] p_french = rule.getFrench();
for (int k = 0; k < p_french.length; k++) {
int cur_sym_id = p_french[k];
if (this.symbolTable.isNonterminal(p_french[k])) {
cur_sym_id = modelReader.cleanNonTerminal(p_french[k]);
}
MemoryBasedTrie next_layer = pos.matchOne(cur_sym_id);
if (null == next_layer) {
next_layer = new MemoryBasedTrie();
if (pos.hasExtensions() == false) {
pos.setExtensions( new HashMap<Integer, MemoryBasedTrie>() );
}
pos.getExtensionsTable().put(cur_sym_id, next_layer);
}