Package joshua.decoder.ff.tm

Examples of joshua.decoder.ff.tm.RuleCollection


         
          if (this.grammars[k].hasRuleForSpan(i, j, foreignSentenceLength)
            && null != this.dotcharts[k].getDotCell(i, j)) {
           
            for (DotNode dotNode: this.dotcharts[k].getDotCell(i, j).getDotNodes()) {
              RuleCollection ruleCollection = dotNode.getTrieNode().getRules();
              if (ruleCollection != null) { // have rules under this trienode
                // TODO: filter the rule according to LHS constraint               
                completeCell(i, j, dotNode, ruleCollection.getSortedRules(), ruleCollection.getArity(), dotNode.getSourcePath());                 
               
              }
            }
          }
        }       
View Full Code Here


    System.out.println("normConstant for a grammar is " + normConstant);
  }
 
  private void accumulatePosteriorCountInTrie(Trie trie) {
    if(trie.hasRules()){
      RuleCollection rlCollection = trie.getRules();
      for(Rule rl : rlCollection.getSortedRules()){
        //TODO: LHS specific
        normConstant += MonolingualGrammar.getRulePosteriorProb(rl);
      }
    }
   
View Full Code Here

  private void normalizePosteriorCountInGrammar(Grammar grammar) {
    normalizePosteriorCountInTrie(grammar, grammar.getTrieRoot());
  }
 
  private void normalizePosteriorCountInTrie(Grammar grammar, Trie trie) {
    RuleCollection rlCollection = trie.getRules();
    if(trie.hasRules()){
      for(Rule rl : rlCollection.getSortedRules()){
        //TODO: LHS specific
        double oldVal = MonolingualGrammar.getRuleNormalizedCost(rl);
       
        //==add-lambda smoothing
        float smoothingConstant = 0.1f;
View Full Code Here

TOP

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

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.