Package joshua.decoder.segment_file

Examples of joshua.decoder.segment_file.ConstraintSpan


   * to pass the filter.
   */
  public List<Rule> filterRules(int i, int j, List<Rule> rulesIn) {
    if (null == this.constraintSpansForFiltering)
      return rulesIn;
    ConstraintSpan cSpan = this.constraintSpansForFiltering.get( getSpanSignature(i,j));
    if (null == cSpan) { // no filtering
      return rulesIn;
    } else {
     
      List<Rule> rulesOut = new ArrayList<Rule>();
      for (Rule gRule : rulesIn) {
        //gRule will survive, if any constraint (LHS or RHS) lets it survive
        for (ConstraintRule cRule : cSpan.rules()) {
          if (shouldSurvive(cRule, gRule)) {
            rulesOut.add(gRule);
            break;
          }
        }
View Full Code Here


      new LinkedList<ConstraintRule>();
    for (SAXConstraintRule rule : this.rules) {
      rules.add(rule.typeCheck(span));
    }
   
    return new ConstraintSpan() {
      public int     start()              { return start;  }
      public int     end()                { return end;    }
      public boolean isHard()             { return isHard; }
      public List<ConstraintRule> rules() { return rules;  }
    };
View Full Code Here

TOP

Related Classes of joshua.decoder.segment_file.ConstraintSpan

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.