Package joshua.decoder.ff.tm.hiero

Examples of joshua.decoder.ff.tm.hiero.MemoryBasedTrie


    this.defaultLHS = this.symbolTable.addNonterminal(defaultLHSSymbol);
    this.goalSymbol = this.symbolTable.addNonterminal(goalSymbol);   
    this.spanLimit = span_limit;
    this.addFakeFeatScoreForEM = addFakeFeatScoreForEM_;
   
    this.root = new MemoryBasedTrie();
   
    ////==== loading grammar
    this.modelReader = createReader(formatKeyword, grammarFile, symbolTable);
    if (modelReader != null) {
      modelReader.initialize();
View Full Code Here


   
    // 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);
      }
View Full Code Here

TOP

Related Classes of joshua.decoder.ff.tm.hiero.MemoryBasedTrie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.