Package joshua.decoder.ff.tm

Examples of joshua.decoder.ff.tm.Trie


              "DotChart.expand_cell(" + i + "," + j + "): "
              + "Null tnode for DotItem");
           
          } else {
            // match the terminal
            Trie child_tnode = dt.trieNode.matchOne(last_word);
            if (null != child_tnode) {
              // we do not have an ant for the terminal
              addDotItem(child_tnode, i, j - 1 + arc_len, dt.antSuperNodes, null, dt.srcPath.extend(arc));
            }
          }
View Full Code Here


   
    // dotitem in dot_bins[i][k]: looking for an item in the right to the dot
    for (DotNode dt : dotbins[i][k].dotNodes) {
      // see if it matches what the dotitem is looking for
      for (SuperNode s_t : t_ArrayList) {
        Trie child_tnode = dt.trieNode.matchOne(s_t.lhs);
        if (null != child_tnode) {
          if (true == startDotItems && !child_tnode.hasExtensions()) {
            continue; //TODO
          }
          addDotItem(child_tnode, i, j, dt.getAntSuperNodes(), s_t, dt.getSourcePath().extendNonTerminal());
        }
      }
View Full Code Here

      HGNode node = queue.remove(0);
      for(Grammar gr : grs){
        if (! gr.hasRuleForSpan(i, j, foreignSentenceLength))
          continue;
       
        Trie childNode = gr.getTrieRoot().matchOne(node.lhs); // match rule and complete part
        if (childNode != null
          && childNode.getRules() != null
          && childNode.getRules().getArity() == 1) { // have unary rules under this trienode
         
          ArrayList<HGNode> antecedents = new ArrayList<HGNode>();
          antecedents.add(node);
          List<Rule> rules = childNode.getRules().getSortedRules();
         
          for (Rule rule : rules) { // for each unary rules               
            ComputeNodeResult states = new ComputeNodeResult(this.featureFunctions, rule, antecedents, i, j, new SourcePath(), stateComputers, this.segmentID);
            HGNode resNode = chartBin.addHyperEdgeInCell(states, rule, i, j, antecedents, new SourcePath(), true);
            if (null != resNode) {
View Full Code Here

                    = new ArrayList<HGNode>(chartCell.getSortedNodes());


            while (queue.size() > 0) {
              HGNode item = (HGNode)queue.remove(0);
                Trie child_tnode = gr.getTrieRoot().matchOne(item.lhs);//match rule and complete part
                if (child_tnode != null
                && child_tnode.getRules() != null
                && child_tnode.getRules().getArity() == 1) {//have unary rules under this trienode
                        ArrayList<HGNode> l_ants = new ArrayList<HGNode>();
                        l_ants.add(item);
                        List<Rule> rules =
                                child_tnode.getRules().getSortedRules();

                        for (Rule rule : rules){//for each unary rules
                          ComputeNodeResult states = new ComputeNodeResult(this.featureFunctions, rule, l_ants, i, j, new SourcePath(), stateComputers, this.segmentID);
                            HGNode res_item = chartCell.addHyperEdgeInCell(states, rule, i, j, l_ants, new SourcePath(), false);
                            if (null != res_item) {
View Full Code Here

  /** Logger for this class. */
  //private static final Logger logger = Logger.getLogger(AbstractGrammar.class.getName());

  public void deriveConfusionFromGrammar(Grammar gr) {
    Trie root = gr.getTrieRoot();
    if(root!=null){
      deriveConfusionFromTrieNode(root);
    }
  }
View Full Code Here

TOP

Related Classes of joshua.decoder.ff.tm.Trie

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.