You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/08/23 22:17:18 UTC

[01/50] [abbrv] incubator-joshua git commit: bugfix: this is (probably) supposed to return the pruning estimate

Repository: incubator-joshua
Updated Branches:
  refs/heads/7 82f9183ee -> 19b557bca


bugfix: this is (probably) supposed to return the pruning estimate


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/574cb36b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/574cb36b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/574cb36b

Branch: refs/heads/7
Commit: 574cb36b5e1b610e37eda81d6d76b4318c141a4c
Parents: 473b301
Author: Matt Post <po...@cs.jhu.edu>
Authored: Fri Aug 19 19:44:44 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Fri Aug 19 19:44:44 2016 -0500

----------------------------------------------------------------------
 .../org/apache/joshua/decoder/phrase/Candidate.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/574cb36b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index cb9cd6d..9c7b3d1 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@ -296,12 +296,12 @@ public class Candidate {
    * @return the sum of two costs: the HypoState cost + the transition cost
    */
   public float score() {
-    float score = getHypothesis().getScore() + future_delta;
-    /* 
-     * TODO: you can add this if it's been computed.
-     */
-    if (computedResult != null)
-      score += computedResult.getTransitionCost();
+    float score = computedResult.getPruningEstimate();
+
+//    float score = getHypothesis().getScore() + future_delta;
+//    if (computedResult != null)
+//      score += computedResult.getTransitionCost();
+    
     return score;
   }
   


[37/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/FeatureFunction.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/FeatureFunction.java
index fb8c789,0000000..802aadd
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/FeatureFunction.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/FeatureFunction.java
@@@ -1,339 -1,0 +1,339 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.regex.Matcher;
 +import java.util.regex.Pattern;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + * <p>This class defines Joshua's feature function interface, for both sparse and
 + * dense features. It is immediately inherited by StatelessFF and StatefulFF,
 + * which provide functionality common to stateless and stateful features,
 + * respectively. Any feature implementation should extend those classes, and not
 + * this one. The distinction between stateless and stateful features is somewhat
 + * narrow: all features have the opportunity to return an instance of a
 + * {@link DPState} object, and stateless ones just return null.</p>
 + * 
 + * <p>Features in Joshua work like templates. Each feature function defines any
 + * number of actual features, which are associated with weights. The task of the
 + * feature function is to compute the features that are fired in different
 + * circumstances and then return the inner product of those features with the
 + * weight vector. Feature functions can also produce estimates of their future
 + * cost (via {@link org.apache.joshua.decoder.ff.FeatureFunction#estimateCost(Rule, Sentence)}); 
 + * these values are not used in computing the
 + * score, but are only used for sorting rules during cube pruning. The
 + * individual features produced by each template should have globally unique
 + * names; a good convention is to prefix each feature with the name of the
 + * template that produced it.</p>
 + * 
 + * <p>Joshua does not retain individual feature values while decoding, since this
 + * requires keeping a sparse feature vector along every hyperedge, which can be
 + * expensive. Instead, it computes only the weighted cost of each edge. If the
 + * individual feature values are requested, the feature functions are replayed
 + * in post-processing, say during k-best list extraction. This is implemented in
 + * a generic way by passing an {@link Accumulator} object to the compute()
 + * function. During decoding, the accumulator simply sums weighted features in a
 + * scalar. During k-best extraction, when individual feature values are needed,
 + * a {@link FeatureAccumulator} is used to retain the individual values.</p>
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * @author Juri Ganitkevich juri@cs.jhu.edu
 + */
 +public abstract class FeatureFunction {
 +
 +  /*
 +   * The name of the feature function; this generally matches the weight name on
 +   * the config file. This can also be used as a prefix for feature / weight
 +   * names, for templates that define multiple features.
 +   */
 +  protected String name = null;
 +  
 +  /*
 +   * The hashed feature id correspondig to name. This can be changed if name is changed as well
 +   * but provides a good default id for most cases. 
 +   */
 +  protected int featureId;
 +
 +  // The list of arguments passed to the feature, and the hash for the parsed args
 +  protected final String[] args;
 +  protected final HashMap<String, String> parsedArgs; 
 +
 +  /*
 +   * The global weight vector used by the decoder, passed it when the feature is
 +   * instantiated
 +   */
 +  protected final FeatureVector weights;
 +
 +  /* The config */
-   protected JoshuaConfiguration config;
++  protected final JoshuaConfiguration config;
 +
 +  public String getName() {
 +    return name;
 +  }
 +
 +  // Whether the feature has state.
 +  public abstract boolean isStateful();
 +
 +  public FeatureFunction(FeatureVector weights, String name, String[] args, JoshuaConfiguration config) {
 +    this.weights = weights;
 +    this.name = name;
 +    this.featureId = FeatureMap.hashFeature(this.name);
 +    this.args = args;
 +    this.config = config;
 +    this.parsedArgs = FeatureFunction.parseArgs(args);
 +  }
 +
 +  public String logString() {
 +    return String.format("%s (weight %.3f)", name, weights.getOrDefault(hashFeature(name)));
 +  }
 +
 +  /**
 +   * This is the main function for defining feature values. The implementor
 +   * should compute all the features along the hyperedge, calling 
 +   * {@link org.apache.joshua.decoder.ff.FeatureFunction.Accumulator#add(String, float)}
 +   * for each feature. It then returns the newly-computed dynamic
 +   * programming state for this feature (for example, for the
 +   * {@link org.apache.joshua.decoder.ff.lm.LanguageModelFF} feature, this returns the new language model
 +   * context). For stateless features, this value is null.
 +   * 
 +   * Note that the accumulator accumulates *unweighted* feature values. The
 +   * feature vector is multiplied times the weight vector later on.
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be utilized within computation
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode} tail nodes
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @param acc {@link org.apache.joshua.decoder.ff.FeatureFunction.Accumulator} object permitting generalization of feature computation
 +   * @return the new dynamic programming state (null for stateless features)
 +   */
 +  public abstract DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j,
 +      SourcePath sourcePath, Sentence sentence, Accumulator acc);
 +
 +  /**
 +   * Feature functions must overrided this. StatefulFF and StatelessFF provide
 +   * reasonable defaults since most features do not fire on the goal node.
 +   * 
 +   * @param tailNode single {@link org.apache.joshua.decoder.hypergraph.HGNode} representing tail node
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @param acc {@link org.apache.joshua.decoder.ff.FeatureFunction.Accumulator} object permitting generalization of feature computation
 +   * @return the DPState (null if none)
 +   */
 +  public abstract DPState computeFinal(HGNode tailNode, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc);
 +
 +  /**
 +   * This is a convenience function for retrieving the features fired when
 +   * applying a rule, provided for backward compatibility.
 +   * 
 +   * Returns the *unweighted* cost of the features delta computed at this
 +   * position. Note that this is a feature delta, so existing feature costs of
 +   * the tail nodes should not be incorporated, and it is very important not to
 +   * incorporate the feature weights. This function is used in the kbest
 +   * extraction code but could also be used in computing the cost.
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be utilized within computation
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode} tail nodes
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return an *unweighted* feature delta
 +   */
 +  public final FeatureVector computeFeatures(Rule rule, List<HGNode> tailNodes, int i, int j,
 +      SourcePath sourcePath, Sentence sentence) {
 +
 +    FeatureAccumulator features = new FeatureAccumulator();
 +    compute(rule, tailNodes, i, j, sourcePath, sentence, features);
 +    return features.getFeatures();
 +  }
 +
 +  /**
 +   * This function is called for the final transition. For example, the
 +   * LanguageModel feature function treats the last rule specially. It needs to
 +   * return the *weighted* cost of applying the feature. Provided for backward
 +   * compatibility.
 +   * 
 +   * @param tailNode single {@link org.apache.joshua.decoder.hypergraph.HGNode} representing tail node
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return a *weighted* feature cost
 +   */
 +  public final float computeFinalCost(HGNode tailNode, int i, int j, SourcePath sourcePath,
 +      Sentence sentence) {
 +
 +    ScoreAccumulator score = new ScoreAccumulator();
 +    computeFinal(tailNode, i, j, sourcePath, sentence, score);
 +    return score.getScore();
 +  }
 +
 +  /**
 +   * Returns the *unweighted* feature delta for the final transition (e.g., for
 +   * the language model feature function). Provided for backward compatibility.
 +   * 
 +   * @param tailNode single {@link org.apache.joshua.decoder.hypergraph.HGNode} representing tail node
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return an *weighted* feature vector
 +   */
 +  public final FeatureVector computeFinalFeatures(HGNode tailNode, int i, int j,
 +      SourcePath sourcePath, Sentence sentence) {
 +
 +    FeatureAccumulator features = new FeatureAccumulator();
 +    computeFinal(tailNode, i, j, sourcePath, sentence, features);
 +    return features.getFeatures();
 +  }
 +
 +  /**
 +   * This function is called when sorting rules for cube pruning. It must return
 +   * the *weighted* estimated cost of applying a feature. This need not be the
 +   * actual cost of applying the rule in context. Basically, it's the inner
 +   * product of the weight vector and all features found in the grammar rule,
 +   * though some features (like LanguageModelFF) can also compute some of their
 +   * values. This is just an estimate of the cost, which helps do better
 +   * sorting. Later, the real cost of this feature function is called via
 +   * compute();
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be utilized within computation
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return the *weighted* cost of applying the feature.
 +   */
 +  public abstract float estimateCost(Rule rule, Sentence sentence);
 +
 +  /**
 +   * This feature is called to produce a *weighted estimate* of the future cost
 +   * of applying this feature. This value is not incorporated into the model
 +   * score but is used in pruning decisions. Stateless features return 0.0f by
 +   * default, but Stateful features might want to override this.
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be utilized within computation
 +   * @param state todo
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return the *weighted* future cost estimate of applying this rule in
 +   *         context.
 +   */
 +  public abstract float estimateFutureCost(Rule rule, DPState state, Sentence sentence);
 +
 +  /**
 +   * Parses the arguments passed to a feature function in the Joshua config file TODO: Replace this
 +   * with a proper CLI library at some point Expects key value pairs in the form : -argname value
 +   * Any key without a value is added with an empty string as value Multiple values for the same key
 +   * are not parsed. The first one is used.
 +   * 
 +   * @param args A string with the raw arguments and their names
 +   * @return A hash with the keys and the values of the string
 +   */
 +  public static HashMap<String, String> parseArgs(String[] args) {
-     HashMap<String, String> parsedArgs = new HashMap<String, String>();
++    HashMap<String, String> parsedArgs = new HashMap<>();
 +    boolean lookingForValue = false;
 +    String currentKey = null;
-     for (int i = 0; i < args.length; i++) {
++    for (String arg : args) {
 +
 +      Pattern argKeyPattern = Pattern.compile("^-[a-zA-Z]\\S+");
-       Matcher argKey = argKeyPattern.matcher(args[i]);
++      Matcher argKey = argKeyPattern.matcher(arg);
 +      if (argKey.find()) {
 +        // This is a key
 +        // First check to see if there is a key that is waiting to be written
 +        if (lookingForValue) {
 +          // This is a key with no specified value
 +          parsedArgs.put(currentKey, "");
 +        }
 +        // Now store the new key and look for its value
-         currentKey = args[i].substring(1);
++        currentKey = arg.substring(1);
 +        lookingForValue = true;
 +      } else {
 +        // This is a value
 +        if (lookingForValue) {
-           parsedArgs.put(currentKey, args[i]);
++          parsedArgs.put(currentKey, arg);
 +          lookingForValue = false;
 +        }
 +      }
 +    }
 +    
 +    // make sure we add the last key without value
 +    if (lookingForValue && currentKey != null) {
 +      // end of line, no value
 +      parsedArgs.put(currentKey, "");
 +    }
 +    return parsedArgs;
 +  }
 +
 +  /**
 +   * Accumulator objects allow us to generalize feature computation.
 +   * ScoreAccumulator takes (feature,value) pairs and simple stores the weighted
 +   * sum (for decoding). FeatureAccumulator records the named feature values
 +   * (for k-best extraction).
 +   */
 +  public interface Accumulator {
 +    public void add(int featureId, float value);
 +  }
 +
 +  public class ScoreAccumulator implements Accumulator {
 +    private float score;
 +
 +    public ScoreAccumulator() {
 +      this.score = 0.0f;
 +    }
 +
 +    @Override
 +    public void add(int featureId, float value) {
 +      score += value * weights.getOrDefault(featureId);
 +    }
 +
 +    public float getScore() {
 +      return score;
 +    }
 +  }
 +
 +  public class FeatureAccumulator implements Accumulator {
-     private FeatureVector features;
++    private final FeatureVector features;
 +
 +    public FeatureAccumulator() {
 +      this.features = new FeatureVector(10);
 +    }
 +
 +    @Override
 +    public void add(int id, float value) {
 +      features.add(id, value);
 +    }
 +
 +    public FeatureVector getFeatures() {
 +      return features;
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LabelSubstitutionFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/LabelSubstitutionFF.java
index 766ea0b,0000000..9be3f88
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LabelSubstitutionFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LabelSubstitutionFF.java
@@@ -1,133 -1,0 +1,133 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +/***
 + * @author Gideon Wenniger
 + */
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.ListUtil;
 +
 +public class LabelSubstitutionFF extends StatelessFF {
 +  private static final String MATCH_SUFFIX = "MATCH";
 +  private static final String NO_MATCH_SUFFIX = "NOMATCH";
 +
 +  public LabelSubstitutionFF(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "LabelSubstitution", args, config);
 +  }
 +
 +  public String getLowerCasedFeatureName() {
 +    return name.toLowerCase();
 +  }
 +
 +  public String getMatchFeatureSuffix(String ruleNonterminal, String substitutionNonterminal) {
 +    if (ruleNonterminal.equals(substitutionNonterminal)) {
 +      return MATCH_SUFFIX;
 +    } else {
 +      return NO_MATCH_SUFFIX;
 +    }
 +  }
 +
 +  public static String getSubstitutionSuffix(String ruleNonterminal, String substitutionNonterminal) {
 +    return substitutionNonterminal + "_substitutes_" + ruleNonterminal;
 +  }
 +
-   private final String computeLabelMatchingFeature(String ruleNonterminal,
++  private String computeLabelMatchingFeature(String ruleNonterminal,
 +      String substitutionNonterminal) {
 +    String result = getLowerCasedFeatureName() + "_";
 +    result += getMatchFeatureSuffix(ruleNonterminal, substitutionNonterminal);
 +    return result;
 +  }
 +
-   private final String computeLabelSubstitutionFeature(String ruleNonterminal,
++  private String computeLabelSubstitutionFeature(String ruleNonterminal,
 +      String substitutionNonterminal) {
 +    String result = getLowerCasedFeatureName() + "_";
 +    result += getSubstitutionSuffix(ruleNonterminal, substitutionNonterminal);
 +    return result;
 +  }
 +
-   private static final String getRuleLabelsDescriptorString(Rule rule) {
++  private static String getRuleLabelsDescriptorString(Rule rule) {
 +    String result = "";
 +    String leftHandSide = RulePropertiesQuerying.getLHSAsString(rule);
 +    List<String> ruleSourceNonterminals = RulePropertiesQuerying
 +        .getRuleSourceNonterminalStrings(rule);
 +    boolean isInverting = rule.isInverting();
 +    result += "<LHS>" + leftHandSide + "</LHS>";
 +    result += "_<Nont>";
 +    result += ListUtil.stringListStringWithoutBracketsCommaSeparated(ruleSourceNonterminals);
 +    result += "</Nont>";
 +    if(isInverting)
 +    {  
 +      result += "_INV";
 +    }
 +    else
 +    {
 +      result += "_MONO";
 +    }
 +    
 +    return result;
 +  }
 +
-   private static final String getSubstitutionsDescriptorString(List<HGNode> tailNodes) {
++  private static String getSubstitutionsDescriptorString(List<HGNode> tailNodes) {
 +    String result = "_<Subst>";
 +    List<String> substitutionNonterminals = RulePropertiesQuerying
 +        .getSourceNonterminalStrings(tailNodes);
 +    result += ListUtil.stringListStringWithoutBracketsCommaSeparated(substitutionNonterminals);
 +    result += "</Subst>";
 +    return result;
 +  }
 +
 +  public final String getGapLabelsForRuleSubstitutionSuffix(Rule rule, List<HGNode> tailNodes) {
 +    String result = getLowerCasedFeatureName() + "_";
 +    result += getRuleLabelsDescriptorString(rule);
 +    result += getSubstitutionsDescriptorString(tailNodes);
 +    return result;
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +    if (rule != null && (tailNodes != null)) {
 +
 +      List<String> ruleSourceNonterminals = RulePropertiesQuerying
 +          .getRuleSourceNonterminalStrings(rule);
 +      List<String> substitutionNonterminals = RulePropertiesQuerying
 +          .getSourceNonterminalStrings(tailNodes);
 +      // Assert.assertEquals(ruleSourceNonterminals.size(), substitutionNonterminals.size());
 +      for (int nonterinalIndex = 0; nonterinalIndex < ruleSourceNonterminals.size(); nonterinalIndex++) {
 +        String ruleNonterminal = ruleSourceNonterminals.get(nonterinalIndex);
 +        String substitutionNonterminal = substitutionNonterminals.get(nonterinalIndex);
 +        acc.add(hashFeature(computeLabelMatchingFeature(ruleNonterminal, substitutionNonterminal)), 1);
 +        acc.add(hashFeature(computeLabelSubstitutionFeature(ruleNonterminal, substitutionNonterminal)), 1);
 +      }
 +      acc.add(hashFeature(getGapLabelsForRuleSubstitutionSuffix(rule, tailNodes)), 1);
 +    }
 +    return null;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LexicalFeatures.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/LexicalFeatures.java
index 4eacd26,0000000..63d350e
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LexicalFeatures.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/LexicalFeatures.java
@@@ -1,153 -1,0 +1,153 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static com.google.common.cache.CacheBuilder.newBuilder;
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.FormatUtils;
 +
 +import com.google.common.cache.Cache;
 +
 +/**
 + *  Lexical alignment features denoting alignments, deletions, and insertions.
 + */
 +public class LexicalFeatures extends StatelessFF {
 +  
 +  private final boolean useAlignments;
 +  private final boolean useDeletions;
 +  private final boolean useInsertions;
 +  
 +  private static final String NAME = "LexicalFeatures";
 +  // value to fire for features
 +  private static final int VALUE = 1;
 +  //whether this feature is restricted to a certain grammar/owner
 +  private final boolean ownerRestriction;
 +  // the grammar/owner this feature is restricted to fire
 +  private final OwnerId owner;
 +  // Strings separating words
 +  private static final String SEPARATOR = "~";
 +  
 +  private final Cache<Rule, List<Integer>> featureCache;
 +  
 +  public LexicalFeatures(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, NAME, args, config);
 +    
-     ownerRestriction = (parsedArgs.containsKey("owner")) ? true : false;
++    ownerRestriction = (parsedArgs.containsKey("owner"));
 +    owner = ownerRestriction ? OwnerMap.register(parsedArgs.get("owner")) : OwnerMap.UNKNOWN_OWNER_ID;
 +    
 +    useAlignments = parsedArgs.containsKey("alignments");
 +    useDeletions = parsedArgs.containsKey("deletions");
 +    useInsertions = parsedArgs.containsKey("insertions");
 +    
 +    // initialize cache
 +    if (parsedArgs.containsKey("cacheSize")) {
 +      featureCache = newBuilder().maximumSize(Integer.parseInt(parsedArgs.get("cacheSize"))).build();
 +    } else {
 +      featureCache = newBuilder().maximumSize(config.cachedRuleSize).build();
 +    }
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +    
 +    if (ownerRestriction && rule.getOwner().equals(owner)) {
 +      return null;
 +    }
 +
 +    List<Integer> featureIds = featureCache.getIfPresent(rule);
 +    if (featureIds == null) {
 +      featureIds = getFeatures(rule);
 +      featureCache.put(rule, featureIds);
 +    }
 +    for (int featureId : featureIds) {
 +      acc.add(featureId, VALUE);
 +    }
 +    
 +    return null;
 +  }
 +  
 +  /**
 +   * Obtains the feature ids for the given rule.
 +   * @param rule
 +   * @return String representing the feature name.s
 +   */
 +  private List<Integer> getFeatures(final Rule rule) {
 +    final List<Integer> result = new ArrayList<>();
 +    
 +    byte[] alignments = rule.getAlignment();
 +    if (alignments == null) {
 +      return result;
 +    }
 +    int[] sourceWords = rule.getSource();
 +    int[] targetWords = rule.getTarget();
 +    
 +    // sourceAligned & targetAligned indicate whether an index is covered by alignments
 +    boolean[] sourceAligned = new boolean[sourceWords.length];
 +    boolean[] targetAligned = new boolean[targetWords.length];
 +    
 +    // translations: aligned words
 +    for (int i = 0; i < alignments.length; i+=2) {
 +      byte sourceIndex = alignments[i];
 +      byte targetIndex = alignments[i + 1];
 +      sourceAligned[sourceIndex] = true;
 +      targetAligned[targetIndex] = true;
 +      if (useAlignments) {
 +        result.add(hashFeature(
 +            "T:" + 
 +            Vocabulary.word(sourceWords[sourceIndex]) + 
 +            SEPARATOR + 
 +            Vocabulary.word(targetWords[targetIndex])));
 +      }
 +    }
 +    
 +    // deletions: unaligned source words
 +    if (useDeletions) {
 +      for (int i = 0; i < sourceAligned.length; i++) {
 +        if (!sourceAligned[i] && ! FormatUtils.isNonterminal(sourceWords[i])) {
 +          result.add(hashFeature("D:" + Vocabulary.word(sourceWords[i])));
 +        }
 +      }
 +    }
 +    
 +    // insertions: unaligned target words
 +    if (useInsertions) {
 +      for (int i = 0; i < targetAligned.length; i++) {
 +        if (useInsertions && !targetAligned[i] && ! FormatUtils.isNonterminal(targetWords[i])) {
 +          result.add(hashFeature("I:" + Vocabulary.word(targetWords[i])));
 +        }
 +      }
 +    }
 +    
 +    return result;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/OOVPenalty.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/OOVPenalty.java
index 6eb1293,0000000..5e99428
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/OOVPenalty.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/OOVPenalty.java
@@@ -1,98 -1,0 +1,97 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import java.util.HashMap;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.JoshuaConfiguration.OOVItem;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + * This feature is fired when an out-of-vocabulary word (with respect to the translation model) is
 + * entered into the chart. OOVs work in the following manner: for each word in the input that is OOV
 + * with respect to the translation model, we create a rule that pushes that word through
 + * untranslated (the suffix "_OOV" can optionally be appended according to the runtime parameter
 + * "mark-oovs") . These rules are all stored in a grammar whose owner is "oov". The OOV feature
 + * function template then fires the "OOVPenalty" feature whenever it is asked to score an OOV rule.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class OOVPenalty extends StatelessFF {
 +  private final OwnerId ownerID;
-   
-   /* The default value returned for OOVs. Can be overridden with -oov-list */
-   private final float defaultValue = -100f;
++
 +  private final HashMap<Integer,Float> oovWeights;
 +
 +  public OOVPenalty(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "OOVPenalty", args, config);
 +    ownerID = OwnerMap.register("oov");
-     oovWeights = new HashMap<Integer,Float>();
++    oovWeights = new HashMap<>();
 +    
 +    if (config.oovList != null) {
 +      for (OOVItem item: config.oovList) { 
 +        oovWeights.put(Vocabulary.id(item.label), item.weight);
 +      }
 +    }
 +  }
 +  
 +  /**
 +   * OOV rules cover exactly one word, and such rules belong to a grammar whose owner is "oov". Each
 +   * OOV fires the OOVPenalty feature with a value of 1, so the cost is simply the weight, which was
 +   * cached when the feature was created.
 +   */
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +    
 +    if (rule != null && this.ownerID.equals(rule.getOwner())) {
 +      acc.add(featureId, getValue(rule.getLHS()));
 +    }
 +
 +    return null;
 +  }
 +  
 +  /**
 +   * It's important for the OOV feature to contribute to the rule's estimated cost, so that OOV
 +   * rules (which are added for all words, not just ones without translation options) get sorted
 +   * to the bottom during cube pruning.
 +   * 
 +   * Important! estimateCost returns the *weighted* feature value.
 +   */
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +    if (rule != null && this.ownerID.equals(rule.getOwner())) {
 +      return weights.getOrDefault(featureId) * getValue(rule.getLHS());
 +    }
 +    return 0.0f;
 +  }
 +  
 +  private float getValue(int lhs) {
++    float defaultValue = -100f;
 +    return oovWeights.containsKey(lhs) ? oovWeights.get(lhs) : defaultValue;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/PhrasePenalty.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/PhrasePenalty.java
index acda1d2,0000000..4f6a61c
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/PhrasePenalty.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/PhrasePenalty.java
@@@ -1,80 -1,0 +1,80 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.phrase.Hypothesis;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + *  This feature just counts rules that are used. You can restrict it with a number of flags:
 + * 
 + *   -owner OWNER
 + *    Only count rules owned by OWNER
 + *   -target|-source
 + *    Only count the target or source side (plus the LHS)
 + *
 + * TODO: add an option to separately provide a list of rule counts, restrict to counts above a threshold. 
 + */
 +public class PhrasePenalty extends StatelessFF {
 +
 +  private final OwnerId owner;
-   private float value = 1.0f;
++  private final float value = 1.0f;
 +  
 +  public PhrasePenalty(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "PhrasePenalty", args, config);
 +    if (parsedArgs.containsKey("owner"))
 +      this.owner = OwnerMap.register(parsedArgs.get("owner"));
 +    else // default
 +      this.owner = OwnerMap.register("pt"); 
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +
 +    if (rule != null && rule != Hypothesis.BEGIN_RULE && rule != Hypothesis.END_RULE 
 +        && (rule.getOwner().equals(owner))) {
 +      acc.add(featureId, value);
 +    }
 +
 +    return null;
 +  }
 +  
 +  /**
 +   * Returns the *weighted* estimate.
 +   * 
 +   */
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +    if (rule != null && rule != Hypothesis.BEGIN_RULE && rule != Hypothesis.END_RULE 
 +        && (rule.getOwner().equals(owner))) {
 +      return weights.getOrDefault(featureId) * value;
 +    }
 +    return 0.0f;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleFF.java
index df2b180,0000000..7a08043
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleFF.java
@@@ -1,126 -1,0 +1,126 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static com.google.common.cache.CacheBuilder.newBuilder;
 +import static org.apache.joshua.decoder.ff.tm.OwnerMap.UNKNOWN_OWNER_ID;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +import com.google.common.cache.Cache;
 +
 +/**
 + *  This feature fires for rule ids.
 + *  Firing can be restricted to rules from a certain owner, and rule ids
 + *  can be generated from source side and/or target side. 
 + */
 +public class RuleFF extends StatelessFF {
 +
-   private enum Sides { SOURCE, TARGET, BOTH };
-   
++  private enum Sides { SOURCE, TARGET, BOTH }
++
 +  private static final String NAME = "RuleFF";
 +  // value to fire for features
 +  private static final int VALUE = 1;
 +  // whether this feature is restricted to a certain grammar/owner
 +  private final boolean ownerRestriction;
 +  // the grammar/owner this feature is restricted to fire
 +  private final OwnerId owner;
 +  // what part of the rule should be extracted;
 +  private final Sides sides;
 +  // Strings separating words and rule sides 
 +  private static final String SEPARATOR = "~";
 +  private static final String SIDES_SEPARATOR = "->";
 +  
 +  private final Cache<Rule, Integer> featureCache;
 +  
 +  public RuleFF(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, NAME, args, config);
 +    
-     ownerRestriction = (parsedArgs.containsKey("owner")) ? true : false;
++    ownerRestriction = (parsedArgs.containsKey("owner"));
 +    owner = ownerRestriction ? OwnerMap.register(parsedArgs.get("owner")) : UNKNOWN_OWNER_ID;
 +    
 +    if (parsedArgs.containsKey("sides")) {
 +      final String sideValue = parsedArgs.get("sides");
 +      if (sideValue.equalsIgnoreCase("source")) {
 +        sides = Sides.SOURCE;
 +      } else if (sideValue.equalsIgnoreCase("target")) {
 +        sides = Sides.TARGET;
 +      } else if (sideValue.equalsIgnoreCase("both")){
 +        sides = Sides.BOTH;
 +      } else {
 +        throw new RuntimeException("Unknown side value.");
 +      }
 +    } else {
 +      sides = Sides.BOTH;
 +    }
 +    
 +    // initialize cache
 +    if (parsedArgs.containsKey("cacheSize")) {
 +      featureCache = newBuilder().maximumSize(Integer.parseInt(parsedArgs.get("cacheSize"))).build();
 +    } else {
 +      featureCache = newBuilder().maximumSize(config.cachedRuleSize).build();
 +    }
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +    
 +    if (ownerRestriction && !rule.getOwner().equals(owner)) {
 +      return null;
 +    }
 +
 +    Integer featureId = featureCache.getIfPresent(rule);
 +    if (featureId == null) {
 +      featureId = hashRuleFeature(rule);
 +      featureCache.put(rule, featureId);
 +    }
 +    acc.add(featureId, VALUE);
 +    
 +    return null;
 +  }
 +  
 +  /**
 +   * Obtains the feature id for the given rule.
 +   * @param rule
 +   * @return String representing the feature name.s
 +   */
 +  private int hashRuleFeature(final Rule rule) {
 +    final StringBuilder sb = new StringBuilder(Vocabulary.word(rule.getLHS()))
 +      .append(SIDES_SEPARATOR);
 +    if (sides == Sides.SOURCE || sides == Sides.BOTH) {
 +      sb.append(Vocabulary.getWords(rule.getSource(), SEPARATOR));
 +    }
 +    sb.append(SIDES_SEPARATOR);
 +    if (sides == Sides.TARGET || sides == Sides.BOTH) {
 +      sb.append(Vocabulary.getWords(rule.getTarget(), SEPARATOR));
 +    }
 +    return FeatureMap.hashFeature(sb.toString());
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RulePropertiesQuerying.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/RulePropertiesQuerying.java
index a1867a3,0000000..0ee41be
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RulePropertiesQuerying.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RulePropertiesQuerying.java
@@@ -1,49 -1,0 +1,49 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +
 +public class RulePropertiesQuerying {
 +
-   public static final String getLHSAsString(Rule rule) {
++  public static String getLHSAsString(Rule rule) {
 +    return Vocabulary.word(rule.getLHS());
 +  }
 +
 +  public static List<String> getRuleSourceNonterminalStrings(Rule rule) {
-     List<String> result = new ArrayList<String>();
++    List<String> result = new ArrayList<>();
 +    for (int nonTerminalIndex : rule.getForeignNonTerminals()) {
 +      result.add(Vocabulary.word(nonTerminalIndex));
 +    }
 +    return result;
 +  }
 +
 +  public static List<String> getSourceNonterminalStrings(List<HGNode> tailNodes) {
-     List<String> result = new ArrayList<String>();
++    List<String> result = new ArrayList<>();
 +    for (HGNode tailNode : tailNodes) {
 +      result.add(Vocabulary.word(tailNode.lhs));
 +    }
 +    return result;
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleShape.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleShape.java
index b389774,0000000..eb7bd50
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleShape.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/RuleShape.java
@@@ -1,101 -1,0 +1,101 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.FormatUtils;
 +
 +/*
 + * Implements the RuleShape feature for source, target, and paired source+target sides.
 + */
 +public class RuleShape extends StatelessFF {
 +
 +  public RuleShape(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "RuleShape", args, config);
 +  }
 +
 +  private enum WordType {
 +    N("N"), T("x"), P("+");
 +    private final String string;
 +    private boolean repeats;
 +
-     private WordType(final String string) {
++    WordType(final String string) {
 +      this.string = string;
 +      this.repeats = false;
 +    }
 +    
 +    private void setRepeats() {
 +      repeats = true;
 +    }
 +
 +    @Override
 +    public String toString() {
 +      if (repeats) {
 +        return this.string + "+";
 +      }
 +      return this.string;
 +    }
 +  }
 +
 +  private WordType getWordType(int id) {
 +    if (FormatUtils.isNonterminal(id)) {
 +      return WordType.N;
 +    } else {
 +      return WordType.T;
 +    }
 +  }
 +  
 +  /**
 +   * Returns a String describing the rule pattern.
 +   */
 +  private String getRulePattern(int[] ids) {
 +    final StringBuilder pattern = new StringBuilder();
 +    WordType currentType = getWordType(ids[0]);
 +    for (int i = 1; i < ids.length; i++) {
 +      if (getWordType(ids[i]) != currentType) {
 +        pattern.append(currentType.toString());
 +        currentType = getWordType(ids[i]);
 +      } else {
 +        currentType.setRepeats();
 +      }
 +    }
 +    pattern.append(currentType.toString());
 +    return pattern.toString();
 +  }
 +  
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i_, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +    final String sourceShape = getRulePattern(rule.getSource());
 +    final String targetShape = getRulePattern(rule.getTarget());
 +    acc.add(hashFeature(name + "_source_" + sourceShape), 1);
 +    acc.add(hashFeature(name + "_target_" + sourceShape), 1);
 +    acc.add(hashFeature(name + "_sourceTarget_" + sourceShape + "_" + targetShape), 1);
 +    return null;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourceDependentFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourceDependentFF.java
index 841402a,0000000..dec509f
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourceDependentFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourceDependentFF.java
@@@ -1,29 -1,0 +1,29 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +public interface SourceDependentFF extends Cloneable {
 +
-   public void setSource(Sentence sentence);
++  void setSource(Sentence sentence);
 +
-   public FeatureFunction clone();
++  FeatureFunction clone();
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourcePathFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourcePathFF.java
index cb902a0,0000000..1d0e6e7
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourcePathFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/SourcePathFF.java
@@@ -1,53 -1,0 +1,53 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + * This feature returns the scored path through the source lattice, which is recorded in a
 + * SourcePath object.
 + * 
 + * @author Chris Dyer redpony@umd.edu
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public final class SourcePathFF extends StatelessFF {
 +
 +  /*
 +   * This is a single-value feature template, so we cache the weight here.
 +   */
 +  public SourcePathFF(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "SourcePath", args, config);
 +  }
-   
++
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +
 +    acc.add(featureId,  sourcePath.getPathCost());
 +    return null;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/TargetBigram.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/TargetBigram.java
index 888fa03,0000000..9338b0d
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/TargetBigram.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/TargetBigram.java
@@@ -1,218 -1,0 +1,215 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.io.IOException;
 +import java.util.HashSet;
 +import java.util.LinkedList;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.state_maintenance.NgramDPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.io.LineReader;
 +
 +/***
 + * The RuleBigram feature is an indicator feature that counts target word bigrams that are created when
 + * a rule is applied. It accepts three parameters:
 + *
 + * -vocab /path/to/vocab
 + *
 + *  The path to a vocabulary, where each line is of the format ID WORD COUNT.
 + *
 + * -threshold N
 + *
 + *  Mask to UNK all words whose COUNT is less than N.
 + *
 + * -top-n N
 + *
 + *  Only use the top N words.
 + */
 +
 +public class TargetBigram extends StatefulFF {
 +
 +  private HashSet<String> vocab = null;
 +  private int maxTerms = 1000000;
 +  private int threshold = 0;
 +
 +  public TargetBigram(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "TargetBigram", args, config);
 +
 +    if (parsedArgs.containsKey("threshold"))
 +      threshold = Integer.parseInt(parsedArgs.get("threshold"));
 +
 +    if (parsedArgs.containsKey("top-n"))
 +      maxTerms = Integer.parseInt(parsedArgs.get("top-n"));
 +
 +    if (parsedArgs.containsKey("vocab")) {
 +      loadVocab(parsedArgs.get("vocab"));
 +    }
 +  }
 +
 +  /**
 +   * Load vocabulary items passing the 'threshold' and 'top-n' filters.
 +   *
 +   * @param filename
 +   */
 +  private void loadVocab(String filename) {
-     this.vocab = new HashSet<String>();
++    this.vocab = new HashSet<>();
 +    this.vocab.add("<s>");
 +    this.vocab.add("</s>");
 +    try {
 +      LineReader lineReader = new LineReader(filename);
 +      for (String line: lineReader) {
 +        if (lineReader.lineno() > maxTerms)
 +          break;
 +
 +        String[] tokens = line.split("\\s+");
 +        String word = tokens[1];
 +        int count = Integer.parseInt(tokens[2]);
 +
 +        if (count >= threshold)
 +          vocab.add(word);
 +      }
 +
 +    } catch (IOException e) {
 +      throw new RuntimeException(String.format(
 +          "* FATAL: couldn't load TargetBigram vocabulary '%s'", filename), e);
 +    }
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int spanStart, int spanEnd,
 +      SourcePath sourcePath, Sentence sentence, Accumulator acc) {
 +
 +    int[] enWords = rule.getTarget();
 +
 +    int left = -1;
 +    int right = -1;
 +
-     List<String> currentNgram = new LinkedList<String>();
-     for (int c = 0; c < enWords.length; c++) {
-       int curID = enWords[c];
- 
++    List<String> currentNgram = new LinkedList<>();
++    for (int curID : enWords) {
 +      if (FormatUtils.isNonterminal(curID)) {
 +        int index = -(curID + 1);
 +        NgramDPState state = (NgramDPState) tailNodes.get(index).getDPState(stateIndex);
 +        int[] leftContext = state.getLeftLMStateWords();
 +        int[] rightContext = state.getRightLMStateWords();
 +
 +        // Left context.
 +        for (int token : leftContext) {
 +          currentNgram.add(getWord(token));
 +          if (left == -1)
 +            left = token;
 +          right = token;
 +          if (currentNgram.size() == 2) {
 +            String ngram = join(currentNgram);
 +            acc.add(hashFeature(String.format("%s_%s", name, ngram)), 1);
 +            //            System.err.println(String.format("ADDING %s_%s", name, ngram));
 +            currentNgram.remove(0);
 +          }
 +        }
 +        // Replace right context.
 +        int tSize = currentNgram.size();
 +        for (int i = 0; i < rightContext.length; i++)
 +          currentNgram.set(tSize - rightContext.length + i, getWord(rightContext[i]));
 +
 +      } else { // terminal words
 +        currentNgram.add(getWord(curID));
 +        if (left == -1)
 +          left = curID;
 +        right = curID;
 +        if (currentNgram.size() == 2) {
 +          String ngram = join(currentNgram);
 +          acc.add(hashFeature(String.format("%s_%s", name, ngram)), 1);
 +          //          System.err.println(String.format("ADDING %s_%s", name, ngram));
 +          currentNgram.remove(0);
 +        }
 +      }
 +    }
 +
-     NgramDPState state = new NgramDPState(new int[] { left }, new int[] { right });
 +    //    System.err.println(String.format("RULE %s -> state %s", rule.getRuleString(), state));
-     return state;
++    return new NgramDPState(new int[] { left }, new int[] { right });
 +  }
 +
 +  /**
 +   * Returns the word after comparing against the private vocabulary (if set).
 +   *
 +   * @param curID
 +   * @return the word
 +   */
 +  private String getWord(int curID) {
 +    String word = Vocabulary.word(curID);
 +
 +    if (vocab != null && ! vocab.contains(word)) {
 +      return "UNK";
 +    }
 +
 +    return word;
 +  }
 +
 +  /**
 +   * We don't compute a future cost.
 +   */
 +  @Override
 +  public float estimateFutureCost(Rule rule, DPState state, Sentence sentence) {
 +    return 0.0f;
 +  }
 +
 +  /**
 +   * There is nothing to be done here, since &lt;s&gt; and &lt;/s&gt; are included in rules that are part
 +   * of the grammar. We simply return the DP state of the tail node.
 +   */
 +  @Override
 +  public DPState computeFinal(HGNode tailNode, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +
 +    return tailNode.getDPState(stateIndex);
 +  }
 +
 +  /**
 +   * TargetBigram features are only computed across hyperedges, so there is nothing to be done here. 
 +   */
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +    return 0.0f;
 +  }
 +
 +  /**
 +   * Join a list with the _ character. I am sure this is in a library somewhere.
 +   *
 +   * @param list a list of strings
 +   * @return the joined String
 +   */
 +  private String join(List<String> list) {
 +    StringBuilder sb = new StringBuilder();
 +    for (String item : list) {
-       sb.append(item.toString() + "_");
++      sb.append(item).append("_");
 +    }
 +
 +    return sb.substring(0, sb.length() - 1);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/ConcatenationIterator.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/ConcatenationIterator.java
index f75dffa,0000000..1d181e7
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/ConcatenationIterator.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/ConcatenationIterator.java
@@@ -1,93 -1,0 +1,91 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.fragmentlm;
 +
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Collection;
 +import java.util.Collections;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.NoSuchElementException;
 +
 +/**
 + * Concatenates an iterator over iterators into one long iterator.
 + *
 + * @author Dan Klein
 + */
 +public class ConcatenationIterator<E> implements Iterator<E> {
 +
-   Iterator<Iterator<E>> sourceIterators;
++  final Iterator<Iterator<E>> sourceIterators;
 +  Iterator<E> currentIterator;
 +  Iterator<E> lastIteratorToReturn;
 +
 +  public boolean hasNext() {
-     if (currentIterator.hasNext())
-       return true;
-     return false;
++    return currentIterator.hasNext();
 +  }
 +
 +  public E next() {
 +    if (currentIterator.hasNext()) {
 +      E e = currentIterator.next();
 +      lastIteratorToReturn = currentIterator;
 +      advance();
 +      return e;
 +    }
 +    throw new NoSuchElementException();
 +  }
 +
 +  private void advance() {
 +    while (! currentIterator.hasNext() && sourceIterators.hasNext()) {
 +      currentIterator = sourceIterators.next();
 +    }
 +  }
 +
 +  public void remove() {
 +    if (lastIteratorToReturn == null)
 +      throw new IllegalStateException();
 +    currentIterator.remove();
 +  }
 +
 +  public ConcatenationIterator(Iterator<Iterator<E>> sourceIterators) {
 +    this.sourceIterators = sourceIterators;
 +    this.currentIterator = (new ArrayList<E>()).iterator();
 +    this.lastIteratorToReturn = null;
 +    advance();
 +  }
 +
 +  public ConcatenationIterator(Collection<Iterator<E>> iteratorCollection) {
 +    this(iteratorCollection.iterator());
 +  }
 +
 +  public static void main(String[] args) {
 +    List<String> list0 = Collections.emptyList();
 +    List<String> list1 = Arrays.asList("a b c d".split(" "));
 +    List<String> list2 = Arrays.asList("e f".split(" "));
-     List<Iterator<String>> iterators = new ArrayList<Iterator<String>>();
++    List<Iterator<String>> iterators = new ArrayList<>();
 +    iterators.add(list1.iterator());
 +    iterators.add(list0.iterator());
 +    iterators.add(list2.iterator());
 +    iterators.add(list0.iterator());
-     Iterator<String> iterator = new ConcatenationIterator<String>(iterators);
++    Iterator<String> iterator = new ConcatenationIterator<>(iterators);
 +    while (iterator.hasNext()) {
 +      System.out.println(iterator.next());
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/FragmentLMFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/FragmentLMFF.java
index 5d6780b,0000000..5332135
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/FragmentLMFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/FragmentLMFF.java
@@@ -1,324 -1,0 +1,317 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.fragmentlm;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.Collection;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Stack;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * <p>Feature function that reads in a list of language model fragments and matches them against the
 + * hypergraph. This allows for language model fragment "glue" features, which fire when LM fragments
 + * (supplied as input) are assembled. These LM fragments are presumably useful in ensuring
 + * grammaticality and can be independent of the translation model fragments.</p>
 + * 
 + * <p>Usage: in the Joshua Configuration file, put</p>
 + * 
 + * <code>feature-function = FragmentLM -lm LM_FRAGMENTS_FILE -map RULE_FRAGMENTS_MAP_FILE</code>
 + * 
 + * <p>LM_FRAGMENTS_FILE is a pointer to a file containing a list of fragments that it should look for.
 + * The format of the file is one fragment per line in PTB format, e.g.:</p>
 + * 
 + * <code>(S NP (VP (VBD said) SBAR) (. .))</code>
 + * 
 + * <p>RULE_FRAGMENTS_MAP_FILE points to a file that maps fragments to the flattened SCFG rule format
 + * that Joshua uses. This mapping is necessary because Joshua's rules have been flattened, meaning
 + * that their internal structure has been removed, yet this structure is needed for matching LM
 + * fragments. The format of the file is</p>
 + * 
 + * <code>FRAGMENT ||| RULE-TARGET-SIDE</code>
 + * 
 + * <p>for example,</p>
 + * 
 + * <code>(S (NP (DT the) (NN man)) VP .) ||| the man [VP,1] [.,2] (SBAR (IN that) (S (NP (PRP he)) (VP
 + * (VBD was) (VB done)))) ||| that he was done (VP (VBD said) SBAR) ||| said SBAR</code>
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class FragmentLMFF extends StatefulFF {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(FragmentLMFF.class);
 +
 +  /*
 +   * When building a fragment from a rule rooted in the hypergraph, this parameter determines how
 +   * deep we'll go. Smaller values mean less hypergraph traversal but may also limit the LM
 +   * fragments that can be fired.
 +   */
 +  private int BUILD_DEPTH = 1;
 +
 +  /*
 +   * The maximum depth of a fragment, defined as the longest path from the fragment root to any of
 +   * its leaves.
 +   */
 +  private int MAX_DEPTH = 0;
 +
 +  /*
 +   * This is the minimum depth for lexicalized LM fragments. This allows you to easily exclude small
 +   * depth-one fragments that may be overfit to the training data. A depth of 1 (the default) does
 +   * not exclude any fragments.
 +   */
 +  private int MIN_LEX_DEPTH = 1;
 +
 +  /*
-    * Set to true to activate meta-features.
-    */
-   private boolean OPTS_DEPTH = false;
- 
-   /*
 +   * This contains a list of the language model fragments, indexed by LHS.
 +   */
 +  private HashMap<String, ArrayList<Tree>> lmFragments = null;
 +
 +  private int numFragments = 0;
 +
 +  /* The location of the file containing the language model fragments */
 +  private String fragmentLMFile = "";
 +
 +  /**
 +   * @param weights a {@link org.apache.joshua.decoder.ff.FeatureVector} with weights
 +   * @param args arguments passed to the feature function
 +   * @param config the {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   */
 +  public FragmentLMFF(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "FragmentLMFF", args, config);
 +
-     lmFragments = new HashMap<String, ArrayList<Tree>>();
++    lmFragments = new HashMap<>();
 +
 +    fragmentLMFile = parsedArgs.get("lm");
 +    BUILD_DEPTH = Integer.parseInt(parsedArgs.get("build-depth"));
 +    MAX_DEPTH = Integer.parseInt(parsedArgs.get("max-depth"));
 +    MIN_LEX_DEPTH = Integer.parseInt(parsedArgs.get("min-lex-depth"));
 +
 +    /* Read in the language model fragments */
 +    try {
 +      Collection<Tree> trees = PennTreebankReader.readTrees(fragmentLMFile);
-       for (Tree fragment : trees) {
-         addLMFragment(fragment);
- 
-         // System.err.println(String.format("Read fragment: %s",
-         // lmFragments.get(lmFragments.size()-1)));
-       }
++      // System.err.println(String.format("Read fragment: %s",
++      // lmFragments.get(lmFragments.size()-1)));
++      trees.forEach(this::addLMFragment);
 +    } catch (IOException e) {
 +      throw new RuntimeException(String.format("* WARNING: couldn't read fragment LM file '%s'",
 +          fragmentLMFile), e);
 +    }
 +    LOG.info("FragmentLMFF: Read {} LM fragments from '{}'", numFragments, fragmentLMFile);
 +  }
 +
 +  /**
 +   * Add the provided fragment to the language model, subject to some filtering.
 +   * 
 +   * @param fragment a {@link org.apache.joshua.decoder.ff.fragmentlm.Tree} fragment
 +   */
 +  public void addLMFragment(Tree fragment) {
 +    if (lmFragments == null)
 +      return;
 +
 +    int fragmentDepth = fragment.getDepth();
 +
 +    if (MAX_DEPTH != 0 && fragmentDepth > MAX_DEPTH) {
 +      LOG.warn("Skipping fragment {} (depth {} > {})", fragment, fragmentDepth, MAX_DEPTH);
 +      return;
 +    }
 +
 +    if (MIN_LEX_DEPTH > 1 && fragment.isLexicalized() && fragmentDepth < MIN_LEX_DEPTH) {
 +      LOG.warn("Skipping fragment {} (lex depth {} < {})", fragment, fragmentDepth, MIN_LEX_DEPTH);
 +      return;
 +    }
 +
 +    if (lmFragments.get(fragment.getRule()) == null) {
-       lmFragments.put(fragment.getRule(), new ArrayList<Tree>());
++      lmFragments.put(fragment.getRule(), new ArrayList<>());
 +    }
 +    lmFragments.get(fragment.getRule()).add(fragment);
 +    numFragments++;
 +  }
 +  
 +  /**
 +   * This function computes the features that fire when the current rule is applied. The features
 +   * that fire are any LM fragments that match the fragment associated with the current rule. LM
 +   * fragments may recurse over the tail nodes, following 1-best backpointers until the fragment
 +   * either matches or fails.
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be utilized within computation
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode} tail nodes
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source {@link org.apache.joshua.lattice.Lattice}
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @param acc {@link org.apache.joshua.decoder.ff.FeatureFunction.Accumulator} object permitting generalization of feature computation
 +   * @return the new dynamic programming state (null for stateless features)
 +   */
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath, 
 +      Sentence sentence, Accumulator acc) {
 +
 +    /*
 +     * Get the fragment associated with the target side of this rule.
 +     * 
 +     * This could be done more efficiently. For example, just build the tree fragment once and then
 +     * pattern match against it. This would circumvent having to build the tree possibly once every
 +     * time you try to apply a rule.
 +     */
 +    Tree baseTree = Tree.buildTree(rule, tailNodes, BUILD_DEPTH);
 +
-     Stack<Tree> nodeStack = new Stack<Tree>();
++    Stack<Tree> nodeStack = new Stack<>();
 +    nodeStack.add(baseTree);
 +    while (!nodeStack.empty()) {
 +      Tree tree = nodeStack.pop();
 +      if (tree == null)
 +        continue;
 +
 +      if (lmFragments.get(tree.getRule()) != null) {
 +        for (Tree fragment : lmFragments.get(tree.getRule())) {
 +//           System.err.println(String.format("Does\n  %s match\n  %s??\n  -> %s", fragment, tree,
 +//           match(fragment, tree)));
 +
 +          if (fragment.getLabel() == tree.getLabel() && match(fragment, tree)) {
 +//             System.err.println(String.format("  FIRING: matched %s against %s", fragment, tree));
 +            acc.add(hashFeature(fragment.escapedString()), 1);
++            boolean OPTS_DEPTH = false;
 +            if (OPTS_DEPTH)
 +              if (fragment.isLexicalized())
 +                acc.add(hashFeature(String.format("FragmentFF_lexdepth%d", fragment.getDepth())), 1);
 +              else
 +                acc.add(hashFeature(String.format("FragmentFF_depth%d", fragment.getDepth())), 1);
 +          }
 +        }
 +      }
 +
 +      // We also need to try matching rules against internal nodes of the fragment corresponding to
 +      // this
 +      // rule
 +      if (tree.getChildren() != null)
 +        for (Tree childNode : tree.getChildren()) {
 +          if (!childNode.isBoundary())
 +            nodeStack.add(childNode);
 +        }
 +    }
 +
 +    return new FragmentState(baseTree);
 +  }
 +
 +  /**
 +   * Matches the fragment against the (possibly partially-built) tree. Assumption
 +   * 
 +   * @param fragment the language model fragment
 +   * @param tree the tree to match against (expanded from the hypergraph)
 +   * @return
 +   */
 +  private boolean match(Tree fragment, Tree tree) {
 +    // System.err.println(String.format("MATCH(%s,%s)", fragment, tree));
 +
 +    /* Make sure the root labels match. */
 +    if (fragment.getLabel() != tree.getLabel()) {
 +      return false;
 +    }
 +
 +    /* Same number of kids? */
 +    List<Tree> fkids = fragment.getChildren();
 +    if (fkids.size() > 0) {
 +      List<Tree> tkids = tree.getChildren();
 +      if (fkids.size() != tkids.size()) {
 +        return false;
 +      }
 +
 +      /* Do the kids match on all labels? */
 +      for (int i = 0; i < fkids.size(); i++)
 +        if (fkids.get(i).getLabel() != tkids.get(i).getLabel())
 +          return false;
 +
 +      /* Recursive match. */
 +      for (int i = 0; i < fkids.size(); i++) {
 +        if (!match(fkids.get(i), tkids.get(i)))
 +          return false;
 +      }
 +    }
 +
 +    return true;
 +  }
 +
 +  @Override
 +  public DPState computeFinal(HGNode tailNodes, int i, int j, SourcePath sourcePath, Sentence sentence,
 +      Accumulator acc) {
 +    // TODO Auto-generated method stub
 +    return null;
 +  }
 +
 +  @Override
 +  public float estimateFutureCost(Rule rule, DPState state, Sentence sentence) {
 +    // TODO Auto-generated method stub
 +    return 0;
 +  }
 +
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +    // TODO Auto-generated method stub
 +    return 0;
 +  }
 +
 +  /**
 +   * Maintains a state pointer used by KenLM to implement left-state minimization. 
 +   * 
 +   * @author Matt Post post@cs.jhu.edu
 +   * @author Juri Ganitkevitch juri@cs.jhu.edu
 +   */
 +  public class FragmentState extends DPState {
 +
 +    private Tree tree = null;
 +
 +    public FragmentState(Tree tree) {
 +      this.tree = tree;
 +    }
 +
 +    /**
 +     * Every tree is unique.
 +     * 
 +     * Some savings could be had here if we grouped together items with the same string.
 +     */
 +    @Override
 +    public int hashCode() {
 +      return tree.hashCode();
 +    }
 +
 +    @Override
 +    public boolean equals(Object other) {
 +      return (other instanceof FragmentState && this == other);
 +    }
 +
 +    @Override
 +    public String toString() {
 +      return String.format("[FragmentState %s]", tree);
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/PennTreebankReader.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/PennTreebankReader.java
index 1637b5f,0000000..bb1c29a
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/PennTreebankReader.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/PennTreebankReader.java
@@@ -1,135 -1,0 +1,134 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.fragmentlm;
 +
 +import java.util.*;
 +import java.io.*;
 +import java.nio.charset.Charset;
 +import java.nio.charset.UnsupportedCharsetException;
 +
 +/**
 + * @author Dan Klein
 + */
 +public class PennTreebankReader {
 +
 +  static class TreeCollection extends AbstractCollection<Tree> {
 +
-     List<File> files;
-     Charset charset;
++    final List<File> files;
++    final Charset charset;
 +
 +    static class TreeIteratorIterator implements Iterator<Iterator<Tree>> {
-       Iterator<File> fileIterator;
++      final Iterator<File> fileIterator;
 +      Iterator<Tree> nextTreeIterator;
-       Charset charset;
++      final Charset charset;
 +
 +      public boolean hasNext() {
 +        return nextTreeIterator != null;
 +      }
 +
 +      public Iterator<Tree> next() {
 +        Iterator<Tree> currentTreeIterator = nextTreeIterator;
 +        advance();
 +        return currentTreeIterator;
 +      }
 +
 +      public void remove() {
 +        throw new UnsupportedOperationException();
 +      }
 +
 +      private void advance() {
 +        nextTreeIterator = null;
 +        while (nextTreeIterator == null && fileIterator.hasNext()) {
 +          File file = fileIterator.next();
 +          // System.out.println(file);
 +          try {
 +            nextTreeIterator = new Trees.PennTreeReader(new BufferedReader(new InputStreamReader(
 +                new FileInputStream(file), this.charset)));
 +          } catch (FileNotFoundException e) {
 +          } catch (UnsupportedCharsetException e) {
 +            throw new Error("Unsupported charset in file " + file.getPath());
 +          }
 +        }
 +      }
 +
 +      TreeIteratorIterator(List<File> files, Charset charset) {
 +        this.fileIterator = files.iterator();
 +        this.charset = charset;
 +        advance();
 +      }
 +    }
 +
 +    public Iterator<Tree> iterator() {
-       return new ConcatenationIterator<Tree>(new TreeIteratorIterator(files, this.charset));
++      return new ConcatenationIterator<>(new TreeIteratorIterator(files, this.charset));
 +    }
 +
 +    public int size() {
 +      int size = 0;
 +      Iterator<Tree> i = iterator();
 +      while (i.hasNext()) {
 +        size++;
 +        i.next();
 +      }
 +      return size;
 +    }
 +
 +    @SuppressWarnings("unused")
 +    private List<File> getFilesUnder(String path, FileFilter fileFilter) {
 +      File root = new File(path);
-       List<File> files = new ArrayList<File>();
++      List<File> files = new ArrayList<>();
 +      addFilesUnder(root, files, fileFilter);
 +      return files;
 +    }
 +
 +    private void addFilesUnder(File root, List<File> files, FileFilter fileFilter) {
 +      if (!fileFilter.accept(root))
 +        return;
 +      if (root.isFile()) {
 +        files.add(root);
 +        return;
 +      }
 +      if (root.isDirectory()) {
 +        File[] children = root.listFiles();
-         for (int i = 0; i < children.length; i++) {
-           File child = children[i];
++        for (File child : children) {
 +          addFilesUnder(child, files, fileFilter);
 +        }
 +      }
 +    }
 +
 +    public TreeCollection(String file) throws FileNotFoundException, IOException {
-       this.files = new ArrayList<File>();
++      this.files = new ArrayList<>();
 +      this.files.add(new File(file));
 +      this.charset = Charset.defaultCharset();
 +    }
 +  }
 +  
 +  public static Collection<Tree> readTrees(String path) throws FileNotFoundException, IOException {
 +    return new TreeCollection(path);
 +  }
 +
 +  public static void main(String[] args) {
 +/*    Collection<Tree> trees = readTrees(args[0], Charset.defaultCharset());
 +    for (Tree tree : trees) {
 +      tree = (new Trees.StandardTreeNormalizer()).transformTree(tree);
 +      System.out.println(Trees.PennTreeRenderer.render(tree));
 +    }
 +  */
 +  }
 +
 +}


[36/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Tree.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Tree.java
index 7e22b97,0000000..036c4bc
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Tree.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Tree.java
@@@ -1,779 -1,0 +1,777 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.fragmentlm;
 +
 +import java.io.IOException;
 +import java.io.Serializable;
 +import java.io.StringReader;
 +import java.util.*;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.fragmentlm.Trees.PennTreeReader;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationState;
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Represent phrase-structure trees, with each node consisting of a label and a list of children.
 + * Borrowed from the Berkeley Parser, and extended to allow the representation of tree fragments in
 + * addition to complete trees (the BP requires terminals to be immediately governed by a
 + * preterminal). To distinguish terminals from nonterminals in fragments, the former must be
 + * enclosed in double-quotes when read in.
 + * 
 + * @author Dan Klein
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class Tree implements Serializable {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Tree.class);
 +  private static final long serialVersionUID = 1L;
 +
 +  protected int label;
 +
 +  /* Marks a frontier node as a terminal (as opposed to a nonterminal). */
 +  boolean isTerminal = false;
 +
 +  /*
 +   * Marks the root and frontier nodes of a fragment. Useful for denoting fragment derivations in
 +   * larger trees.
 +   */
 +  boolean isBoundary = false;
 +
 +  /* A list of the node's children. */
 +  List<Tree> children;
 +
 +  /* The maximum distance from the root to any of the frontier nodes. */
 +  int depth = -1;
 +
 +  /* The number of lexicalized items among the tree's frontier. */
 +  private int numLexicalItems = -1;
 +
 +  /*
 +   * This maps the flat right-hand sides of Joshua rules to the tree fragments they were derived
 +   * from. It is used to lookup the fragment that language model fragments should be match against.
 +   * For example, if the target (English) side of your rule is
 +   * 
 +   * [NP,1] said [SBAR,2]
 +   * 
 +   * we will retrieve the unflattened fragment
 +   * 
 +   * (S NP (VP (VBD said) SBAR))
 +   * 
 +   * which presumably was the fronter fragment used to derive the translation rule. With this in
 +   * hand, we can iterate through our store of language model fragments to match them against this,
 +   * following tail nodes if necessary.
 +   */
-   public static HashMap<String, String> rulesToFragmentStrings = new HashMap<String, String>();
++  public static final HashMap<String, String> rulesToFragmentStrings = new HashMap<>();
 +
 +  public Tree(String label, List<Tree> children) {
 +    setLabel(label);
 +    this.children = children;
 +  }
 +
 +  public Tree(String label) {
 +    setLabel(label);
 +    this.children = Collections.emptyList();
 +  }
 +
 +  public Tree(int label2, ArrayList<Tree> newChildren) {
 +    this.label = label2;
 +    this.children = newChildren;
 +  }
 +
 +  public void setChildren(List<Tree> c) {
 +    this.children = c;
 +  }
 +
 +  public List<Tree> getChildren() {
 +    return children;
 +  }
 +
 +  public int getLabel() {
 +    return label;
 +  }
 +
 +  /**
 +   * Computes the depth-one rule rooted at this node. If the node has no children, null is returned.
 +   * 
 +   * @return string representation of the rule
 +   */
 +  public String getRule() {
 +    if (isLeaf()) {
 +      return null;
 +    }
 +    StringBuilder ruleString = new StringBuilder("(" + Vocabulary.word(getLabel()));
 +    for (Tree child : getChildren()) {
 +      ruleString.append(" ").append(Vocabulary.word(child.getLabel()));
 +    }
 +    return ruleString.toString();
 +  }
 +
 +  /*
 +   * Boundary nodes are used externally to mark merge points between different fragments. This is
 +   * separate from the internal ( (substitution point) denotation.
 +   */
 +  public boolean isBoundary() {
 +    return isBoundary;
 +  }
 +
 +  public void setBoundary(boolean b) {
 +    this.isBoundary = b;
 +  }
 +
 +  public boolean isTerminal() {
 +    return isTerminal;
 +  }
 +
 +  public boolean isLeaf() {
 +    return getChildren().isEmpty();
 +  }
 +
 +  public boolean isPreTerminal() {
 +    return getChildren().size() == 1 && getChildren().get(0).isLeaf();
 +  }
 +
 +  public List<Tree> getNonterminalYield() {
-     List<Tree> yield = new ArrayList<Tree>();
++    List<Tree> yield = new ArrayList<>();
 +    appendNonterminalYield(this, yield);
 +    return yield;
 +  }
 +
 +  public List<Tree> getYield() {
-     List<Tree> yield = new ArrayList<Tree>();
++    List<Tree> yield = new ArrayList<>();
 +    appendYield(this, yield);
 +    return yield;
 +  }
 +
 +  public List<Tree> getTerminals() {
-     List<Tree> yield = new ArrayList<Tree>();
++    List<Tree> yield = new ArrayList<>();
 +    appendTerminals(this, yield);
 +    return yield;
 +  }
 +
 +  private static void appendTerminals(Tree tree, List<Tree> yield) {
 +    if (tree.isLeaf()) {
 +      yield.add(tree);
 +      return;
 +    }
 +    for (Tree child : tree.getChildren()) {
 +      appendTerminals(child, yield);
 +    }
 +  }
 +
 +  /**
 +   * Clone the structure of the tree.
 +   * 
 +   * @return a cloned tree
 +   */
 +  public Tree shallowClone() {
-     ArrayList<Tree> newChildren = new ArrayList<Tree>(children.size());
++    ArrayList<Tree> newChildren = new ArrayList<>(children.size());
 +    for (Tree child : children) {
 +      newChildren.add(child.shallowClone());
 +    }
 +
 +    Tree newTree = new Tree(label, newChildren);
 +    newTree.setIsTerminal(isTerminal());
 +    newTree.setBoundary(isBoundary());
 +    return newTree;
 +  }
 +
 +  private void setIsTerminal(boolean terminal) {
 +    isTerminal = terminal;
 +  }
 +
 +  private static void appendNonterminalYield(Tree tree, List<Tree> yield) {
 +    if (tree.isLeaf() && !tree.isTerminal()) {
 +      yield.add(tree);
 +      return;
 +    }
 +    for (Tree child : tree.getChildren()) {
 +      appendNonterminalYield(child, yield);
 +    }
 +  }
 +
 +  private static void appendYield(Tree tree, List<Tree> yield) {
 +    if (tree.isLeaf()) {
 +      yield.add(tree);
 +      return;
 +    }
 +    for (Tree child : tree.getChildren()) {
 +      appendYield(child, yield);
 +    }
 +  }
 +
 +  public List<Tree> getPreTerminalYield() {
-     List<Tree> yield = new ArrayList<Tree>();
++    List<Tree> yield = new ArrayList<>();
 +    appendPreTerminalYield(this, yield);
 +    return yield;
 +  }
 +
 +  private static void appendPreTerminalYield(Tree tree, List<Tree> yield) {
 +    if (tree.isPreTerminal()) {
 +      yield.add(tree);
 +      return;
 +    }
 +    for (Tree child : tree.getChildren()) {
 +      appendPreTerminalYield(child, yield);
 +    }
 +  }
 +
 +  /**
 +   * A tree is lexicalized if it has terminal nodes among the leaves of its frontier. For normal
 +   * trees this is always true since they bottom out in terminals, but for fragments, this may or
 +   * may not be true.
 +   * 
 +   * @return true if the tree is lexicalized
 +   */
 +  public boolean isLexicalized() {
 +    if (this.numLexicalItems < 0) {
 +      if (isTerminal())
 +        this.numLexicalItems = 1;
 +      else {
 +        this.numLexicalItems = 0;
-         for (Tree child : children)
-           if (child.isLexicalized())
-             this.numLexicalItems += 1;
++        children.stream().filter(child -> child.isLexicalized())
++            .forEach(child -> this.numLexicalItems += 1);
 +      }
 +    }
 +
 +    return (this.numLexicalItems > 0);
 +  }
 +
 +  /**
 +   * The depth of a tree is the maximum distance from the root to any of the frontier nodes.
 +   * 
 +   * @return the tree depth
 +   */
 +  public int getDepth() {
 +    if (this.depth >= 0)
 +      return this.depth;
 +
 +    if (isLeaf()) {
 +      this.depth = 0;
 +    } else {
 +      int maxDepth = 0;
 +      for (Tree child : children) {
 +        int depth = child.getDepth();
 +        if (depth > maxDepth)
 +          maxDepth = depth;
 +      }
 +      this.depth = maxDepth + 1;
 +    }
 +    return this.depth;
 +  }
 +
 +  public List<Tree> getAtDepth(int depth) {
-     List<Tree> yield = new ArrayList<Tree>();
++    List<Tree> yield = new ArrayList<>();
 +    appendAtDepth(depth, this, yield);
 +    return yield;
 +  }
 +
 +  private static void appendAtDepth(int depth, Tree tree, List<Tree> yield) {
 +    if (depth < 0)
 +      return;
 +    if (depth == 0) {
 +      yield.add(tree);
 +      return;
 +    }
 +    for (Tree child : tree.getChildren()) {
 +      appendAtDepth(depth - 1, child, yield);
 +    }
 +  }
 +
 +  public void setLabel(String label) {
 +    if (label.length() >= 3 && label.startsWith("\"") && label.endsWith("\"")) {
 +      this.isTerminal = true;
 +      label = label.substring(1, label.length() - 1);
 +    }
 +
 +    this.label = Vocabulary.id(label);
 +  }
 +
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    toStringBuilder(sb);
 +    return sb.toString();
 +  }
 +
 +  /**
 +   * Removes the quotes around terminals. Note that the resulting tree could not be read back
 +   * in by this class, since unquoted leaves are interpreted as nonterminals.
 +   * 
 +   * @return unquoted string
 +   */
 +  public String unquotedString() {
 +    return toString().replaceAll("\"", "");
 +  }
 +  
 +  public String escapedString() {
 +    return toString().replaceAll(" ", "_");
 +  }
 +
 +  public void toStringBuilder(StringBuilder sb) {
 +    if (!isLeaf())
 +      sb.append('(');
 +
 +    if (isTerminal())
 +      sb.append(String.format("\"%s\"", Vocabulary.word(getLabel())));
 +    else
 +      sb.append(Vocabulary.word(getLabel()));
 +
 +    if (!isLeaf()) {
 +      for (Tree child : getChildren()) {
 +        sb.append(' ');
 +        child.toStringBuilder(sb);
 +      }
 +      sb.append(')');
 +    }
 +  }
 +
 +  /**
 +   * Get the set of all subtrees inside the tree by returning a tree rooted at each node. These are
 +   * <i>not</i> copies, but all share structure. The tree is regarded as a subtree of itself.
 +   * 
 +   * @return the <code>Set</code> of all subtrees in the tree.
 +   */
 +  public Set<Tree> subTrees() {
-     return (Set<Tree>) subTrees(new HashSet<Tree>());
++    return (Set<Tree>) subTrees(new HashSet<>());
 +  }
 +
 +  /**
 +   * Get the list of all subtrees inside the tree by returning a tree rooted at each node. These are
 +   * <i>not</i> copies, but all share structure. The tree is regarded as a subtree of itself.
 +   * 
 +   * @return the <code>List</code> of all subtrees in the tree.
 +   */
 +  public List<Tree> subTreeList() {
-     return (List<Tree>) subTrees(new ArrayList<Tree>());
++    return (List<Tree>) subTrees(new ArrayList<>());
 +  }
 +
 +  /**
 +   * Add the set of all subtrees inside a tree (including the tree itself) to the given
 +   * <code>Collection</code>.
 +   * 
 +   * @param n A collection of nodes to which the subtrees will be added
 +   * @return The collection parameter with the subtrees added
 +   */
 +  public Collection<Tree> subTrees(Collection<Tree> n) {
 +    n.add(this);
 +    List<Tree> kids = getChildren();
 +    for (Tree kid : kids) {
 +      kid.subTrees(n);
 +    }
 +    return n;
 +  }
 +
 +  /**
 +   * Returns an iterator over the nodes of the tree. This method implements the
 +   * <code>iterator()</code> method required by the <code>Collections</code> interface. It does a
 +   * preorder (children after node) traversal of the tree. (A possible extension to the class at
 +   * some point would be to allow different traversal orderings via variant iterators.)
 +   * 
 +   * @return An interator over the nodes of the tree
 +   */
 +  public TreeIterator iterator() {
 +    return new TreeIterator();
 +  }
 +
 +  private class TreeIterator implements Iterator<Tree> {
 +
-     private List<Tree> treeStack;
++    private final List<Tree> treeStack;
 +
 +    private TreeIterator() {
-       treeStack = new ArrayList<Tree>();
++      treeStack = new ArrayList<>();
 +      treeStack.add(Tree.this);
 +    }
 +
 +    public boolean hasNext() {
 +      return (!treeStack.isEmpty());
 +    }
 +
 +    public Tree next() {
 +      int lastIndex = treeStack.size() - 1;
 +      Tree tr = treeStack.remove(lastIndex);
 +      List<Tree> kids = tr.getChildren();
 +      // so that we can efficiently use one List, we reverse them
 +      for (int i = kids.size() - 1; i >= 0; i--) {
 +        treeStack.add(kids.get(i));
 +      }
 +      return tr;
 +    }
 +
 +    /**
 +     * Not supported
 +     */
 +    public void remove() {
 +      throw new UnsupportedOperationException();
 +    }
 +
 +  }
 +
 +  public boolean hasUnaryChain() {
 +    return hasUnaryChainHelper(this, false);
 +  }
 +
 +  private boolean hasUnaryChainHelper(Tree tree, boolean unaryAbove) {
 +    boolean result = false;
 +    if (tree.getChildren().size() == 1) {
 +      if (unaryAbove)
 +        return true;
 +      else if (tree.getChildren().get(0).isPreTerminal())
 +        return false;
 +      else
 +        return hasUnaryChainHelper(tree.getChildren().get(0), true);
 +    } else {
 +      for (Tree child : tree.getChildren()) {
 +        if (!child.isPreTerminal())
 +          result = result || hasUnaryChainHelper(child, false);
 +      }
 +    }
 +    return result;
 +  }
 +
 +  /**
 +   * Inserts the SOS (and EOS) symbols into a parse tree, attaching them as a left (right) sibling
 +   * to the leftmost (rightmost) pre-terminal in the tree. This facilitates using trees as language
 +   * models. The arguments have to be passed in to preserve Java generics, even though this is only
 +   * ever used with String versions.
 +   * 
 +   * @param sos presumably "&lt;s&gt;"
 +   * @param eos presumably "&lt;/s&gt;"
 +   */
 +  public void insertSentenceMarkers(String sos, String eos) {
 +    insertSentenceMarker(sos, 0);
 +    insertSentenceMarker(eos, -1);
 +  }
 +
 +  public void insertSentenceMarkers() {
 +    insertSentenceMarker("<s>", 0);
 +    insertSentenceMarker("</s>", -1);
 +  }
 +
 +  /**
 +   * 
 +   * @param symbol the marker to insert
 +   * @param pos the position at which to insert
 +   */
 +  private void insertSentenceMarker(String symbol, int pos) {
 +
 +    if (isLeaf() || isPreTerminal())
 +      return;
 +
 +    List<Tree> children = getChildren();
 +    int index = (pos == -1) ? children.size() - 1 : pos;
 +    if (children.get(index).isPreTerminal()) {
 +      if (pos == -1)
 +        children.add(new Tree(symbol));
 +      else
 +        children.add(pos, new Tree(symbol));
 +    } else {
 +      children.get(index).insertSentenceMarker(symbol, pos);
 +    }
 +  }
 +
 +  /**
 +   * This is a convenience function for producing a fragment from its string representation.
 +   * 
 +   * @param ptbStr input string from which to produce a fragment
 +   * @return the fragment
 +   */
 +  public static Tree fromString(String ptbStr) {
 +    PennTreeReader reader = new PennTreeReader(new StringReader(ptbStr));
-     Tree fragment = reader.next();
-     return fragment;
++    return reader.next();
 +  }
 +
 +  public static Tree getFragmentFromYield(String yield) {
 +    String fragmentString = rulesToFragmentStrings.get(yield);
 +    if (fragmentString != null)
 +      return fromString(fragmentString);
 +
 +    return null;
 +  }
 +
 +  public static void readMapping(String fragmentMappingFile) {
 +    /* Read in the rule / fragments mapping */
 +    try {
 +      LineReader reader = new LineReader(fragmentMappingFile);
 +      for (String line : reader) {
 +        String[] fields = line.split("\\s+\\|{3}\\s+");
 +        if (fields.length != 2 || !fields[0].startsWith("(")) {
 +          LOG.warn("malformed line {}: {}", reader.lineno(), line);
 +          continue;
 +        }
 +
 +        rulesToFragmentStrings.put(fields[1].trim(), fields[0].trim()); // buildFragment(fields[0]));
 +      }
 +    } catch (IOException e) {
 +      throw new RuntimeException(String.format("* WARNING: couldn't read fragment mapping file '%s'",
 +          fragmentMappingFile), e);
 +    }
 +    LOG.info("FragmentLMFF: Read {} mappings from '{}'", rulesToFragmentStrings.size(),
 +        fragmentMappingFile);
 +  }
 +
 +  /**
 +   * Builds a tree from the kth-best derivation state. This is done by initializing the tree with
 +   * the internal fragment corresponding to the rule; this will be the top of the tree. We then
 +   * recursively visit the derivation state objects, following the route through the hypergraph
 +   * defined by them.
 +   * 
 +   * This function is like Tree#buildTree(DerivationState, int),
 +   * but that one simply follows the best incoming hyperedge for each node.
 +   * 
 +   * @param rule for which corresponding internal fragment can be used to initialize the tree
 +   * @param derivationStates array of state objects
 +   * @param maxDepth of route through the hypergraph
 +   * @return the Tree 
 +   */
 +  public static Tree buildTree(Rule rule, DerivationState[] derivationStates, int maxDepth) {
 +    Tree tree = getFragmentFromYield(rule.getTargetWords());
 +
 +    if (tree == null) {
 +      return null;
 +    }
 +
 +    tree = tree.shallowClone();
 +
 +    if (LOG.isDebugEnabled()) {
 +      LOG.debug("buildTree({})", tree);
 +      for (int i = 0; i < derivationStates.length; i++) {
 +        LOG.debug("  -> {}: {}", i, derivationStates[i]);
 +      }
 +    }
 +
 +    List<Tree> frontier = tree.getNonterminalYield();
 +
 +    /* The English side of a rule is a sequence of integers. Nonnegative integers are word
 +     * indices in the Vocabulary, while negative indices are used to nonterminals. These negative
 +     * indices are a *permutation* of the source side nonterminals, which contain the actual
 +     * nonterminal Vocabulary indices for the nonterminal names. Here, we convert this permutation
 +     * to a nonnegative 0-based permutation and store it in tailIndices. This is used to index 
 +     * the incoming DerivationState items, which are ordered by the source side.
 +     */
 +    ArrayList<Integer> tailIndices = new ArrayList<Integer>();
 +    int[] englishInts = rule.getTarget();
 +    for (int i = 0; i < englishInts.length; i++)
 +      if (englishInts[i] < 0)
 +        tailIndices.add(-(englishInts[i] + 1));
 +
 +    /*
 +     * We now have the tree's yield. The substitution points on the yield should match the
 +     * nonterminals of the heads of the derivation states. Since we don't know which of the tree's
 +     * frontier items are terminals and which are nonterminals, we walk through the tail nodes,
 +     * and then match the label of each against the frontier node labels until we have a match.
 +     */
 +    // System.err.println(String.format("WORDS: %s\nTREE: %s", rule.getEnglishWords(), tree));
 +    for (int i = 0; i < derivationStates.length; i++) {
 +
 +      Tree frontierTree = frontier.get(tailIndices.get(i));
 +      frontierTree.setBoundary(true);
 +
 +      HyperEdge nextEdge = derivationStates[i].edge;
 +      if (nextEdge != null) {
 +        DerivationState[] nextStates = null;
 +        if (nextEdge.getTailNodes() != null && nextEdge.getTailNodes().size() > 0) {
 +          nextStates = new DerivationState[nextEdge.getTailNodes().size()];
 +          for (int j = 0; j < nextStates.length; j++)
 +            nextStates[j] = derivationStates[i].getChildDerivationState(nextEdge, j);
 +        }
 +        Tree childTree = buildTree(nextEdge.getRule(), nextStates, maxDepth - 1);
 +
 +        /* This can be null if there is no entry for the rule in the map */
 +        if (childTree != null)
 +          frontierTree.children = childTree.children;
 +      } else {
 +        frontierTree.children = tree.children;
 +      }
 +    }
 +      
 +    return tree;
 +  }
 +  
 +  /**
 +   * <p>Builds a tree from the kth-best derivation state. This is done by initializing the tree with
 +   * the internal fragment corresponding to the rule; this will be the top of the tree. We then
 +   * recursively visit the derivation state objects, following the route through the hypergraph
 +   * defined by them.</p>
 +   * 
 +   * @param derivationState array of state objects
 +   * @param maxDepth of route through the hypergraph
 +   * @return the Tree
 +   */
 +  public static Tree buildTree(DerivationState derivationState, int maxDepth) {
 +    Rule rule = derivationState.edge.getRule();
 +    
 +    Tree tree = getFragmentFromYield(rule.getTargetWords());
 +
 +    if (tree == null) {
 +      return null;
 +    }
 +
 +    tree = tree.shallowClone();
 +    
 +    LOG.debug("buildTree({})", tree);
 +
 +    if (rule.getArity() > 0 && maxDepth > 0) {
 +      List<Tree> frontier = tree.getNonterminalYield();
 +
 +      /* The English side of a rule is a sequence of integers. Nonnegative integers are word
 +       * indices in the Vocabulary, while negative indices are used to nonterminals. These negative
 +       * indices are a *permutation* of the source side nonterminals, which contain the actual
 +       * nonterminal Vocabulary indices for the nonterminal names. Here, we convert this permutation
 +       * to a nonnegative 0-based permutation and store it in tailIndices. This is used to index 
 +       * the incoming DerivationState items, which are ordered by the source side.
 +       */
 +      ArrayList<Integer> tailIndices = new ArrayList<Integer>();
-       int[] englishInts = rule.getTarget();
-       for (int i = 0; i < englishInts.length; i++)
-         if (englishInts[i] < 0)
-           tailIndices.add(-(englishInts[i] + 1));
++      int[] targetInts = rule.getTarget();
++      for (int i = 0; i < targetInts.length; i++)
++        if (targetInts[i] < 0)
++          tailIndices.add(-(targetInts[i] + 1));
 +
 +      /*
 +       * We now have the tree's yield. The substitution points on the yield should match the
 +       * nonterminals of the heads of the derivation states. Since we don't know which of the tree's
 +       * frontier items are terminals and which are nonterminals, we walk through the tail nodes,
 +       * and then match the label of each against the frontier node labels until we have a match.
 +       */
 +      // System.err.println(String.format("WORDS: %s\nTREE: %s", rule.getEnglishWords(), tree));
 +      for (int i = 0; i < rule.getArity(); i++) {
 +
 +        Tree frontierTree = frontier.get(tailIndices.get(i));
 +        frontierTree.setBoundary(true);
 +
 +        DerivationState childState = derivationState.getChildDerivationState(derivationState.edge, i);
 +        Tree childTree = buildTree(childState, maxDepth - 1);
 +
 +        /* This can be null if there is no entry for the rule in the map */
 +        if (childTree != null)
 +          frontierTree.children = childTree.children;
 +      }
 +    }
 +    
 +    return tree;
 +  }
 +
 +  /**
 +   * Takes a rule and its tail pointers and recursively constructs a tree (up to maxDepth).
 +   * 
 +   * This could be implemented by using the other buildTree() function and using the 1-best
 +   * DerivationState.
 +   * 
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to be used whilst building the tree
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode}'s
 +   * @param maxDepth to go in the tree
 +   * @return shallow clone of the Tree object
 +   */
 +  public static Tree buildTree(Rule rule, List<HGNode> tailNodes, int maxDepth) {
 +    Tree tree = getFragmentFromYield(rule.getTargetWords());
 +
 +    if (tree == null) {
 +      tree = new Tree(String.format("(%s %s)", Vocabulary.word(rule.getLHS()), rule.getTargetWords()));
 +      // System.err.println("COULDN'T FIND " + rule.getEnglishWords());
 +      // System.err.println("RULE " + rule);
 +      // for (Entry<String, Tree> pair: rulesToFragments.entrySet())
 +      // System.err.println("  FOUND " + pair.getKey());
 +
 +//      return null;
 +    } else {
 +      tree = tree.shallowClone();
 +    }
 +
 +    if (tree != null && tailNodes != null && tailNodes.size() > 0 && maxDepth > 0) {
 +      List<Tree> frontier = tree.getNonterminalYield();
 +
 +      ArrayList<Integer> tailIndices = new ArrayList<Integer>();
-       int[] englishInts = rule.getTarget();
-       for (int i = 0; i < englishInts.length; i++)
-         if (englishInts[i] < 0)
-           tailIndices.add(-1 * englishInts[i] - 1);
++      int[] targetInts = rule.getTarget();
++      for (int i = 0; i < targetInts.length; i++)
++        if (targetInts[i] < 0)
++          tailIndices.add(-1 * targetInts[i] - 1);
 +
 +      /*
 +       * We now have the tree's yield. The substitution points on the yield should match the
 +       * nonterminals of the tail nodes. Since we don't know which of the tree's frontier items are
 +       * terminals and which are nonterminals, we walk through the tail nodes, and then match the
 +       * label of each against the frontier node labels until we have a match.
 +       */
 +      // System.err.println(String.format("WORDS: %s\nTREE: %s", rule.getEnglishWords(), tree));
 +      for (int i = 0; i < tailNodes.size(); i++) {
 +
 +        // String lhs = tailNodes.get(i).getLHS().replaceAll("[\\[\\]]", "");
 +        // System.err.println(String.format("  %d: %s", i, lhs));
 +        try {
-           Tree frontierTree = frontier.get(tailIndices.get(i).intValue());
++          Tree frontierTree = frontier.get(tailIndices.get(i));
 +          frontierTree.setBoundary(true);
 +
 +          HyperEdge edge = tailNodes.get(i).bestHyperedge;
 +          if (edge != null) {
 +            Tree childTree = buildTree(edge.getRule(), edge.getTailNodes(), maxDepth - 1);
 +            /* This can be null if there is no entry for the rule in the map */
 +            if (childTree != null)
 +              frontierTree.children = childTree.children;
 +          } else {
 +            frontierTree.children = tree.children;
 +          }
 +        } catch (IndexOutOfBoundsException e) {
 +          LOG.error("ERROR at index {}", i);
 +          LOG.error("RULE: {}  TREE: {}", rule.getTargetWords(), tree);
 +          LOG.error("  FRONTIER:");
 +          for (Tree kid : frontier) {
 +            LOG.error("    {}", kid);
 +          }
 +          throw new RuntimeException(String.format("ERROR at index %d", i), e);
 +        }
 +      }
 +    }
 +
 +    return tree;
 +  }
 +
 +  public static void main(String[] args) {
 +    LineReader reader = new LineReader(System.in);
 +
 +    for (String line : reader) {
 +      try {
 +        Tree tree = Tree.fromString(line);
 +        tree.insertSentenceMarkers();
 +        System.out.println(tree);
 +      } catch (Exception e) {
 +        System.out.println("");
 +      }
 +    }
 +
 +    /*
 +     * Tree fragment = Tree
 +     * .fromString("(TOP (S (NP (DT the) (NN boy)) (VP (VBD ate) (NP (DT the) (NN food)))))");
 +     * fragment.insertSentenceMarkers("<s>", "</s>");
 +     * 
 +     * System.out.println(fragment);
 +     * 
 +     * ArrayList<Tree> trees = new ArrayList<Tree>(); trees.add(Tree.fromString("(NN \"mat\")"));
 +     * trees.add(Tree.fromString("(S (NP DT NN) VP)"));
 +     * trees.add(Tree.fromString("(S (NP (DT \"the\") NN) VP)"));
 +     * trees.add(Tree.fromString("(S (NP (DT the) NN) VP)"));
 +     * 
 +     * for (Tree tree : trees) { System.out.println(String.format("TREE %s DEPTH %d LEX? %s", tree,
 +     * tree.getDepth(), tree.isLexicalized())); }
 +     */
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Trees.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Trees.java
index d06388c,0000000..211ad20
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Trees.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/fragmentlm/Trees.java
@@@ -1,270 -1,0 +1,270 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.fragmentlm;
 +
 +import java.io.IOException;
 +import java.io.PushbackReader;
 +import java.io.Reader;
 +import java.io.StringReader;
 +import java.util.ArrayList;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.NoSuchElementException;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +/**
 + * Tools for displaying, reading, and modifying trees. Borrowed from the Berkeley Parser.
 + * 
 + * @author Dan Klein
 + */
 +public class Trees {
 +
 +  public static class PennTreeReader implements Iterator<Tree> {
-     public static String ROOT_LABEL = "ROOT";
++    public static final String ROOT_LABEL = "ROOT";
 +
-     PushbackReader in;
++    final PushbackReader in;
 +    Tree nextTree;
 +
 +    public boolean hasNext() {
 +      return (nextTree != null);
 +    }
 +
 +    public Tree next() {
 +      if (!hasNext())
 +        throw new NoSuchElementException();
 +      Tree tree = nextTree;
 +      nextTree = readRootTree();
 +      // System.out.println(nextTree);
 +      return tree;
 +    }
 +
 +    private Tree readRootTree() {
 +      try {
 +        readWhiteSpace();
 +        if (!isLeftParen(peek()))
 +          return null;
 +        return readTree(true);
 +      } catch (IOException e) {
 +        throw new RuntimeException("Error reading tree.");
 +      }
 +    }
 +
 +    private Tree readTree(boolean isRoot) throws IOException {
 +      if (!isLeftParen(peek())) {
 +        return readLeaf();
 +      } else {
 +        readLeftParen();
 +        String label = readLabel();
 +        if (label.length() == 0 && isRoot)
 +          label = ROOT_LABEL;
 +        List<Tree> children = readChildren();
 +        readRightParen();
 +        return new Tree(label, children);
 +      }
 +    }
 +
 +    private String readLabel() throws IOException {
 +      readWhiteSpace();
 +      return readText();
 +    }
 +
 +    private String readText() throws IOException {
 +      StringBuilder sb = new StringBuilder();
 +      int ch = in.read();
 +      while (!isWhiteSpace(ch) && !isLeftParen(ch) && !isRightParen(ch)) {
 +        sb.append((char) ch);
 +        ch = in.read();
 +      }
 +      in.unread(ch);
 +      // System.out.println("Read text: ["+sb+"]");
 +      return sb.toString().intern();
 +    }
 +
 +    private List<Tree> readChildren() throws IOException {
 +      readWhiteSpace();
 +      // if (!isLeftParen(peek()))
 +      // return Collections.singletonList(readLeaf());
 +      return readChildList();
 +    }
 +
 +    private int peek() throws IOException {
 +      int ch = in.read();
 +      in.unread(ch);
 +      return ch;
 +    }
 +
 +    private Tree readLeaf() throws IOException {
 +      String label = readText();
 +      return new Tree(label);
 +    }
 +
 +    private List<Tree> readChildList() throws IOException {
-       List<Tree> children = new ArrayList<Tree>();
++      List<Tree> children = new ArrayList<>();
 +      readWhiteSpace();
 +      while (!isRightParen(peek())) {
 +        children.add(readTree(false));
 +        readWhiteSpace();
 +      }
 +      return children;
 +    }
 +
 +    private void readLeftParen() throws IOException {
 +      // System.out.println("Read left.");
 +      readWhiteSpace();
 +      int ch = in.read();
 +      if (!isLeftParen(ch))
 +        throw new RuntimeException("Format error reading tree. (leftParen)");
 +    }
 +
 +    private void readRightParen() throws IOException {
 +      // System.out.println("Read right.");
 +      readWhiteSpace();
 +      int ch = in.read();
 +
 +      if (!isRightParen(ch)) {
 +        System.out.println((char) ch);
 +        throw new RuntimeException("Format error reading tree. (rightParen)");
 +      }
 +    }
 +
 +    private void readWhiteSpace() throws IOException {
 +      int ch = in.read();
 +      while (isWhiteSpace(ch)) {
 +        ch = in.read();
 +      }
 +      in.unread(ch);
 +    }
 +
 +    private boolean isWhiteSpace(int ch) {
 +      return (ch == ' ' || ch == '\t' || ch == '\f' || ch == '\r' || ch == '\n');
 +    }
 +
 +    private boolean isLeftParen(int ch) {
 +      return ch == '(';
 +    }
 +
 +    private boolean isRightParen(int ch) {
 +      return ch == ')';
 +    }
 +
 +    public void remove() {
 +      throw new UnsupportedOperationException();
 +    }
 +
 +    public PennTreeReader(Reader in) {
-       this.in = new PushbackReader((java.io.Reader) in);
++      this.in = new PushbackReader(in);
 +      nextTree = readRootTree();
 +      // System.out.println(nextTree);
 +    }
 +  }
 +
 +  /**
 +   * Renderer for pretty-printing trees according to the Penn Treebank indenting guidelines
 +   * (mutliline). Adapted from code originally written by Dan Klein and modified by Chris Manning.
 +   */
 +  public static class PennTreeRenderer {
 +
 +    /**
 +     * Print the tree as done in Penn Treebank merged files. The formatting should be exactly the
 +     * same, but we don't print the trailing whitespace found in Penn Treebank trees. The basic
 +     * deviation from a bracketed indented tree is to in general collapse the printing of adjacent
 +     * preterminals onto one line of tags and words. Additional complexities are that conjunctions
 +     * (tag CC) are not collapsed in this way, and that the unlabeled outer brackets are collapsed
 +     * onto the same line as the next bracket down.
 +     * 
 +     * @param tree you wish to render and print
 +     * @return a rendered String representation of the tree
 +     */
 +    public static  String render(Tree tree) {
 +      StringBuilder sb = new StringBuilder();
 +      renderTree(tree, 0, false, false, false, true, sb);
 +      sb.append('\n');
 +      return sb.toString();
 +    }
 +
 +    /**
 +     * Display a node, implementing Penn Treebank style layout
 +     */
 +    private static  void renderTree(Tree tree, int indent, boolean parentLabelNull,
 +        boolean firstSibling, boolean leftSiblingPreTerminal, boolean topLevel, StringBuilder sb) {
 +      // the condition for staying on the same line in Penn Treebank
 +      boolean suppressIndent = (parentLabelNull || (firstSibling && tree.isPreTerminal()) || (leftSiblingPreTerminal
 +          && tree.isPreTerminal()));
 +      if (suppressIndent) {
 +        sb.append(' ');
 +      } else {
 +        if (!topLevel) {
 +          sb.append('\n');
 +        }
 +        for (int i = 0; i < indent; i++) {
 +          sb.append("  ");
 +        }
 +      }
 +      if (tree.isLeaf() || tree.isPreTerminal()) {
 +        renderFlat(tree, sb);
 +        return;
 +      }
 +      sb.append('(');
 +      sb.append(tree.getLabel());
 +      renderChildren(tree.getChildren(), indent + 1, false, sb);
 +      sb.append(')');
 +    }
 +
 +    private static  void renderFlat(Tree tree, StringBuilder sb) {
 +      if (tree.isLeaf()) {
 +        sb.append(Vocabulary.word(tree.getLabel()));
 +        return;
 +      }
 +      sb.append('(');
 +      sb.append(Vocabulary.word(tree.getLabel()));
 +      sb.append(' ');
 +      sb.append(Vocabulary.word(tree.getChildren().get(0).getLabel()));
 +      sb.append(')');
 +    }
 +
 +    private static void renderChildren(List<Tree> children, int indent,
 +        boolean parentLabelNull, StringBuilder sb) {
 +      boolean firstSibling = true;
 +      boolean leftSibIsPreTerm = true; // counts as true at beginning
 +      for (Tree child : children) {
 +        renderTree(child, indent, parentLabelNull, firstSibling, leftSibIsPreTerm, false, sb);
 +        leftSibIsPreTerm = child.isPreTerminal();
 +        firstSibling = false;
 +      }
 +    }
 +  }
 +
 +  public static void main(String[] args) {
 +    String ptbTreeString = "((S (NP (DT the) (JJ quick) (JJ brown) (NN fox)) (VP (VBD jumped) (PP (IN over) (NP (DT the) (JJ lazy) (NN dog)))) (. .)))";
 +
 +    if (args.length > 0) {
 +      String tree = "";
 +      for (String str : args) {
 +        tree += " " + str;
 +      }
 +      ptbTreeString = tree.substring(1);
 +    }
 +
 +    PennTreeReader reader = new PennTreeReader(new StringReader(ptbTreeString));
 +
 +    Tree tree = reader.next();
 +    System.out.println(PennTreeRenderer.render(tree));
 +    System.out.println(tree);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/KenLM.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/KenLM.java
index 336189b,0000000..93d54ed
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/KenLM.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/KenLM.java
@@@ -1,257 -1,0 +1,257 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.state_maintenance.KenLMState;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * JNI wrapper for KenLM. This version of KenLM supports two use cases, implemented by the separate
 + * feature functions KenLMFF and LanguageModelFF. KenLMFF uses the RuleScore() interface in
 + * lm/left.hh, returning a state pointer representing the KenLM state, while LangaugeModelFF handles
 + * state by itself and just passes in the ngrams for scoring.
 + * 
 + * @author Kenneth Heafield
 + * @author Matt Post post@cs.jhu.edu
 + */
 +
 +public class KenLM implements NGramLanguageModel, Comparable<KenLM> {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(KenLM.class);
 +
 +  private final long pointer;
 +
 +  // this is read from the config file, used to set maximum order
 +  private final int ngramOrder;
 +  // inferred from model file (may be larger than ngramOrder)
 +  private final int N;
 +
-   private final static native long construct(String file_name);
++  private static native long construct(String file_name);
 +
-   private final static native void destroy(long ptr);
++  private static native void destroy(long ptr);
 +
-   private final static native int order(long ptr);
++  private static native int order(long ptr);
 +
-   private final static native boolean registerWord(long ptr, String word, int id);
++  private static native boolean registerWord(long ptr, String word, int id);
 +
-   private final static native float prob(long ptr, int words[]);
++  private static native float prob(long ptr, int words[]);
 +
-   private final static native float probForString(long ptr, String[] words);
++  private static native float probForString(long ptr, String[] words);
 +
-   private final static native boolean isKnownWord(long ptr, String word);
++  private static native boolean isKnownWord(long ptr, String word);
 +  
-   private final static native boolean isLmOov(long ptr, int word);
++  private static native boolean isLmOov(long ptr, int word);
 +
-   private final static native StateProbPair probRule(long ptr, long pool, long words[]);
++  private static native StateProbPair probRule(long ptr, long pool, long words[]);
 +  
-   private final static native float estimateRule(long ptr, long words[]);
++  private static native float estimateRule(long ptr, long words[]);
 +
-   private final static native float probString(long ptr, int words[], int start);
++  private static native float probString(long ptr, int words[], int start);
 +
-   private final static native long createPool();
++  private static native long createPool();
 +
-   private final static native void destroyPool(long pointer);
++  private static native void destroyPool(long pointer);
 +
 +  public KenLM(int order, String file_name) {
 +    pointer = initializeSystemLibrary(file_name);
 +    ngramOrder = order;
 +    N = order(pointer);
 +  }
 +
 +  /**
 +   * Constructor if order is not known.
 +   * Order will be inferred from the model.
 +   * @param file_name string path to an input file
 +   */
 +  public KenLM(String file_name) {
 +    pointer = initializeSystemLibrary(file_name);
 +    N = order(pointer);
 +    ngramOrder = N;
 +  }
 +
 +  private long initializeSystemLibrary(String file_name) {
 +    try {
 +      System.loadLibrary("ken");
 +      return construct(file_name);
 +    } catch (UnsatisfiedLinkError e) {
 +      LOG.error("Can't find libken.so (libken.dylib on OS X) on the Java library path.");
 +      throw new KenLMLoadException(e);
 +    }
 +  }
 +
 +  public class KenLMLoadException extends RuntimeException {
 +
 +    public KenLMLoadException(UnsatisfiedLinkError e) {
 +      super(e);
 +    }
 +  }
 +
 +  public long createLMPool() {
 +    return createPool();
 +  }
 +
 +  public void destroyLMPool(long pointer) {
 +    destroyPool(pointer);
 +  }
 +
 +  public void destroy() {
 +    destroy(pointer);
 +  }
 +
 +  public int getOrder() {
 +    return ngramOrder;
 +  }
 +
 +  public boolean registerWord(String word, int id) {
 +    return registerWord(pointer, word, id);
 +  }
 +
 +  public float prob(int[] words) {
 +    return prob(pointer, words);
 +  }
 +
 +  /**
 +   * Query for n-gram probability using strings.
 +   * @param words a string array of words
 +   * @return float value denoting probability
 +   */
 +  public float prob(String[] words) {
 +    return probForString(pointer, words);
 +  }
 +
 +  // Apparently Zhifei starts some array indices at 1. Change to 0-indexing.
 +  public float probString(int words[], int start) {
 +    return probString(pointer, words, start - 1);
 +  }
 +
 +  /**
 +   * This function is the bridge to the interface in kenlm/lm/left.hh, which has KenLM score the
 +   * whole rule. It takes an array of words and states retrieved from tail nodes (nonterminals in the
 +   * rule). Nonterminals have a negative value so KenLM can distinguish them. The sentence number is
 +   * needed so KenLM knows which memory pool to use. When finished, it returns the updated KenLM
 +   * state and the LM probability incurred along this rule.
 +   * 
 +   * @param words array of words
 +   * @param poolPointer todo
 +   * @return the updated {@link org.apache.joshua.decoder.ff.lm.KenLM.StateProbPair} e.g. 
 +   * KenLM state and the LM probability incurred along this rule
 +   */
 +  public StateProbPair probRule(long[] words, long poolPointer) {
 +
 +    StateProbPair pair = null;
 +    try {
 +      pair = probRule(pointer, poolPointer, words);
 +    } catch (NoSuchMethodError e) {
 +      e.printStackTrace();
 +      System.exit(1);
 +    }
 +
 +    return pair;
 +  }
 +
 +  /**
 +   * Public facing function that estimates the cost of a rule, which value is used for sorting
 +   * rules during cube pruning.
 +   * 
 +   * @param words array of words
 +   * @return the estimated cost of the rule (the (partial) n-gram probabilities of all words in the rule)
 +   */
 +  public float estimateRule(long[] words) {
 +    float estimate = 0.0f;
 +    try {
 +      estimate = estimateRule(pointer, words);
 +    } catch (NoSuchMethodError e) {
 +      throw new RuntimeException(e);
 +    }
 +    
 +    return estimate;
 +  }
 +
 +  /**
 +   * The start symbol for a KenLM is the Vocabulary.START_SYM.
 +   * @return "&lt;s&gt;"
 +   */
 +  public String getStartSymbol() {
 +    return Vocabulary.START_SYM;
 +  }
 +  
 +  /**
 +   * Returns whether the given Vocabulary ID is unknown to the
 +   * KenLM vocabulary. This can be used for a LanguageModel_OOV features
 +   * and does not need to convert to an intermediate string.
 +   */
 +  @Override
 +  public boolean isOov(int wordId) {
 +    if (FormatUtils.isNonterminal(wordId)) {
 +      throw new IllegalArgumentException("Should not query for nonterminals!");
 +    }
 +    return isLmOov(pointer, wordId);
 +  }
 +
 +  public boolean isKnownWord(String word) {
 +    return isKnownWord(pointer, word);
 +  }
 +
 +
 +  /**
 +   * Inner class used to hold the results returned from KenLM with left-state minimization. Note
 +   * that inner classes have to be static to be accessible from the JNI!
 +   */
 +  public static class StateProbPair {
 +    public KenLMState state = null;
 +    public float prob = 0.0f;
 +
 +    public StateProbPair(long state, float prob) {
 +      this.state = new KenLMState(state);
 +      this.prob = prob;
 +    }
 +  }
 +
 +  @Override
 +  public int compareTo(KenLM other) {
 +    if (this == other)
 +      return 0;
 +    else
 +      return -1;
 +  }
 +
 +  /**
 +   * These functions are used if KenLM is invoked under LanguageModelFF instead of KenLMFF.
 +   */
 +  @Override
 +  public float sentenceLogProbability(int[] sentence, int order, int startIndex) {
 +    return probString(sentence, startIndex);
 +  }
 +
 +  @Override
 +  public float ngramLogProbability(int[] ngram, int order) {
 +    if (order != N && order != ngram.length)
 +      throw new RuntimeException("Lower order not supported.");
 +    return prob(ngram);
 +  }
 +
 +  @Override
 +  public float ngramLogProbability(int[] ngram) {
 +    return prob(ngram);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
index c460cb0,0000000..0b522cb
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
@@@ -1,524 -1,0 +1,523 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm;
 +
 +import static org.apache.joshua.util.FormatUtils.isNonterminal;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.LinkedList;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Support;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.FeatureMap;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.lm.berkeley_lm.LMGrammarBerkeley;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.state_maintenance.NgramDPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import com.google.common.annotations.VisibleForTesting;
 +import com.google.common.primitives.Ints;
 +
 +/**
 + * This class performs the following:
 + * <ol>
 + * <li>Gets the additional LM score due to combinations of small items into larger ones by using
 + * rules</li>
 + * <li>Gets the LM state</li>
 + * <li>Gets the left-side LM state estimation score</li>
 + * </ol>
 + *
 + * @author Matt Post post@cs.jhu.edu
 + * @author Juri Ganitkevitch juri@cs.jhu.edu
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +public class LanguageModelFF extends StatefulFF {
 +
 +  static final Logger LOG = LoggerFactory.getLogger(LanguageModelFF.class);
 +
 +  public static int LM_INDEX = 0;
 +  private int startSymbolId;
 +
 +  /**
 +   * N-gram language model. We assume the language model is in ARPA format for equivalent state:
 +   *
 +   * <ol>
 +   * <li>We assume it is a backoff lm, and high-order ngram implies low-order ngram; absense of
 +   * low-order ngram implies high-order ngram</li>
 +   * <li>For a ngram, existence of backoffweight =&gt; existence a probability Two ways of dealing with
 +   * low counts:
 +   * <ul>
 +   * <li>SRILM: don't multiply zeros in for unknown words</li>
 +   * <li>Pharaoh: cap at a minimum score exp(-10), including unknown words</li>
 +   * </ul>
 +   * </li>
 +   * </ol>
 +   */
 +  protected NGramLanguageModel languageModel;
 +  
 +  protected final static String NAME_PREFIX = "lm_";
 +  protected final static String OOV_SUFFIX = "_oov";
 +  protected final int oovFeatureId;
 +
 +  /**
 +   * We always use this order of ngram, though the LMGrammar may provide higher order probability.
 +   */
 +  protected final int ngramOrder;
 +
 +  /**
 +   * We cache the weight of the feature since there is only one.
 +   */
 +  protected String type;
-   protected String path;
++  protected final String path;
 +
 +  /** Whether this is a class-based LM */
 +  protected boolean isClassLM;
 +  private ClassMap classMap;
 +  
 +  /** Whether this feature function fires LM oov indicators */ 
 +  protected boolean withOovFeature;
 +
 +  public LanguageModelFF(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, NAME_PREFIX + LM_INDEX, args, config);
 +    this.oovFeatureId = FeatureMap.hashFeature(NAME_PREFIX + LM_INDEX + OOV_SUFFIX);
 +    LM_INDEX++;
 +
 +    this.type = parsedArgs.get("lm_type");
 +    this.ngramOrder = Integer.parseInt(parsedArgs.get("lm_order"));
 +    this.path = parsedArgs.get("lm_file");
 +
 +    if (parsedArgs.containsKey("class_map")) {
 +      this.isClassLM = true;
 +      this.classMap = new ClassMap(parsedArgs.get("class_map"));
 +    }
 +    
 +    if (parsedArgs.containsKey("oov_feature")) {
 +      this.withOovFeature = true;
 +    }
 +
 +    initializeLM();
 +  }
 +
 +  /**
 +   * Initializes the underlying language model.
 +   */
 +  protected void initializeLM() {
-     if (type.equals("kenlm")) {
++    switch (type) {
++    case "kenlm":
 +      this.languageModel = new KenLM(ngramOrder, path);
 +
-     } else if (type.equals("berkeleylm")) {
++      break;
++    case "berkeleylm":
 +      this.languageModel = new LMGrammarBerkeley(ngramOrder, path);
 +
-     } else {
++      break;
++    default:
 +      String msg = String.format("* FATAL: Invalid backend lm_type '%s' for LanguageModel", type)
 +          + "*        Permissible values for 'lm_type' are 'kenlm' and 'berkeleylm'";
 +      throw new RuntimeException(msg);
 +    }
 +
 +    Vocabulary.registerLanguageModel(this.languageModel);
 +    Vocabulary.id(config.default_non_terminal);
 +
 +    startSymbolId = Vocabulary.id(Vocabulary.START_SYM);
 +  }
 +
 +  public NGramLanguageModel getLM() {
 +    return this.languageModel;
 +  }
 +
 +  public boolean isClassLM() {
 +  	return this.isClassLM;
 +  }
 +
 +  public String logString() {
 +    return String.format("%s, order %d (weight %.3f), classLm=%s", name, languageModel.getOrder(), weights.getOrDefault(featureId), isClassLM);
 +  }
 +
 +  /**
 +   * Computes the features incurred along this edge. Note that these features
 +   * are unweighted costs of the feature; they are the feature cost, not the
 +   * model cost, or the inner product of them.
 +   */
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j,
 +    SourcePath sourcePath, Sentence sentence, Accumulator acc) {
 +
 +    if (rule == null) {
 +      return null;
 +    }
 +
 +    int[] words;
 +    if (config.source_annotations) {
 +      // get source side annotations and project them to the target side
 +      words = getTags(rule, i, j, sentence);
 +    } else {
 +      words = getRuleIds(rule);
 +    }
 +    
 +    if (withOovFeature) {
 +      acc.add(oovFeatureId, getOovs(words));
 +    }
 +
 +    return computeTransition(words, tailNodes, acc);
 +
 +	}
 +
 +  /**
 +   * Retrieve ids from rule. These are either simply the rule ids on the target
 +   * side, their corresponding class map ids, or the configured source-side
 +   * annotation tags.
 +   * @param rule an input from from which to retrieve ids
 +   * @return an array if int's representing the id's from the input Rule
 +   */
 +  @VisibleForTesting
 +  public int[] getRuleIds(final Rule rule) {
 +    if (this.isClassLM) {
 +      // map words to class ids
 +      return getClasses(rule);
 +    }
 +    // Regular LM: use rule word ids
 +    return rule.getTarget();
 +  }
 +  
 +  /**
 +   * Returns the number of LM oovs on the rule's target side.
 +   * Skips nonterminals.
 +   * @param words an input int array representing words we wish to obtain OOVs for
 +   * @return the number of OOVs for thr given int array
 +   */
 +  @VisibleForTesting
 +  public int getOovs(final int[] words) {
 +    int result = 0;
 +    for (int id : words) {
 +      if (!isNonterminal(id) && languageModel.isOov(id)) {
 +        result++;
 +      }
 +    }
 +    return result;
 +  }
 +
 +  /**
 +   * Input sentences can be tagged with information specific to the language model. This looks for
 +   * such annotations by following a word's alignments back to the source words, checking for
 +   * annotations, and replacing the surface word if such annotations are found.
 +   * @param rule the {@link org.apache.joshua.decoder.ff.tm.Rule} to use
 +   * @param begin todo
 +   * @param end todo
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return todo
 +   */
 +  protected int[] getTags(Rule rule, int begin, int end, Sentence sentence) {
 +    /* Very important to make a copy here, so the original rule is not modified */
 +    int[] tokens = Arrays.copyOf(rule.getTarget(), rule.getTarget().length);
 +    byte[] alignments = rule.getAlignment();
 +
 +    //    System.err.println(String.format("getTags() %s", rule.getRuleString()));
 +
 +    /* For each target-side token, project it to each of its source-language alignments. If any of those
 +     * are annotated, take the first annotation and quit.
 +     */
 +    if (alignments != null) {
 +      for (int i = 0; i < tokens.length; i++) {
 +        if (tokens[i] > 0) { // skip nonterminals
 +          for (int j = 0; j < alignments.length; j += 2) {
 +            if (alignments[j] == i) {
 +              String annotation = sentence.getAnnotation((int)alignments[i] + begin, "class");
 +              if (annotation != null) {
 +                //                System.err.println(String.format("  word %d source %d abs %d annotation %d/%s",
 +                //                    i, alignments[i], alignments[i] + begin, annotation, Vocabulary.word(annotation)));
 +                tokens[i] = Vocabulary.id(annotation);
 +                break;
 +              }
 +            }
 +          }
 +        }
 +      }
 +    }
 +
 +    return tokens;
 +  }
 +
 +  /**
 +   * Sets the class map if this is a class LM
 +   * @param fileName a string path to a file
 +   * @throws IOException if there is an error reading the input file
 +   */
 +  public void setClassMap(String fileName) throws IOException {
 +    this.classMap = new ClassMap(fileName);
 +  }
 +
 +  /**
 +   * Replace each word in a rule with the target side classes.
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to use when obtaining tokens
 +   * @return int[] of tokens
 +   */
 +  protected int[] getClasses(Rule rule) {
 +    if (this.classMap == null) {
 +      throw new RuntimeException("The class map is not set. Cannot use the class LM ");
 +    }
 +    /* Very important to make a copy here, so the original rule is not modified */
 +    int[] tokens = Arrays.copyOf(rule.getTarget(), rule.getTarget().length);
 +    for (int i = 0; i < tokens.length; i++) {
 +      if (tokens[i] > 0 ) { // skip non-terminals
 +        tokens[i] = this.classMap.getClassID(tokens[i]);
 +      }
 +    }
 +    return tokens;
 +  }
 +
 +  @Override
 +  public DPState computeFinal(HGNode tailNode, int i, int j, SourcePath sourcePath, Sentence sentence,
 +      Accumulator acc) {
 +    return computeFinalTransition((NgramDPState) tailNode.getDPState(stateIndex), acc);
 +  }
 +
 +  /**
 +   * This function computes all the complete n-grams found in the rule, as well as the incomplete
 +   * n-grams on the left-hand side.
 +   */
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +
 +    float lmEstimate = 0.0f;
 +    boolean considerIncompleteNgrams = true;
 +
 +    int[] enWords = getRuleIds(rule);
 +
-     List<Integer> words = new ArrayList<Integer>();
++    List<Integer> words = new ArrayList<>();
 +    boolean skipStart = (enWords[0] == startSymbolId); 
 +
 +    /*
 +     * Move through the words, accumulating language model costs each time we have an n-gram (n >=
 +     * 2), and resetting the series of words when we hit a nonterminal.
 +     */
-     for (int c = 0; c < enWords.length; c++) {
-       int currentWord = enWords[c];
++    for (int currentWord : enWords) {
 +      if (FormatUtils.isNonterminal(currentWord)) {
 +        lmEstimate += scoreChunkLogP(words, considerIncompleteNgrams, skipStart);
 +        words.clear();
 +        skipStart = false;
 +      } else {
 +        words.add(currentWord);
 +      }
 +    }
 +    lmEstimate += scoreChunkLogP(words, considerIncompleteNgrams, skipStart);
 +    
 +    final float oovEstimate = (withOovFeature) ? getOovs(enWords) : 0f;
 +
 +    return weights.getOrDefault(featureId) * lmEstimate + weights.getOrDefault(oovFeatureId) * oovEstimate;
 +  }
 +
 +  /**
 +   * Estimates the future cost of a rule. For the language model feature, this is the sum of the
 +   * costs of the leftmost k-grams, k = [1..n-1].
 +   */
 +  @Override
 +  public float estimateFutureCost(Rule rule, DPState currentState, Sentence sentence) {
 +    NgramDPState state = (NgramDPState) currentState;
 +
 +    float estimate = 0.0f;
 +    int[] leftContext = state.getLeftLMStateWords();
 +
 +    if (null != leftContext) {
 +      boolean skipStart = true;
 +      if (leftContext[0] != startSymbolId) {
 +        skipStart = false;
 +      }
 +      estimate += scoreChunkLogP(leftContext, true, skipStart);
 +    }
 +    // NOTE: no future cost for oov weight
 +    return weights.getOrDefault(featureId) * estimate;
 +  }
 +
 +  /**
 +   * Compute the cost of a rule application. The cost of applying a rule is computed by determining
 +   * the n-gram costs for all n-grams created by this rule application, and summing them. N-grams
 +   * are created when (a) terminal words in the rule string are followed by a nonterminal (b)
 +   * terminal words in the rule string are preceded by a nonterminal (c) we encounter adjacent
 +   * nonterminals. In all of these situations, the corresponding boundary words of the node in the
 +   * hypergraph represented by the nonterminal must be retrieved.
 +   *
 +   * IMPORTANT: only complete n-grams are scored. This means that hypotheses with fewer words
 +   * than the complete n-gram state remain *unscored*. This fact adds a lot of complication to the
 +   * code, including the use of the computeFinal* family of functions, which correct this fact for
 +   * sentences that are too short on the final transition.
 +   */
 +  private NgramDPState computeTransition(int[] enWords, List<HGNode> tailNodes, Accumulator acc) {
 +
 +    int[] current = new int[this.ngramOrder];
 +    int[] shadow = new int[this.ngramOrder];
 +    int ccount = 0;
 +    float transitionLogP = 0.0f;
 +    int[] left_context = null;
 +
-     for (int c = 0; c < enWords.length; c++) {
-       int curID = enWords[c];
- 
++    for (int curID : enWords) {
 +      if (FormatUtils.isNonterminal(curID)) {
 +        int index = -(curID + 1);
 +
 +        NgramDPState state = (NgramDPState) tailNodes.get(index).getDPState(stateIndex);
 +        int[] left = state.getLeftLMStateWords();
 +        int[] right = state.getRightLMStateWords();
 +
 +        // Left context.
-         for (int i = 0; i < left.length; i++) {
-           current[ccount++] = left[i];
++        for (int aLeft : left) {
++          current[ccount++] = aLeft;
 +
 +          if (left_context == null && ccount == this.ngramOrder - 1)
 +            left_context = Arrays.copyOf(current, ccount);
 +
 +          if (ccount == this.ngramOrder) {
 +            // Compute the current word probability, and remove it.
 +            float prob = this.languageModel.ngramLogProbability(current, this.ngramOrder);
 +            //            System.err.println(String.format("-> prob(%s) = %f", Vocabulary.getWords(current), prob));
 +            transitionLogP += prob;
 +            System.arraycopy(current, 1, shadow, 0, this.ngramOrder - 1);
 +            int[] tmp = current;
 +            current = shadow;
 +            shadow = tmp;
 +            --ccount;
 +          }
 +        }
 +        System.arraycopy(right, 0, current, ccount - right.length, right.length);
 +      } else { // terminal words
 +        current[ccount++] = curID;
 +
 +        if (left_context == null && ccount == this.ngramOrder - 1)
 +          left_context = Arrays.copyOf(current, ccount);
 +
 +        if (ccount == this.ngramOrder) {
 +          // Compute the current word probability, and remove it.s
 +          float prob = this.languageModel.ngramLogProbability(current, this.ngramOrder);
 +          //          System.err.println(String.format("-> prob(%s) = %f", Vocabulary.getWords(current), prob));
 +          transitionLogP += prob;
 +          System.arraycopy(current, 1, shadow, 0, this.ngramOrder - 1);
 +          int[] tmp = current;
 +          current = shadow;
 +          shadow = tmp;
 +          --ccount;
 +        }
 +      }
 +    }
 +    //    acc.add(name, transitionLogP);
 +    acc.add(featureId, transitionLogP);
 +
 +    if (left_context != null) {
 +      return new NgramDPState(left_context, Arrays.copyOfRange(current, ccount - this.ngramOrder
 +          + 1, ccount));
 +    } else {
 +      int[] context = Arrays.copyOf(current, ccount);
 +      return new NgramDPState(context, context);
 +    }
 +  }
 +
 +  /**
 +   * This function differs from regular transitions because we incorporate the cost of incomplete
 +   * left-hand ngrams, as well as including the start- and end-of-sentence markers (if they were
 +   * requested when the object was created).
 +   *
 +   * @param state the dynamic programming state
 +   * @return the final transition probability (including incomplete n-grams)
 +   */
 +  private NgramDPState computeFinalTransition(NgramDPState state, Accumulator acc) {
 +
 +    //    System.err.println(String.format("LanguageModel::computeFinalTransition()"));
 +
 +    float res = 0.0f;
-     LinkedList<Integer> currentNgram = new LinkedList<Integer>();
++    LinkedList<Integer> currentNgram = new LinkedList<>();
 +    int[] leftContext = state.getLeftLMStateWords();
 +    int[] rightContext = state.getRightLMStateWords();
 +
-     for (int i = 0; i < leftContext.length; i++) {
-       int t = leftContext[i];
++    for (int t : leftContext) {
 +      currentNgram.add(t);
 +
 +      if (currentNgram.size() >= 2) { // start from bigram
-         float prob = this.languageModel.ngramLogProbability(Support.toArray(currentNgram),
-             currentNgram.size());
++        float prob = this.languageModel
++            .ngramLogProbability(Support.toArray(currentNgram), currentNgram.size());
 +        res += prob;
 +      }
 +      if (currentNgram.size() == this.ngramOrder)
 +        currentNgram.removeFirst();
 +    }
 +
 +    // Tell the accumulator
 +    //    acc.add(name, res);
 +    acc.add(featureId, res);
 +
 +    // State is the same
 +    return new NgramDPState(leftContext, rightContext);
 +  }
 +
 +
 +  /**
 +   * Compatibility method for {@link #scoreChunkLogP(int[], boolean, boolean)}
 +   */
 +  private float scoreChunkLogP(List<Integer> words, boolean considerIncompleteNgrams,
 +      boolean skipStart) {
 +    return scoreChunkLogP(Ints.toArray(words), considerIncompleteNgrams, skipStart);
 +  }
 +
 +  /**
 +   * This function is basically a wrapper for NGramLanguageModel::sentenceLogProbability(). It
 +   * computes the probability of a phrase ("chunk"), using lower-order n-grams for the first n-1
 +   * words.
 +   *
 +   * @param words
 +   * @param considerIncompleteNgrams
 +   * @param skipStart
 +   * @return the phrase log probability
 +   */
 +  private float scoreChunkLogP(int[] words, boolean considerIncompleteNgrams,
 +      boolean skipStart) {
 +
 +    float score = 0.0f;
 +    if (words.length > 0) {
 +      int startIndex;
 +      if (!considerIncompleteNgrams) {
 +        startIndex = this.ngramOrder;
 +      } else if (skipStart) {
 +        startIndex = 2;
 +      } else {
 +        startIndex = 1;
 +      }
 +      score = this.languageModel.sentenceLogProbability(words, this.ngramOrder, startIndex);
 +    }
 +
 +    return score;
 +  }
 +
 +  /**
 +   * Public method to set LM_INDEX back to 0.
 +   * Required if multiple instances of the JoshuaDecoder live in the same JVM.
 +   */
 +  public static void resetLmIndex() {
 +    LM_INDEX = 0;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeley.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeley.java
index 5c45520,0000000..4bf55b5
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeley.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeley.java
@@@ -1,211 -1,0 +1,211 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.berkeley_lm;
 +
 +import java.io.File;
 +import java.util.Arrays;
 +import java.util.logging.Handler;
 +import java.util.logging.Level;
 +import java.util.logging.Logger;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.lm.DefaultNGramLanguageModel;
 +
 +import com.google.common.annotations.VisibleForTesting;
 +
 +import edu.berkeley.nlp.lm.ArrayEncodedNgramLanguageModel;
 +import edu.berkeley.nlp.lm.ConfigOptions;
 +import edu.berkeley.nlp.lm.StringWordIndexer;
 +import edu.berkeley.nlp.lm.WordIndexer;
 +import edu.berkeley.nlp.lm.cache.ArrayEncodedCachingLmWrapper;
 +import edu.berkeley.nlp.lm.io.LmReaders;
 +import edu.berkeley.nlp.lm.util.StrUtils;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class wraps Berkeley LM.
 + *
 + * @author adpauls@gmail.com
 + */
 +public class LMGrammarBerkeley extends DefaultNGramLanguageModel {
 +
 +  public static final org.slf4j.Logger LOG = LoggerFactory.getLogger(LMGrammarBerkeley.class);
 +
 +  private ArrayEncodedNgramLanguageModel<String> lm;
 +
 +  private static final Logger logger = Logger.getLogger(LMGrammarBerkeley.class.getName());
 +
 +  private int[] vocabIdToMyIdMapping;
 +
-   private ThreadLocal<int[]> arrayScratch = new ThreadLocal<int[]>() {
++  private final ThreadLocal<int[]> arrayScratch = new ThreadLocal<int[]>() {
 +
 +    @Override
 +    protected int[] initialValue() {
 +      return new int[5];
 +    }
 +  };
 +
 +  private int mappingLength = 0;
 +
 +  private final int unkIndex;
 +
 +  private static boolean logRequests = false;
 +
 +  private static Handler logHandler = null;
 +
 +  public LMGrammarBerkeley(int order, String lm_file) {
 +    super(order);
 +    vocabIdToMyIdMapping = new int[10];
 +
 +    if (!new File(lm_file).exists()) {
 +      throw new RuntimeException("Can't read lm_file '" + lm_file + "'");
 +    }
 +
 +    if (logRequests) {
 +      logger.addHandler(logHandler);
 +      logger.setLevel(Level.FINEST);
 +      logger.setUseParentHandlers(false);
 +    }
 +
 +    try { // try binary format (even gzipped)
 +      lm = (ArrayEncodedNgramLanguageModel<String>) LmReaders.<String>readLmBinary(lm_file);
 +      LOG.info("Loading Berkeley LM from binary {}", lm_file);
 +    } catch (RuntimeException e) {
 +      ConfigOptions opts = new ConfigOptions();
 +      LOG.info("Loading Berkeley LM from ARPA file {}", lm_file);
 +      final StringWordIndexer wordIndexer = new StringWordIndexer();
 +      ArrayEncodedNgramLanguageModel<String> berkeleyLm =
 +          LmReaders.readArrayEncodedLmFromArpa(lm_file, false, wordIndexer, opts, order);
 +
 +      lm = ArrayEncodedCachingLmWrapper.wrapWithCacheThreadSafe(berkeleyLm);
 +    }
 +    this.unkIndex = lm.getWordIndexer().getOrAddIndex(lm.getWordIndexer().getUnkSymbol());
 +  }
 +
 +  @Override
 +  public boolean registerWord(String token, int id) {
 +    int myid = lm.getWordIndexer().getIndexPossiblyUnk(token);
 +    if (myid < 0) return false;
 +    if (id >= vocabIdToMyIdMapping.length) {
 +      vocabIdToMyIdMapping =
 +          Arrays.copyOf(vocabIdToMyIdMapping, Math.max(id + 1, vocabIdToMyIdMapping.length * 2));
 +
 +    }
 +    mappingLength = Math.max(mappingLength, id + 1);
 +    vocabIdToMyIdMapping[id] = myid;
 +
 +    return false;
 +  }
 +  
 +  @Override
 +  public  boolean isOov(int id) {
 +    // for Berkeley, we unfortunately have to temporarily convert to String
 +    return lm.getWordIndexer().getIndexPossiblyUnk(Vocabulary.word(id)) <= 0;
-   };
++  }
 +
 +  @Override
 +  public float sentenceLogProbability(int[] sentence, int order, int startIndex) {
 +    if (sentence == null) return 0;
 +    int sentenceLength = sentence.length;
 +    if (sentenceLength <= 0) return 0;
 +
 +    float probability = 0;
 +    // partial ngrams at the begining
 +    for (int j = startIndex; j < order && j <= sentenceLength; j++) {
 +      // TODO: startIndex dependens on the order, e.g., this.ngramOrder-1 (in srilm, for 3-gram lm,
 +      // start_index=2. othercase, need to check)
 +      double logProb = ngramLogProbability_helper(sentence, 0, j, false);
 +      if (logger.isLoggable(Level.FINE)) {
 +        int[] ngram = Arrays.copyOfRange(sentence, 0, j);
 +        String words = Vocabulary.getWords(ngram);
 +        logger.fine("\tlogp ( " + words + " )  =  " + logProb);
 +      }
 +      probability += logProb;
 +    }
 +
 +    // regular-order ngrams
 +    for (int i = 0; i <= sentenceLength - order; i++) {
 +      double logProb =  ngramLogProbability_helper(sentence, i, order, false);
 +      if (logger.isLoggable(Level.FINE)) {
 +        int[] ngram = Arrays.copyOfRange(sentence, i, i + order);
 +        String words = Vocabulary.getWords(ngram);
 +        logger.fine("\tlogp ( " + words + " )  =  " + logProb);
 +      }
 +      probability += logProb;
 +    }
 +
 +    return probability;
 +  }
 +
 +  @Override
 +  public float ngramLogProbability_helper(int[] ngram, int order) {
 +    return ngramLogProbability_helper(ngram, false);
 +  }
 +
 +  protected float ngramLogProbability_helper(int[] ngram, boolean log) {
 +    return ngramLogProbability_helper(ngram, 0, ngram.length, log);
 +  }
 +
 +  protected float ngramLogProbability_helper(int sentence[], int ngramStartPos, int ngramLength, boolean log) {
 +    int[] mappedNgram = arrayScratch.get();
 +    if (mappedNgram.length < ngramLength) {
 +      mappedNgram = new int[mappedNgram.length * 2];
 +      arrayScratch.set(mappedNgram);
 +    }
 +    for (int i = 0; i < ngramLength; ++i) {
 +      mappedNgram[i] = vocabIdToMyIdMapping[sentence[ngramStartPos + i]];
 +    }
 +
 +    if (log && logRequests) {
 +      dumpBuffer(mappedNgram, ngramLength);
 +    }
 +
 +    return lm.getLogProb(mappedNgram, 0, ngramLength);
 +  }
 +
 +  public static void setLogRequests(Handler handler) {
 +    logRequests = true;
 +    logHandler = handler;
 +  }
 +
 +  @Override
 +  public float ngramLogProbability(int[] ngram) {
 +    return ngramLogProbability_helper(ngram,true);
 +  }
 +
 +  @Override
 +  public float ngramLogProbability(int[] ngram, int order) {
 +    return ngramLogProbability(ngram);
 +  }
 +
 +  private void dumpBuffer(int[] buffer, int len) {
 +    final int[] copyOf = Arrays.copyOf(buffer, len);
 +    for (int i = 0; i < copyOf.length; ++i) {
 +      if (copyOf[i] < 0) {
 +        copyOf[i] = unkIndex;
 +      }
 +    }
 +    logger.finest(StrUtils.join(WordIndexer.StaticMethods.toList(lm.getWordIndexer(), copyOf)));
 +  }
 +
 +  @VisibleForTesting
 +  ArrayEncodedNgramLanguageModel<String> getLM() {
 +    return lm;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilter.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilter.java
index a66fa44,0000000..06f30e7
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilter.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilter.java
@@@ -1,215 -1,0 +1,215 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.bloomfilter_lm;
 +
 +import java.io.Externalizable;
 +import java.io.IOException;
 +import java.io.ObjectInput;
 +import java.io.ObjectOutput;
 +import java.math.BigInteger;
 +import java.util.BitSet;
 +import java.util.Random;
 +
 +/**
 + * A Bloom filter: a lossy data structure for set representation. A Bloom filter consists of a bit
 + * set and a set of hash functions. A Bloom filter has two operations: add and query. We can add an
 + * object to a Bloom filter to indicate that it should be considered part of the set that the Bloom
 + * filter represents. We can query the Bloom filter to see if a given object is considered part of
 + * its set.
 + * <p>
 + * An object is added by sending it through a number of hash functions, each of which returns an
 + * index into the bit set. The bit at each of the indices is flipped on. We can query for an abject
 + * by sending it through the same hash functions. Then we look the bit at each index that was
 + * returned by a hash function. If any of the bits is unset, we know that the object is not in the
 + * Bloom filter (for otherwise all the bits should have already been set). If all the bits are set,
 + * we assume that the object is present in the Bloom filter.
 + * <p>
 + * We cannot know for sure that an object is in the bloom filter just because all its bits were set.
 + * There may be many collisions in the hash space, and all the bits for some object might be set by
 + * chance, rather than by adding that particular object.
 + * <p>
 + * The advantage of a Bloom filter is that its set representation can be stored in a significantly
 + * smaller space than information-theoretic lossless lower bounds. The price we pay for this is a
 + * certain amount of error in the query function. One nice feature of the Bloom filter is that its
 + * error is one-sided. This means that while the query function may return false positives (saying
 + * an object is present when it really isn't), it can never return false negatives (saying that an
 + * object is not present when it was already added.
 + */
 +public class BloomFilter implements Externalizable {
 +  /**
 +   * The main bit set of the Bloom filter.
 +   */
 +  private BitSet bitSet;
 +
 +  /**
 +   * The number of objects expected to be stored in the Bloom filter. The optimal number of hash
 +   * functions depends on this number.
 +   */
 +  int expectedNumberOfObjects;
 +
 +  /**
 +   * A prime number that should be bigger than the size of the bit set.
 +   */
 +  long bigPrime;
 +
 +  /**
 +   * The size of the bit set, in bits.
 +   */
 +  int filterSize;
 +
 +  /**
 +   * A random number generator for building hash functions.
 +   */
-   transient private Random RANDOM = new Random();
++  final transient private Random RANDOM = new Random();
 +
 +  /**
 +   * Builds an empty Bloom filter, ready to build hash functions and store objects.
 +   * 
 +   * @param filterSize the size of Bloom filter to make, in bits
 +   * @param expectedNumberOfObjects the number of objects expected to be stored in the Bloom filter
 +   */
 +  public BloomFilter(int filterSize, int expectedNumberOfObjects) {
 +    bitSet = new BitSet(filterSize);
 +    this.filterSize = filterSize;
 +    this.expectedNumberOfObjects = expectedNumberOfObjects;
 +    bigPrime = getPrimeLargerThan(filterSize);
 +  }
 +
 +  /**
 +   * Adds an item (represented by an integer) to the bloom filter.
 +   * 
 +   * @param objectToAdd the object to add
 +   * @param hashFunctions an array of pairs of long, representing the hash functions to be used on
 +   *        the object
 +   */
 +  public void add(int objectToAdd, long[][] hashFunctions) {
 +    for (long[] h : hashFunctions) {
 +      int i = hash(h, (long) objectToAdd);
 +      bitSet.set(i);
 +    }
 +  }
 +
 +  public void add(long objectToAdd, long[][] hashFunctions) {
 +    for (long[] h : hashFunctions) {
 +      int i = hash(h, objectToAdd);
 +      bitSet.set(i);
 +    }
 +  }
 +
 +  /**
 +   * Determines whether an item (represented by an integer) is present in the bloom filter.
 +   * 
 +   * @param objectToQuery the object we want to query for membership
 +   * @param hashFunctions an array of pairs of long, representing the hash functions to be used
 +   * 
 +   * @return true if the objects is assumed to be present in the Bloom filter, false if it is
 +   *         definitely not present
 +   */
 +  public boolean query(int objectToQuery, long[][] hashFunctions) {
 +    for (long[] h : hashFunctions) {
 +      int i = hash(h, (long) objectToQuery);
 +      if (!bitSet.get(i)) return false;
 +    }
 +    return true;
 +  }
 +
 +  public boolean query(long objectToQuery, long[][] hashFunctions) {
 +    for (long[] h : hashFunctions) {
 +      int i = hash(h, objectToQuery);
 +      if (!bitSet.get(i)) return false;
 +    }
 +    return true;
 +  }
 +
 +  /**
 +   * Builds an array of pairs of long that can be used as hash functions for this Bloom filter.
 +   * 
 +   * @return an array of pairs of long suitable for use as hash functions
 +   */
 +  public long[][] initializeHashFunctions() {
 +    int numberOfHashFunctions;
 +    int bigPrimeInt = (int) bigPrime;
 +    numberOfHashFunctions =
 +        (int) Math.floor(Math.log(2) * bitSet.length() / expectedNumberOfObjects);
 +    if (numberOfHashFunctions == 0) numberOfHashFunctions = 1;
 +    long[][] hashFunctions = new long[numberOfHashFunctions][2];
 +    for (long[] h : hashFunctions) {
 +      h[0] = (long) RANDOM.nextInt(bigPrimeInt) + 1;
 +      h[1] = (long) RANDOM.nextInt(bigPrimeInt) + 1;
 +    }
 +    return hashFunctions;
 +  }
 +
 +  /**
 +   * Determines which bit of the bit set should be either set, for add operations, or checked, for
 +   * query operations.
 +   * 
 +   * @param h a length-2 array of long used as a hash function
 +   * @param objectToHash the object of interest
 +   * 
 +   * @return an index into the bit set of the Bloom filter
 +   */
 +  private int hash(long[] h, long objectToHash) {
 +    long obj = (objectToHash < Integer.MAX_VALUE) ? objectToHash : objectToHash - bigPrime;
 +    long h0 = h[0];
 +    long h1 = (h[1] < (Long.MAX_VALUE / 2)) ? h[1] : h[1] - bigPrime;
 +    long ret = (obj * h0) % bigPrime;
 +    ret = (ret < (Long.MAX_VALUE / 2)) ? ret : ret - bigPrime;
 +    return (int) (((ret + h1) % bigPrime) % (long) filterSize);
 +  }
 +
 +  /**
 +   * Finds a prime number that is larger than the given number. This is used to find bigPrime, a
 +   * prime that has to be larger than the size of the Bloom filter.
 +   * 
 +   * @param n an integer
 +   * 
 +   * @return a prime number larger than n
 +   */
 +  private long getPrimeLargerThan(int n) {
 +    BigInteger ret;
 +    BigInteger maxLong = BigInteger.valueOf(Long.MAX_VALUE);
 +    int numBits = BigInteger.valueOf(n).bitLength() + 1;
 +    do {
 +      ret = BigInteger.probablePrime(numBits, RANDOM);
 +    } while (ret.compareTo(maxLong) > 1);
 +    return ret.longValue();
 +  }
 +
 +  /*
 +   * functions for interface externalizable
 +   */
 +
 +  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
 +    expectedNumberOfObjects = in.readInt();
 +    filterSize = in.readInt();
 +    bigPrime = in.readLong();
 +    bitSet = (BitSet) in.readObject();
 +  }
 +
 +  public void writeExternal(ObjectOutput out) throws IOException {
 +    out.writeInt(expectedNumberOfObjects);
 +    out.writeInt(filterSize);
 +    out.writeLong(bigPrime);
 +    out.writeObject(bitSet);
 +  }
 +
 +  // only used for reconstruction via Externalizable
 +  public BloomFilter() {}
 +}


[11/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into JOSHUA-284

Posted by mj...@apache.org.
Merge branch 'master' into JOSHUA-284


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/d28b4f39
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/d28b4f39
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/d28b4f39

Branch: refs/heads/7
Commit: d28b4f39c578197803beba2c376db5ed95774576
Parents: 25d28fe 2b570d2
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 12:36:37 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 12:36:37 2016 -0500

----------------------------------------------------------------------
 demo/README.md                                  |   2 +-
 demo/apache_joshua_logo.png                     | Bin 0 -> 306617 bytes
 demo/apache_joshua_logo_faded.png               | Bin 0 -> 309216 bytes
 demo/demo.config                                |   3 +
 demo/demo.js                                    |  19 +-
 demo/index.html                                 |  37 +-
 pom.xml                                         |  30 +-
 .../org/apache/joshua/adagrad/AdaGradCore.java  | 101 +++---
 .../org/apache/joshua/adagrad/Optimizer.java    | 348 +++++++++----------
 .../org/apache/joshua/corpus/BasicPhrase.java   |   2 +-
 .../apache/joshua/corpus/ContiguousPhrase.java  |   8 +-
 .../java/org/apache/joshua/corpus/Phrase.java   |   2 +-
 .../java/org/apache/joshua/corpus/Span.java     |   6 +-
 .../org/apache/joshua/corpus/SymbolTable.java   |   2 +-
 .../org/apache/joshua/corpus/Vocabulary.java    |  10 +-
 .../joshua/corpus/syntax/ArraySyntaxTree.java   |  51 +--
 .../apache/joshua/corpus/syntax/SyntaxTree.java |  10 +-
 .../org/apache/joshua/decoder/ArgsParser.java   |   8 +-
 .../java/org/apache/joshua/decoder/BLEU.java    |  72 ++--
 .../java/org/apache/joshua/decoder/Decoder.java |  26 +-
 .../apache/joshua/decoder/DecoderThread.java    |   2 +-
 .../joshua/decoder/JoshuaConfiguration.java     |  45 +--
 .../joshua/decoder/NbestMinRiskReranker.java    |  33 +-
 .../joshua/decoder/StructuredTranslation.java   |   9 +-
 .../decoder/StructuredTranslationFactory.java   |   5 +-
 .../org/apache/joshua/decoder/Translation.java  |   8 +-
 .../org/apache/joshua/decoder/Translations.java |   2 +-
 .../joshua/decoder/chart_parser/Cell.java       |  12 +-
 .../joshua/decoder/chart_parser/Chart.java      |  51 ++-
 .../decoder/chart_parser/ComputeNodeResult.java |   8 +-
 .../decoder/chart_parser/CubePruneState.java    |  20 +-
 .../joshua/decoder/chart_parser/DotChart.java   |  24 +-
 .../joshua/decoder/chart_parser/SourcePath.java |   4 +-
 .../decoder/chart_parser/StateConstraint.java   |   5 +-
 .../joshua/decoder/chart_parser/SuperNode.java  |   2 +-
 .../joshua/decoder/ff/FeatureFunction.java      |  24 +-
 .../apache/joshua/decoder/ff/FeatureVector.java |  21 +-
 .../joshua/decoder/ff/LabelCombinationFF.java   |   2 +-
 .../joshua/decoder/ff/LabelSubstitutionFF.java  |   8 +-
 .../joshua/decoder/ff/LexicalFeatures.java      |   2 +-
 .../apache/joshua/decoder/ff/OOVPenalty.java    |   7 +-
 .../apache/joshua/decoder/ff/PhraseModel.java   |   2 +-
 .../apache/joshua/decoder/ff/PhrasePenalty.java |   4 +-
 .../org/apache/joshua/decoder/ff/RuleFF.java    |   6 +-
 .../decoder/ff/RulePropertiesQuerying.java      |   6 +-
 .../org/apache/joshua/decoder/ff/RuleShape.java |   2 +-
 .../joshua/decoder/ff/SourceDependentFF.java    |   4 +-
 .../apache/joshua/decoder/ff/SourcePathFF.java  |   2 +-
 .../apache/joshua/decoder/ff/TargetBigram.java  |  13 +-
 .../ff/fragmentlm/ConcatenationIterator.java    |  10 +-
 .../decoder/ff/fragmentlm/FragmentLMFF.java     |  59 ++--
 .../ff/fragmentlm/PennTreebankReader.java       |  17 +-
 .../joshua/decoder/ff/fragmentlm/Tree.java      |  56 ++-
 .../joshua/decoder/ff/fragmentlm/Trees.java     |   8 +-
 .../org/apache/joshua/decoder/ff/lm/KenLM.java  |  26 +-
 .../joshua/decoder/ff/lm/LanguageModelFF.java   |  39 +--
 .../ff/lm/berkeley_lm/LMGrammarBerkeley.java    |   4 +-
 .../ff/lm/bloomfilter_lm/BloomFilter.java       |   2 +-
 .../BloomFilterLanguageModel.java               |  18 +-
 .../joshua/decoder/ff/lm/buildin_lm/TrieLM.java |  25 +-
 .../joshua/decoder/ff/phrase/Distortion.java    |   2 +-
 .../ff/similarity/EdgePhraseSimilarityFF.java   |  17 +-
 .../ff/state_maintenance/NgramDPState.java      |   6 +-
 .../joshua/decoder/ff/tm/AbstractGrammar.java   |  12 +-
 .../decoder/ff/tm/BasicRuleCollection.java      |   2 +-
 .../joshua/decoder/ff/tm/CreateGlueGrammar.java |   2 +-
 .../joshua/decoder/ff/tm/GrammarReader.java     |   2 +-
 .../apache/joshua/decoder/ff/tm/OwnerMap.java   |   2 +-
 .../org/apache/joshua/decoder/ff/tm/Rule.java   |  67 ++--
 .../decoder/ff/tm/SentenceFilteredGrammar.java  |  12 +-
 .../decoder/ff/tm/format/MosesFormatReader.java |   2 +-
 .../ff/tm/hash_based/ExtensionIterator.java     |   2 +-
 .../tm/hash_based/MemoryBasedBatchGrammar.java  |   8 +-
 .../decoder/ff/tm/packed/PackedGrammar.java     |  87 ++---
 .../ff/tm/packed/SliceAggregatingTrie.java      |   4 +-
 .../decoder/hypergraph/AlignedSourceTokens.java |   2 +-
 .../decoder/hypergraph/AllSpansWalker.java      |  19 +-
 .../hypergraph/DefaultInsideOutside.java        |  34 +-
 .../joshua/decoder/hypergraph/ForestWalker.java |  10 +-
 .../GrammarBuilderWalkerFunction.java           |  14 +-
 .../joshua/decoder/hypergraph/HGNode.java       |  54 ++-
 .../joshua/decoder/hypergraph/HyperEdge.java    |   6 +-
 .../joshua/decoder/hypergraph/HyperGraph.java   |  30 +-
 .../decoder/hypergraph/HyperGraphPruning.java   |   9 +-
 .../decoder/hypergraph/KBestExtractor.java      |  51 ++-
 .../hypergraph/OutputStringExtractor.java       |   8 +-
 .../hypergraph/StringToTreeConverter.java       |  16 +-
 .../decoder/hypergraph/ViterbiExtractor.java    |  10 +-
 .../hypergraph/WordAlignmentExtractor.java      |   2 +-
 .../decoder/hypergraph/WordAlignmentState.java  |   8 +-
 .../apache/joshua/decoder/io/JSONMessage.java   |  18 +-
 .../decoder/io/TranslationRequestStream.java    |   6 +-
 .../apache/joshua/decoder/phrase/Candidate.java |   4 +-
 .../apache/joshua/decoder/phrase/Coverage.java  |   2 +-
 .../apache/joshua/decoder/phrase/Future.java    |   4 +-
 .../apache/joshua/decoder/phrase/Header.java    |  87 +++++
 .../joshua/decoder/phrase/Hypothesis.java       |   5 +-
 .../joshua/decoder/phrase/PhraseChart.java      |  20 +-
 .../joshua/decoder/phrase/PhraseTable.java      |   4 +-
 .../org/apache/joshua/decoder/phrase/Stack.java |  12 +-
 .../apache/joshua/decoder/phrase/Stacks.java    |  23 +-
 .../decoder/segment_file/ConstraintRule.java    |   4 +-
 .../joshua/decoder/segment_file/Sentence.java   |  18 +-
 .../joshua/decoder/segment_file/Token.java      |   9 +-
 .../java/org/apache/joshua/pro/PROCore.java     |  22 +-
 .../org/apache/joshua/server/ServerThread.java  |   9 +-
 .../phrase/decode/PhraseDecodingTest.java       |  10 +
 .../apache/joshua/system/LmOovFeatureTest.java  |  11 +-
 108 files changed, 1072 insertions(+), 1030 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
index d92665d,280ea5a..ddbd222
--- a/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
+++ b/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
@@@ -46,16 -46,16 +46,16 @@@ public class ComputeNodeResult 
    private static final Logger LOG = LoggerFactory.getLogger(ComputeNodeResult.class);
  
    // The cost incurred by the rule itself (and all associated feature functions)
 -  private final float transitionCost;
 +  private float transitionCost;
  
    // transitionCost + the Viterbi costs of the tail nodes.
 -  private final float viterbiCost;
 -
 -  // viterbiCost + a future estimate (outside cost estimate).
 -  private final float pruningCostEstimate;
 +  private float viterbiCost;
  
 +  // The future or outside cost (estimated)
 +  private float futureCostEstimate;
 +  
    // The StateComputer objects themselves serve as keys.
-   private List<DPState> dpStates;
+   private final List<DPState> dpStates;
  
    /**
     * Computes the new state(s) that are produced when applying the given rule to the list of tail
@@@ -99,13 -99,13 +99,13 @@@
        }
      }
  
-     List<DPState> allDPStates = new ArrayList<DPState>();
+     List<DPState> allDPStates = new ArrayList<>();
  
      // The transition cost is the new cost incurred by applying this rule
 -    float transitionCost = 0.0f;
 +    this.transitionCost = 0.0f;
  
      // The future cost estimate is a heuristic estimate of the outside cost of this edge.
 -    float futureCostEstimate = 0.0f;
 +    this.futureCostEstimate = 0.0f;
  
      /*
       * We now iterate over all the feature functions, computing their cost and their expected future
@@@ -115,7 -115,7 +115,7 @@@
        FeatureFunction.ScoreAccumulator acc = feature.new ScoreAccumulator(); 
  
        DPState newState = feature.compute(rule, tailNodes, i, j, sourcePath, sentence, acc);
--      transitionCost += acc.getScore();
++      this.transitionCost += acc.getScore();
  
  
        if (LOG.isDebugEnabled()) {
@@@ -129,10 -129,13 +129,10 @@@
          allDPStates.add(((StatefulFF)feature).getStateIndex(), newState);
        }
      }
--    viterbiCost += transitionCost;
++    this.viterbiCost += transitionCost;
      if (LOG.isDebugEnabled())
        LOG.debug("-> COST = {}", transitionCost);
 -    // Set the final results.
 -    this.pruningCostEstimate = viterbiCost + futureCostEstimate;
 -    this.viterbiCost = viterbiCost;
 -    this.transitionCost = transitionCost;
 +
      this.dpStates = allDPStates;
    }
  

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/ff/tm/Rule.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/ff/tm/format/MosesFormatReader.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index a446eab,93e21cd..2a5dc03
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@@ -42,41 -33,26 +42,41 @@@ import org.apache.joshua.decoder.ff.Fea
  import org.apache.joshua.decoder.ff.state_maintenance.DPState;
  import org.apache.joshua.decoder.ff.tm.Rule;
  import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.decoder.segment_file.Sentence;
  
 -public class Candidate {
 -
 +public class Candidate implements Comparable<Candidate> {
 +  
 +  private List<FeatureFunction> featureFunctions;
 +  private Sentence sentence;
 +  
    // the set of hypotheses that can be paired with phrases from this span 
-   private List<Hypothesis> hypotheses;
+   private final List<Hypothesis> hypotheses;
  
    // the list of target phrases gathered from a span of the input
 -  private final TargetPhrases phrases;
 -
 -  // source span of new phrase
 -  public final Span span;
 +  private TargetPhrases phrases;
    
    // future cost of applying phrases to hypotheses
 -  final float future_delta;
 +  private float future_delta;
    
    // indices into the hypotheses and phrases arrays (used for cube pruning)
-   private int[] ranks;
+   private final int[] ranks;
    
 -  // scoring and state information 
 -  private ComputeNodeResult result;
 +  // the reordering rule used by an instantiated Candidate
 +  private Rule rule;
 +  
 +  /* 
 +   * Stores the inside cost of the current phrase, as well as the computed dynamic programming
 +   * state. Expensive to compute so there is an option of delaying it.
 +   */
 +  private ComputeNodeResult computedResult;
 +  
 +  /*
 +   * This is the HGNode built over the current target side phrase. It requires the computed results
 +   * as part of its constructor, so we delay computing it unless needed.
 +   */
 +  private HGNode phraseNode;
 +  private ComputeNodeResult phraseResult;
    
    /**
     * When candidate objects are extended, the new one is initialized with the same underlying

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/Future.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
index 8ef5597,af5069d..2710a48
--- a/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
@@@ -40,17 -39,14 +40,16 @@@ import org.apache.joshua.decoder.hyperg
  public class Hypothesis extends HGNode implements Comparable<Hypothesis> {
  
    // The hypothesis' coverage vector
-   private Coverage coverage;
+   private final Coverage coverage;
  
 -  public static final Rule BEGIN_RULE = new HieroFormatReader().parseLine("[X] ||| <s> ||| <s> |||   ||| 0-0");
 -  public static final Rule END_RULE = new HieroFormatReader().parseLine("[GOAL] ||| [X,1] </s> ||| [X,1] </s> |||   ||| 0-0 1-1");
 -
 +  public static Rule BEGIN_RULE = new HieroFormatReader().parseLine("[GOAL] ||| <s> ||| <s> |||   ||| 0-0");
 +  public static Rule END_RULE   = new HieroFormatReader().parseLine("[GOAL] ||| </s> ||| </s> |||   ||| 0-0");
 +  public static Rule MONO_RULE  = new HieroFormatReader().parseLine("[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] |||   ||| 0-0 1-1");
 +  public static Rule SWAP_RULE  = new HieroFormatReader().parseLine("[GOAL] ||| [X,1] [GOAL,2] ||| [GOAL,2] [X,1] |||   ||| 0-1 1-0");
 +  
    public String toString() {
      StringBuffer sb = new StringBuffer();
-     for (DPState state: getDPStates())
-       sb.append(state);
+     getDPStates().forEach(sb::append);
      String words = bestHyperedge.getRule().getEnglishWords();
  //  return String.format("HYP[%s] %.5f j=%d words=%s state=%s", coverage, score, j, words, sb);
      return String.format("HYP[%s] j=%d words=[%s] state=%s", coverage, j, words, sb);

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/joshua/decoder/phrase/Stack.java
index 67f62b6,6661dfb..47a3396
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
@@@ -40,19 -43,20 +40,19 @@@ public class Stack extends ArrayList<Hy
  
    private static final long serialVersionUID = 7885252799032416068L;
  
-   private HashMap<Coverage, ArrayList<Hypothesis>> coverages;
+   private final HashMap<Coverage, ArrayList<Hypothesis>> coverages;
    
 -  private final Sentence sentence;
 -  private final List<FeatureFunction> featureFunctions;
 -  private final JoshuaConfiguration config;
 +  private Sentence sentence;
 +  private JoshuaConfiguration config;
  
    /* The list of states we've already visited. */
-   private HashSet<Candidate> visitedStates;
+   private final HashSet<Candidate> visitedStates;
    
    /* A list of candidates sorted for consideration for entry to the chart (for cube pruning) */
-   private PriorityQueue<Candidate> candidates;
+   private final PriorityQueue<Candidate> candidates;
    
    /* Short-circuits adding a cube-prune state more than once */
-   private HashMap<Hypothesis, Hypothesis> deduper;
+   private final HashMap<Hypothesis, Hypothesis> deduper;
    
    /**
     * Create a new stack. Stacks are organized one for each number of source words that are covered.

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d28b4f39/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
----------------------------------------------------------------------
diff --cc src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
index d3db223,f2fc6a7..5e878cb
--- a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
+++ b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
@@@ -59,19 -60,12 +59,29 @@@ public class PhraseDecodingTest 
      decoder = null;
    }
  
 -  @Test(enabled = false)
 +  @Test(enabled = true)
    public void givenInput_whenPhraseDecoding_thenOutputIsAsExpected() throws IOException {
 -    final String translation = decode(INPUT).toString();
 -    final String gold = new String(readAllBytes(GOLD_PATH), UTF_8);
 -    assertEquals(gold, translation);
 +    final String translation = decode(INPUT).toString().trim();
 +    final String gold = OUTPUT;
 +    assertEquals(translation, gold);
 +  }
 +  
 +  @Test(enabled = false)
 +  public void givenInput_whenPhraseDecodingWithAlignments_thenOutputHasAlignments() throws IOException {
 +    final String translation = decode(INPUT).toString().trim();
 +    final String gold = OUTPUT_WITH_ALIGNMENTS;
 +    assertEquals(translation, gold);
 +  }
++  
++  @Test(enabled = true)
++  public void givenInput_whenPhraseDecoding_thenInputCanBeRetrieved() throws IOException {
++    String outputFormat = joshuaConfig.outputFormat;
++    joshuaConfig.outputFormat = "%e";
++    final String translation = decode(INPUT).toString().trim();
++    joshuaConfig.outputFormat = outputFormat;
++    final String gold = INPUT;
++    assertEquals(translation, gold);
+   }
  
    private Translation decode(String input) {
      final Sentence sentence = new Sentence(input, 0, joshuaConfig);


[43/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
Merge branch 'master' into 7


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/dc756709
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/dc756709
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/dc756709

Branch: refs/heads/7
Commit: dc756709b1c32176b55208345c196e18ee6ae24e
Parents: 82f9183 ff410c2
Author: Matt Post <po...@cs.jhu.edu>
Authored: Tue Aug 23 16:15:46 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Tue Aug 23 16:15:46 2016 -0500

----------------------------------------------------------------------
 .gitignore                                      |    3 +
 CHANGELOG                                       |    7 +
 bin/debug-joshua                                |   48 +
 bin/decoder                                     |    1 -
 demo/README.md                                  |    2 +-
 demo/apache_joshua_logo.png                     |  Bin 0 -> 306617 bytes
 demo/apache_joshua_logo_faded.png               |  Bin 0 -> 309216 bytes
 demo/demo.config                                |    3 +
 demo/demo.js                                    |   19 +-
 demo/index.html                                 |   37 +-
 .../org/apache/joshua/adagrad/AdaGradCore.java  |  101 +-
 .../org/apache/joshua/adagrad/Optimizer.java    |  348 +-
 .../org/apache/joshua/corpus/BasicPhrase.java   |    2 +-
 .../apache/joshua/corpus/ContiguousPhrase.java  |    8 +-
 .../java/org/apache/joshua/corpus/Phrase.java   |    2 +-
 .../java/org/apache/joshua/corpus/Span.java     |    6 +-
 .../org/apache/joshua/corpus/SymbolTable.java   |    2 +-
 .../org/apache/joshua/corpus/Vocabulary.java    |   10 +-
 .../joshua/corpus/syntax/ArraySyntaxTree.java   |   51 +-
 .../apache/joshua/corpus/syntax/SyntaxTree.java |   10 +-
 .../org/apache/joshua/decoder/ArgsParser.java   |    8 +-
 .../java/org/apache/joshua/decoder/BLEU.java    |   72 +-
 .../java/org/apache/joshua/decoder/Decoder.java |   20 +-
 .../apache/joshua/decoder/DecoderThread.java    |    2 +-
 .../joshua/decoder/JoshuaConfiguration.java     |   45 +-
 .../joshua/decoder/NbestMinRiskReranker.java    |   33 +-
 .../joshua/decoder/StructuredTranslation.java   |    8 +-
 .../decoder/StructuredTranslationFactory.java   |    4 +-
 .../org/apache/joshua/decoder/Translation.java  |    8 +-
 .../org/apache/joshua/decoder/Translations.java |    2 +-
 .../joshua/decoder/chart_parser/Cell.java       |   12 +-
 .../joshua/decoder/chart_parser/Chart.java      |   51 +-
 .../decoder/chart_parser/ComputeNodeResult.java |   39 +-
 .../decoder/chart_parser/CubePruneState.java    |   20 +-
 .../joshua/decoder/chart_parser/DotChart.java   |   24 +-
 .../joshua/decoder/chart_parser/SourcePath.java |    4 +-
 .../decoder/chart_parser/StateConstraint.java   |    5 +-
 .../joshua/decoder/chart_parser/SuperNode.java  |    2 +-
 .../joshua/decoder/ff/FeatureFunction.java      |   14 +-
 .../joshua/decoder/ff/LabelSubstitutionFF.java  |    8 +-
 .../joshua/decoder/ff/LexicalFeatures.java      |    2 +-
 .../apache/joshua/decoder/ff/OOVPenalty.java    |    7 +-
 .../apache/joshua/decoder/ff/PhrasePenalty.java |    2 +-
 .../org/apache/joshua/decoder/ff/RuleFF.java    |    6 +-
 .../decoder/ff/RulePropertiesQuerying.java      |    6 +-
 .../org/apache/joshua/decoder/ff/RuleShape.java |    2 +-
 .../joshua/decoder/ff/SourceDependentFF.java    |    4 +-
 .../apache/joshua/decoder/ff/SourcePathFF.java  |    2 +-
 .../apache/joshua/decoder/ff/TargetBigram.java  |   13 +-
 .../ff/fragmentlm/ConcatenationIterator.java    |   10 +-
 .../decoder/ff/fragmentlm/FragmentLMFF.java     |   21 +-
 .../ff/fragmentlm/PennTreebankReader.java       |   17 +-
 .../joshua/decoder/ff/fragmentlm/Tree.java      |   48 +-
 .../joshua/decoder/ff/fragmentlm/Trees.java     |    8 +-
 .../org/apache/joshua/decoder/ff/lm/KenLM.java  |   26 +-
 .../joshua/decoder/ff/lm/LanguageModelFF.java   |   33 +-
 .../ff/lm/berkeley_lm/LMGrammarBerkeley.java    |    4 +-
 .../ff/lm/bloomfilter_lm/BloomFilter.java       |    2 +-
 .../BloomFilterLanguageModel.java               |   18 +-
 .../joshua/decoder/ff/lm/buildin_lm/TrieLM.java |   25 +-
 .../joshua/decoder/ff/phrase/Distortion.java    |   28 +-
 .../ff/similarity/EdgePhraseSimilarityFF.java   |   17 +-
 .../ff/state_maintenance/NgramDPState.java      |    6 +-
 .../joshua/decoder/ff/tm/AbstractGrammar.java   |    2 +-
 .../decoder/ff/tm/BasicRuleCollection.java      |    2 +-
 .../joshua/decoder/ff/tm/CreateGlueGrammar.java |    2 +-
 .../apache/joshua/decoder/ff/tm/OwnerMap.java   |    2 +-
 .../decoder/ff/tm/SentenceFilteredGrammar.java  |   12 +-
 .../decoder/ff/tm/format/MosesFormatReader.java |   13 +-
 .../ff/tm/hash_based/ExtensionIterator.java     |    2 +-
 .../tm/hash_based/MemoryBasedBatchGrammar.java  |    8 +-
 .../decoder/ff/tm/packed/PackedGrammar.java     |   56 +-
 .../ff/tm/packed/SliceAggregatingTrie.java      |    4 +-
 .../decoder/hypergraph/AlignedSourceTokens.java |    2 +-
 .../decoder/hypergraph/AllSpansWalker.java      |   19 +-
 .../hypergraph/DefaultInsideOutside.java        |   34 +-
 .../joshua/decoder/hypergraph/ForestWalker.java |   10 +-
 .../GrammarBuilderWalkerFunction.java           |    2 +-
 .../joshua/decoder/hypergraph/HGNode.java       |   54 +-
 .../joshua/decoder/hypergraph/HyperEdge.java    |    6 +-
 .../joshua/decoder/hypergraph/HyperGraph.java   |   30 +-
 .../decoder/hypergraph/HyperGraphPruning.java   |    9 +-
 .../decoder/hypergraph/KBestExtractor.java      |   47 +-
 .../hypergraph/OutputStringExtractor.java       |    8 +-
 .../hypergraph/StringToTreeConverter.java       |   16 +-
 .../decoder/hypergraph/ViterbiExtractor.java    |   10 +-
 .../hypergraph/WordAlignmentExtractor.java      |    2 +-
 .../decoder/hypergraph/WordAlignmentState.java  |    6 +-
 .../apache/joshua/decoder/io/JSONMessage.java   |   18 +-
 .../decoder/io/TranslationRequestStream.java    |    6 +-
 .../apache/joshua/decoder/phrase/Candidate.java |  187 +-
 .../apache/joshua/decoder/phrase/Coverage.java  |    2 +-
 .../apache/joshua/decoder/phrase/Future.java    |   21 +-
 .../apache/joshua/decoder/phrase/Header.java    |    2 +-
 .../joshua/decoder/phrase/Hypothesis.java       |   47 +-
 .../joshua/decoder/phrase/PhraseChart.java      |   75 +-
 .../joshua/decoder/phrase/PhraseNodes.java      |   58 +
 .../joshua/decoder/phrase/PhraseTable.java      |   10 +-
 .../org/apache/joshua/decoder/phrase/Stack.java |   39 +-
 .../apache/joshua/decoder/phrase/Stacks.java    |   47 +-
 .../decoder/segment_file/ConstraintRule.java    |    4 +-
 .../joshua/decoder/segment_file/Sentence.java   |   18 +-
 .../joshua/decoder/segment_file/Token.java      |    9 +-
 .../java/org/apache/joshua/pro/PROCore.java     |   22 +-
 .../org/apache/joshua/server/ServerThread.java  |    9 +-
 .../org/apache/joshua/tools/GrammarPacker.java  |    8 +-
 .../LMBerkeleySentenceProbablityTest.java       |    4 +-
 .../lm/berkeley_lm/LMGrammarBerkeleyTest.java   |   10 +-
 .../class_lm/ClassBasedLanguageModelTest.java   |    4 +-
 .../kbest_extraction/KBestExtractionTest.java   |    4 +-
 .../phrase/decode/PhraseDecodingTest.java       |   37 +-
 .../org/apache/joshua/system/KenLmTest.java     |    2 +-
 .../apache/joshua/system/LmOovFeatureTest.java  |    2 +-
 .../system/MultithreadedTranslationTests.java   |    4 +-
 .../joshua/system/StructuredOutputTest.java     |    4 +-
 .../system/StructuredTranslationTest.java       |    4 +-
 .../decoder/phrase/decode/rules.packed/config   |    4 +-
 .../decode/rules.packed/slice_00000.features    |  Bin 4128858 -> 4128858 bytes
 .../decode/rules.packed/slice_00000.source      |  Bin 1982244 -> 1982228 bytes
 .../decode/rules.packed/slice_00000.target      |  Bin 2652936 -> 1463856 bytes
 .../rules.packed/slice_00000.target.lookup      |  Bin 32 -> 28 bytes
 .../phrase/decode/rules.packed/vocabulary       |  Bin 169236 -> 169225 bytes
 pom.xml                                         |    3 +-
 scripts/support/phrase2hiero.py                 |   22 +-
 scripts/training/pipeline.pl                    |    8 +-
 src/test/resources/berkeley_lm/lm               |   16 +
 src/test/resources/berkeley_lm/lm.berkeleylm    |  Bin 0 -> 4294 bytes
 src/test/resources/berkeley_lm/lm.berkeleylm.gz |  Bin 0 -> 1786 bytes
 src/test/resources/berkeley_lm/lm.gz            |  Bin 0 -> 162 bytes
 src/test/resources/grammar.glue                 |    4 +
 .../resources/kbest_extraction/glue-grammar     |    3 +
 src/test/resources/kbest_extraction/grammar     |   25 +
 .../resources/kbest_extraction/joshua.config    |   27 +
 src/test/resources/kbest_extraction/lm.gz       |  Bin 0 -> 2466496 bytes
 src/test/resources/kbest_extraction/output.gold | 3126 ++++++++++++++++++
 .../kbest_extraction/output.scores.gold         | 3126 ++++++++++++++++++
 src/test/resources/kenlm/oilers.kenlm           |  Bin 0 -> 49011 bytes
 src/test/resources/lm_oov/joshua.config         |   17 +
 src/test/resources/phrase_decoder/config        |   29 +
 .../resources/phrase_decoder/constrained.config |   28 +
 .../phrase_decoder/constrained.output.gold      |    5 +
 src/test/resources/phrase_decoder/lm.1.gz       |  Bin 0 -> 2235 bytes
 src/test/resources/phrase_decoder/output.gold   |    1 +
 src/test/resources/phrase_decoder/rules.1.gz    |  Bin 0 -> 2998042 bytes
 src/test/resources/wa_grammar                   |    3 +
 src/test/resources/wa_grammar.packed/config     |    2 +
 src/test/resources/wa_grammar.packed/encoding   |  Bin 0 -> 154 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 0 -> 45 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 0 -> 47 bytes
 .../wa_grammar.packed/slice_00000.source        |  Bin 0 -> 204 bytes
 .../wa_grammar.packed/slice_00000.target        |  Bin 0 -> 128 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 0 -> 32 bytes
 src/test/resources/wa_grammar.packed/vocabulary |  Bin 0 -> 238 bytes
 153 files changed, 7690 insertions(+), 1122 deletions(-)
----------------------------------------------------------------------



[35/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilterLanguageModel.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilterLanguageModel.java
index 4c56aac,0000000..7932364
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilterLanguageModel.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/bloomfilter_lm/BloomFilterLanguageModel.java
@@@ -1,567 -1,0 +1,565 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.bloomfilter_lm;
 +
 +import java.io.Externalizable;
 +import java.io.FileInputStream;
 +import java.io.FileOutputStream;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.ObjectInput;
 +import java.io.ObjectInputStream;
 +import java.io.ObjectOutput;
 +import java.io.ObjectOutputStream;
 +import java.util.HashMap;
 +import java.util.zip.GZIPInputStream;
 +import java.util.zip.GZIPOutputStream;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.lm.DefaultNGramLanguageModel;
 +import org.apache.joshua.util.Regex;
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * An n-gram language model with linearly-interpolated Witten-Bell smoothing, using a Bloom filter
 + * as its main data structure. A Bloom filter is a lossy data structure that can be used to test for
 + * set membership.
 + */
 +public class BloomFilterLanguageModel extends DefaultNGramLanguageModel implements Externalizable {
 +  /**
 +   * An initial value used for hashing n-grams so that they can be stored in a bloom filter.
 +   */
 +  public static final int HASH_SEED = 17;
 +
 +  /**
 +   * Another value used in the process of hashing n-grams.
 +   */
 +  public static final int HASH_OFFSET = 37;
 +
 +  /**
 +   * The maximum score that a language model feature function can return to the Joshua decoder.
 +   */
 +  public static final double MAX_SCORE = 100.0;
 +
 +  /**
 +   * The logger for this class.
 +   */
 +  private static final Logger LOG = LoggerFactory.getLogger(BloomFilterLanguageModel.class);
 +
 +  /**
 +   * The Bloom filter data structure itself.
 +   */
 +  private BloomFilter bf;
 +
 +  /**
 +   * The base of the logarithm used to quantize n-gram counts. N-gram counts are quantized
 +   * logarithmically to reduce the number of times we need to query the Bloom filter.
 +   */
 +  private double quantizationBase;
 +
 +  /**
 +   * Natural log of the number of tokens seen in the training corpus.
 +   */
 +  private double numTokens;
 +
 +  /**
 +   * An array of pairs of long, used as hash functions for storing or retreiving the count of an
 +   * n-gram in the Bloom filter.
 +   */
 +  private long[][] countFuncs;
 +  /**
 +   * An array of pairs of long, used as hash functions for storing or retreiving the number of
 +   * distinct types observed after an n-gram.
 +   */
 +  private long[][] typesFuncs;
 +
 +  /**
 +   * The smoothed probability of an unseen n-gram. This is also the probability of any n-gram under
 +   * the zeroth-order model.
 +   */
 +  transient private double p0;
 +
 +  /**
 +   * The interpolation constant between Witten-Bell models of order zero and one. Stored in a field
 +   * because it can be calculated ahead of time; it doesn't depend on the particular n-gram.
 +   */
 +  transient private double lambda0;
 +
 +  /**
 +   * The maximum possible quantized count of any n-gram stored in the Bloom filter. Used as an upper
 +   * bound on the count that could be returned when querying the Bloom filter.
 +   */
 +  transient private int maxQ; // max quantized count
 +
 +  /**
 +   * Constructor called from the Joshua decoder. This constructor assumes that the LM has already
 +   * been built, and takes the name of the file where the LM is stored.
 +   * 
 +   * @param order the order of the language model
 +   * @param filename path to the file where the language model is stored
 +   * @throws IOException if the bloom filter language model cannot be rebuilt from the input file
 +   */
 +  public BloomFilterLanguageModel(int order, String filename) throws IOException {
 +    super(order);
 +    try {
 +      readExternal(new ObjectInputStream(new GZIPInputStream(new FileInputStream(filename))));
 +    } catch (ClassNotFoundException e) {
 +      IOException ioe = new IOException("Could not rebuild bloom filter LM from file " + filename);
 +      ioe.initCause(e);
 +      throw ioe;
 +    }
 +
 +    int vocabSize = Vocabulary.size();
 +    p0 = -Math.log(vocabSize + 1);
 +    double oneMinusLambda0 = numTokens - logAdd(Math.log(vocabSize), numTokens);
 +    p0 += oneMinusLambda0;
 +    lambda0 = Math.log(vocabSize) - logAdd(Math.log(vocabSize), numTokens);
 +    maxQ = quantize((long) Math.exp(numTokens));
 +  }
 +
 +  /**
 +   * Constructor to be used by the main function. This constructor is used to build a new language
 +   * model from scratch. An LM should be built with the main function before using it in the Joshua
 +   * decoder.
 +   * 
 +   * @param filename path to the file of training corpus statistics
 +   * @param order the order of the language model
 +   * @param size the size of the Bloom filter, in bits
 +   * @param base a double. The base of the logarithm for quantization.
 +   */
 +  private BloomFilterLanguageModel(String filename, int order, int size, double base) {
 +    super(order);
 +    quantizationBase = base;
 +    populateBloomFilter(size, filename);
 +  }
 +
 +  /**
 +   * calculates the linearly-interpolated Witten-Bell probability for a given ngram. this is
 +   * calculated as: p(w|h) = pML(w|h)L(h) - (1 - L(h))p(w|h') where: w is a word and h is a history
 +   * h' is the history h with the first word removed pML is the maximum-likelihood estimate of the
 +   * probability L(.) is lambda, the interpolation factor, which depends only on the history h: L(h)
 +   * = s(h) / s(h) + c(h) where s(.) is the observed number of distinct types after h, and c is the
 +   * observed number of counts of h in the training corpus.
 +   * <p>
 +   * in fact this model calculates the probability starting from the lowest order and working its
 +   * way up, to take advantage of the one- sided error rate inherent in using a bloom filter data
 +   * structure.
 +   * 
 +   * @param ngram the ngram whose probability is to be calculated
 +   * @param ngramOrder the order of the ngram.
 +   * 
 +   * @return the linearly-interpolated Witten-Bell smoothed probability of an ngram
 +   */
 +  private float wittenBell(int[] ngram, int ngramOrder) {
 +    int end = ngram.length;
 +    double p = p0; // current calculated probability
 +    // note that p0 and lambda0 are independent of the given
 +    // ngram so they are calculated ahead of time.
 +    int MAX_QCOUNT = getCount(ngram, ngram.length - 1, ngram.length, maxQ);
 +    if (MAX_QCOUNT == 0) // OOV!
 +      return (float) p;
 +    double pML = Math.log(unQuantize(MAX_QCOUNT)) - numTokens;
 +
 +    // p += lambda0 * pML;
 +    p = logAdd(p, (lambda0 + pML));
 +    if (ngram.length == 1) { // if it's a unigram, we're done
 +      return (float) p;
 +    }
 +    // otherwise we calculate the linear interpolation
 +    // with higher order models.
 +    for (int i = end - 2; i >= end - ngramOrder && i >= 0; i--) {
 +      int historyCnt = getCount(ngram, i, end, MAX_QCOUNT);
 +      // if the count for the history is zero, all higher
 +      // terms in the interpolation must be zero, so we
 +      // are done here.
 +      if (historyCnt == 0) {
 +        return (float) p;
 +      }
 +      int historyTypesAfter = getTypesAfter(ngram, i, end, historyCnt);
 +      // unQuantize the counts we got from the BF
 +      double HC = unQuantize(historyCnt);
 +      double HTA = 1 + unQuantize(historyTypesAfter);
 +      // interpolation constant
 +      double lambda = Math.log(HTA) - Math.log(HTA + HC);
 +      double oneMinusLambda = Math.log(HC) - Math.log(HTA + HC);
 +      // p *= 1 - lambda
 +      p += oneMinusLambda;
 +      int wordCount = getCount(ngram, i + 1, end, historyTypesAfter);
 +      double WC = unQuantize(wordCount);
 +      // p += lambda * p_ML(w|h)
 +      if (WC == 0) return (float) p;
 +      p = logAdd(p, lambda + Math.log(WC) - Math.log(HC));
 +      MAX_QCOUNT = wordCount;
 +    }
 +    return (float) p;
 +  }
 +
 +  /**
 +   * Retrieve the count of a ngram from the Bloom filter. That is, how many times did we see this
 +   * ngram in the training corpus? This corresponds roughly to algorithm 2 in Talbot and Osborne's
 +   * "Tera-Scale LMs on the Cheap."
 +   * 
 +   * @param ngram array containing the ngram as a sub-array
 +   * @param start the index of the first word of the ngram
 +   * @param end the index after the last word of the ngram
 +   * @param qcount the maximum possible count to be returned
 +   * 
 +   * @return the number of times the ngram was seen in the training corpus, quantized
 +   */
 +  private int getCount(int[] ngram, int start, int end, int qcount) {
 +    for (int i = 1; i <= qcount; i++) {
 +      int hash = hashNgram(ngram, start, end, i);
 +      if (!bf.query(hash, countFuncs)) {
 +        return i - 1;
 +      }
 +    }
 +    return qcount;
 +  }
 +
 +  /**
 +   * Retrieve the number of distinct types that follow an ngram in the training corpus.
 +   * 
 +   * This is another version of algorithm 2. As noted in the paper, we have different algorithms for
 +   * getting ngram counts versus suffix counts because c(x) = 1 is a proxy item for s(x) = 1
 +   * 
 +   * @param ngram an array the contains the ngram as a sub-array
 +   * @param start the index of the first word of the ngram
 +   * @param end the index after the last word of the ngram
 +   * @param qcount the maximum possible return value
 +   * 
 +   * @return the number of distinct types observed to follow an ngram in the training corpus,
 +   *         quantized
 +   */
 +  private int getTypesAfter(int[] ngram, int start, int end, int qcount) {
 +    // first we check c(x) >= 1
 +    int hash = hashNgram(ngram, start, end, 1);
 +    if (!bf.query(hash, countFuncs)) {
 +      return 0;
 +    }
 +    // if c(x) >= 1, we check for the stored suffix count
 +    for (int i = 1; i < qcount; i++) {
 +      hash = hashNgram(ngram, start, end, i);
 +      if (!bf.query(hash, typesFuncs)) {
 +        return i - 1;
 +      }
 +    }
 +    return qcount;
 +  }
 +
 +  /**
 +   * Logarithmically quantizes raw counts. The quantization scheme is described in Talbot and
 +   * Osborne's paper "Tera-Scale LMs on the Cheap."
 +   * 
 +   * @param x long giving the raw count to be quantized
 +   * 
 +   * @return the quantized count
 +   */
 +  private int quantize(long x) {
 +    return 1 + (int) Math.floor(Math.log(x) / Math.log(quantizationBase));
 +  }
 +
 +  /**
 +   * Unquantizes a quantized count.
 +   * 
 +   * @param x the quantized count
 +   * 
 +   * @return the expected raw value of the quantized count
 +   */
 +  private double unQuantize(int x) {
 +    if (x == 0) {
 +      return 0;
 +    } else {
 +      return ((quantizationBase + 1) * Math.pow(quantizationBase, x - 1) - 1) / 2;
 +    }
 +  }
 +
 +  /**
 +   * Converts an n-gram and a count into a value that can be stored into a Bloom filter. This is
 +   * adapted directly from <code>AbstractPhrase.hashCode()</code> elsewhere in the Joshua code base.
 +   * 
 +   * @param ngram an array containing the ngram as a sub-array
 +   * @param start the index of the first word of the ngram
 +   * @param end the index after the last word of the ngram
 +   * @param val the count of the ngram
 +   * 
 +   * @return a value suitable to be stored in a Bloom filter
 +   */
 +  private int hashNgram(int[] ngram, int start, int end, int val) {
 +    int result = HASH_OFFSET * HASH_SEED + val;
 +    for (int i = start; i < end; i++)
 +      result = HASH_OFFSET * result + ngram[i];
 +    return result;
 +  }
 +
 +  /**
 +   * Adds two numbers that are in the log domain, avoiding underflow.
 +   * 
 +   * @param x one summand
 +   * @param y the other summand
 +   * 
 +   * @return the log of the sum of the exponent of the two numbers.
 +   */
 +  private static double logAdd(double x, double y) {
 +    if (y <= x) {
 +      return x + Math.log1p(Math.exp(y - x));
 +    } else {
 +      return y + Math.log1p(Math.exp(x - y));
 +    }
 +  }
 +
 +  /**
 +   * Builds a language model and stores it in a file.
 +   * 
 +   * @param argv command-line arguments
 +   */
 +  public static void main(String[] argv) {
 +    if (argv.length < 5) {
 +      String msg = "usage: BloomFilterLanguageModel <statistics file> <order> <size>"
 +          + " <quantization base> <output file>";
 +      System.err.println(msg);
 +      LOG.error(msg);
 +      return;
 +    }
 +    int order = Integer.parseInt(argv[1]);
 +    int size = (int) (Integer.parseInt(argv[2]) * Math.pow(2, 23));
 +    double base = Double.parseDouble(argv[3]);
 +
 +    try {
 +      BloomFilterLanguageModel lm = new BloomFilterLanguageModel(argv[0], order, size, base);
 +
 +      ObjectOutputStream out =
 +          new ObjectOutputStream(new GZIPOutputStream(new FileOutputStream(argv[4])));
 +
 +      lm.writeExternal(out);
 +      out.close(); //TODO: try-with-resources
 +    } catch (IOException e) {
 +      LOG.error(e.getMessage(), e);
 +    }
 +  }
 +  
 +  /**
 +   * Adds ngram counts and counts of distinct types after ngrams, read from a file, to the Bloom
 +   * filter.
 +   * <p>
 +   * The file format should look like this: ngram1 count types-after ngram2 count types-after ...
 +   * 
 +   * @param bloomFilterSize the size of the Bloom filter, in bits
 +   * @param filename path to the statistics file
 +   */
 +  private void populateBloomFilter(int bloomFilterSize, String filename) {
-     HashMap<String, Long> typesAfter = new HashMap<String, Long>();
++    HashMap<String, Long> typesAfter = new HashMap<>();
 +    try {
 +      FileInputStream file_in = new FileInputStream(filename);
 +      FileInputStream file_in_copy = new FileInputStream(filename);
 +      InputStream in;
 +      InputStream estimateStream;
 +      if (filename.endsWith(".gz")) {
 +        in = new GZIPInputStream(file_in);
 +        estimateStream = new GZIPInputStream(file_in_copy);
 +      } else {
 +        in = file_in;
 +        estimateStream = file_in_copy;
 +      }
 +      int numObjects = estimateNumberOfObjects(estimateStream);
 +      LOG.debug("Estimated number of objects: {}", numObjects);
 +      bf = new BloomFilter(bloomFilterSize, numObjects);
 +      countFuncs = bf.initializeHashFunctions();
 +      populateFromInputStream(in, typesAfter);
 +      in.close();
 +    } catch (IOException e) {
 +      LOG.error(e.getMessage(), e);
 +      return;
 +    }
 +    typesFuncs = bf.initializeHashFunctions();
 +    for (String history : typesAfter.keySet()) {
 +      String[] toks = Regex.spaces.split(history);
 +      int[] hist = new int[toks.length];
 +      for (int i = 0; i < toks.length; i++)
 +        hist[i] = Vocabulary.id(toks[i]);
 +      add(hist, typesAfter.get(history), typesFuncs);
 +    }
-     return;
 +  }
 +
 +  /**
 +   * Estimate the number of objects that will be stored in the Bloom filter. The optimum number of
 +   * hash functions depends on the number of items that will be stored, so we want a guess before we
 +   * begin to read the statistics file and store it.
 +   * 
 +   * @param source an InputStream pointing to the training corpus stats
 +   * 
 +   * @return an estimate of the number of objects to be stored in the Bloom filter
 +   */
 +  private int estimateNumberOfObjects(InputStream source) {
 +    int numLines = 0;
 +    long maxCount = 0;
 +    for (String line: new LineReader(source)) {
 +      if (line.trim().equals("")) continue;
 +      String[] toks = Regex.spaces.split(line);
 +      if (toks.length > ngramOrder + 1) continue;
 +      try {
 +        long cnt = Long.parseLong(toks[toks.length - 1]);
 +        if (cnt > maxCount) maxCount = cnt;
 +      } catch (NumberFormatException e) {
 +        LOG.error(e.getMessage(), e);
 +        break;
 +      }
 +      numLines++;
 +    }
 +    double estimate = Math.log(maxCount) / Math.log(quantizationBase);
 +    return (int) Math.round(numLines * estimate);
 +  }
 +
 +  /**
 +   * Reads the statistics from a source and stores them in the Bloom filter. The ngram counts are
 +   * stored immediately in the Bloom filter, but the counts of distinct types following each ngram
 +   * are accumulated from the file as we go.
 +   * 
 +   * @param source an InputStream pointing to the statistics
 +   * @param types a HashMap that will stores the accumulated counts of distinct types observed to
 +   *        follow each ngram
 +   */
 +  private void populateFromInputStream(InputStream source, HashMap<String, Long> types) {
 +    numTokens = Double.NEGATIVE_INFINITY; // = log(0)
 +    for (String line: new LineReader(source)) {
 +      String[] toks = Regex.spaces.split(line);
 +      if ((toks.length < 2) || (toks.length > ngramOrder + 1)) continue;
 +      int[] ngram = new int[toks.length - 1];
 +      StringBuilder history = new StringBuilder();
 +      for (int i = 0; i < toks.length - 1; i++) {
 +        ngram[i] = Vocabulary.id(toks[i]);
 +        if (i < toks.length - 2) history.append(toks[i]).append(" ");
 +      }
 +
 +      long cnt = Long.parseLong(toks[toks.length - 1]);
 +      add(ngram, cnt, countFuncs);
 +      if (toks.length == 2) { // unigram
 +        numTokens = logAdd(numTokens, Math.log(cnt));
 +        // no need to count types after ""
 +        // that's what vocabulary.size() is for.
 +        continue;
 +      }
 +      if (types.get(history) == null)
 +        types.put(history.toString(), 1L);
 +      else {
-         long x = (Long) types.get(history);
++        long x = types.get(history);
 +        types.put(history.toString(), x + 1);
 +      }
 +    }
-     return;
 +  }
 +
 +  /**
 +   * Adds an ngram, along with an associated value, to the Bloom filter. This corresponds to Talbot
 +   * and Osborne's "Tera-scale LMs on the cheap", algorithm 1.
 +   * 
 +   * @param ngram an array representing the ngram
 +   * @param value the value to be associated with the ngram
 +   * @param funcs an array of long to be used as hash functions
 +   */
 +  private void add(int[] ngram, long value, long[][] funcs) {
 +    if (ngram == null) return;
 +    int qValue = quantize(value);
 +    for (int i = 1; i <= qValue; i++) {
 +      int hash = hashNgram(ngram, 0, ngram.length, i);
 +      bf.add(hash, funcs);
 +    }
 +  }
 +
 +  /**
 +   * Read a Bloom filter LM from an external file.
 +   * 
 +   * @param in an ObjectInput stream to read from
 +   */
 +  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
 +    int vocabSize = in.readInt();
 +    for (int i = 0; i < vocabSize; i++) {
 +      String line = in.readUTF();
 +      Vocabulary.id(line);
 +    }
 +    numTokens = in.readDouble();
 +    countFuncs = new long[in.readInt()][2];
 +    for (int i = 0; i < countFuncs.length; i++) {
 +      countFuncs[i][0] = in.readLong();
 +      countFuncs[i][1] = in.readLong();
 +    }
 +    typesFuncs = new long[in.readInt()][2];
 +    for (int i = 0; i < typesFuncs.length; i++) {
 +      typesFuncs[i][0] = in.readLong();
 +      typesFuncs[i][1] = in.readLong();
 +    }
 +    quantizationBase = in.readDouble();
 +    bf = new BloomFilter();
 +    bf.readExternal(in);
 +  }
 +
 +  /**
 +   * Write a Bloom filter LM to some external location.
 +   * 
 +   * @param out an ObjectOutput stream to write to
 +   * 
 +   * @throws IOException if an input or output exception occurred
 +   */
 +  public void writeExternal(ObjectOutput out) throws IOException {
 +    out.writeInt(Vocabulary.size());
 +    for (int i = 0; i < Vocabulary.size(); i++) {
 +      // out.writeBytes(vocabulary.getWord(i));
 +      // out.writeChar('\n'); // newline
 +      out.writeUTF(Vocabulary.word(i));
 +    }
 +    out.writeDouble(numTokens);
 +    out.writeInt(countFuncs.length);
-     for (int i = 0; i < countFuncs.length; i++) {
-       out.writeLong(countFuncs[i][0]);
-       out.writeLong(countFuncs[i][1]);
++    for (long[] countFunc : countFuncs) {
++      out.writeLong(countFunc[0]);
++      out.writeLong(countFunc[1]);
 +    }
 +    out.writeInt(typesFuncs.length);
-     for (int i = 0; i < typesFuncs.length; i++) {
-       out.writeLong(typesFuncs[i][0]);
-       out.writeLong(typesFuncs[i][1]);
++    for (long[] typesFunc : typesFuncs) {
++      out.writeLong(typesFunc[0]);
++      out.writeLong(typesFunc[1]);
 +    }
 +    out.writeDouble(quantizationBase);
 +    bf.writeExternal(out);
 +  }
 +
 +  /**
 +   * Returns the language model score for an n-gram. This is called from the rest of the Joshua
 +   * decoder.
 +   * 
 +   * @param ngram the ngram to score
 +   * @param order the order of the model
 +   * 
 +   * @return the language model score of the ngram
 +   */
 +  @Override
 +  protected float ngramLogProbability_helper(int[] ngram, int order) {
 +    int[] lm_ngram = new int[ngram.length];
 +    for (int i = 0; i < ngram.length; i++) {
 +      lm_ngram[i] = Vocabulary.id(Vocabulary.word(ngram[i]));
 +    }
 +    return wittenBell(lm_ngram, order);
 +  }
 +
 +  @Override
 +  public boolean isOov(int id) {
 +    int[] ngram = new int[] {id};
 +    int MAX_QCOUNT = getCount(ngram, ngram.length - 1, ngram.length, maxQ);
 +    return (MAX_QCOUNT == 0);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/buildin_lm/TrieLM.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/buildin_lm/TrieLM.java
index bb4732f,0000000..9bfccb0
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/buildin_lm/TrieLM.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/buildin_lm/TrieLM.java
@@@ -1,335 -1,0 +1,334 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.buildin_lm;
 +
 +import java.io.File;
 +import java.io.FileNotFoundException;
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.Arrays;
++import java.util.Collections;
 +import java.util.HashMap;
 +import java.util.LinkedList;
 +import java.util.Map;
 +import java.util.Scanner;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.lm.AbstractLM;
 +import org.apache.joshua.decoder.ff.lm.ArpaFile;
 +import org.apache.joshua.decoder.ff.lm.ArpaNgram;
 +import org.apache.joshua.util.Bits;
 +import org.apache.joshua.util.Regex;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Relatively memory-compact language model
 + * stored as a reversed-word-order trie.
 + * <p>
 + * The trie itself represents language model context.
 + * <p>
 + * Conceptually, each node in the trie stores a map 
 + * from conditioning word to log probability.
 + * <p>
 + * Additionally, each node in the trie stores 
 + * the backoff weight for that context.
 + * 
 + * @author Lane Schwartz
 + * @see <a href="http://www.speech.sri.com/projects/srilm/manpages/ngram-discount.7.html">SRILM ngram-discount documentation</a>
 + */
 +public class TrieLM extends AbstractLM { //DefaultNGramLanguageModel {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(TrieLM.class);
 +
 +  /**
 +   * Node ID for the root node.
 +   */
 +  private static final int ROOT_NODE_ID = 0;
 +
 +
 +  /** 
 +   * Maps from (node id, word id for child) --> node id of child. 
 +   */
 +  private final Map<Long,Integer> children;
 +
 +  /**
 +   * Maps from (node id, word id for lookup word) --> 
 +   * log prob of lookup word given context 
 +   * 
 +   * (the context is defined by where you are in the tree).
 +   */
 +  private final Map<Long,Float> logProbs;
 +
 +  /**
 +   * Maps from (node id) --> 
 +   * backoff weight for that context 
 +   * 
 +   * (the context is defined by where you are in the tree).
 +   */
 +  private final Map<Integer,Float> backoffs;
 +
 +  public TrieLM(Vocabulary vocab, String file) throws FileNotFoundException {
 +    this(new ArpaFile(file,vocab));
 +  }
 +
 +  /**
 +   * Constructs a language model object from the specified ARPA file.
 +   * 
 +   * @param arpaFile input ARPA file
 +   * @throws FileNotFoundException if the input file cannot be located
 +   */
 +  public TrieLM(ArpaFile arpaFile) throws FileNotFoundException {
-     super(arpaFile.getVocab().size(), arpaFile.getOrder());
++    super(Vocabulary.size(), arpaFile.getOrder());
 +
 +    int ngramCounts = arpaFile.size();
 +    LOG.debug("ARPA file contains {} n-grams", ngramCounts);
 +
-     this.children = new HashMap<Long,Integer>(ngramCounts);
-     this.logProbs = new HashMap<Long,Float>(ngramCounts);
-     this.backoffs = new HashMap<Integer,Float>(ngramCounts);
++    this.children = new HashMap<>(ngramCounts);
++    this.logProbs = new HashMap<>(ngramCounts);
++    this.backoffs = new HashMap<>(ngramCounts);
 +
 +    int nodeCounter = 0;
 +
 +    int lineNumber = 0;
 +    for (ArpaNgram ngram : arpaFile) {
 +      lineNumber += 1;
 +      if (lineNumber % 100000 == 0){
 +        LOG.info("Line: {}", lineNumber);
 +      }
 +
 +      LOG.debug("{}-gram: ({} | {})", ngram.order(), ngram.getWord(),
 +          Arrays.toString(ngram.getContext()));
 +      int word = ngram.getWord();
 +
 +      int[] context = ngram.getContext();
 +
 +      {
 +        // Find where the log prob should be stored
 +        int contextNodeID = ROOT_NODE_ID;
 +        {
 +          for (int i=context.length-1; i>=0; i--) {
 +            long key = Bits.encodeAsLong(contextNodeID, context[i]);
 +            int childID;
 +            if (children.containsKey(key)) {
 +              childID = children.get(key);
 +            } else {
 +              childID = ++nodeCounter;
 +              LOG.debug("children.put({}:{}, {})", contextNodeID, context[i], childID);
 +              children.put(key, childID);
 +            }
 +            contextNodeID = childID;
 +          }
 +        }
 +
 +        // Store the log prob for this n-gram at this node in the trie
 +        {
 +          long key = Bits.encodeAsLong(contextNodeID, word);
 +          float logProb = ngram.getValue();
 +          LOG.debug("logProbs.put({}:{}, {}", contextNodeID, word, logProb);
 +          this.logProbs.put(key, logProb);
 +        }
 +      }
 +
 +      {
 +        // Find where the backoff should be stored
 +        int backoffNodeID = ROOT_NODE_ID;
 +        { 
 +          long backoffNodeKey = Bits.encodeAsLong(backoffNodeID, word);
 +          int wordChildID;
 +          if (children.containsKey(backoffNodeKey)) {
 +            wordChildID = children.get(backoffNodeKey);
 +          } else {
 +            wordChildID = ++nodeCounter;
 +            LOG.debug("children.put({}: {}, {})", backoffNodeID, word, wordChildID);
 +            children.put(backoffNodeKey, wordChildID);
 +          }
 +          backoffNodeID = wordChildID;
 +
 +          for (int i=context.length-1; i>=0; i--) {
 +            long key = Bits.encodeAsLong(backoffNodeID, context[i]);
 +            int childID;
 +            if (children.containsKey(key)) {
 +              childID = children.get(key);
 +            } else {
 +              childID = ++nodeCounter;
 +              LOG.debug("children.put({}:{}, {})", backoffNodeID, context[i], childID);
 +              children.put(key, childID);
 +            }
 +            backoffNodeID = childID;
 +          }
 +        }
 +
 +        // Store the backoff for this n-gram at this node in the trie
 +        {
 +          float backoff = ngram.getBackoff();
 +          LOG.debug("backoffs.put({}:{}, {})", backoffNodeID, word, backoff);
 +          this.backoffs.put(backoffNodeID, backoff);
 +        }
 +      }
 +
 +    }
 +  }
 +
 +
 +  @Override
 +  protected double logProbabilityOfBackoffState_helper(
 +      int[] ngram, int order, int qtyAdditionalBackoffWeight
 +      ) {
 +    throw new UnsupportedOperationException("probabilityOfBackoffState_helper undefined for TrieLM");
 +  }
 +
 +  @Override
 +  protected float ngramLogProbability_helper(int[] ngram, int order) {
 +
 +//    float logProb = (float) -JoshuaConfiguration.lm_ceiling_cost;//Float.NEGATIVE_INFINITY; // log(0.0f)
 +    float backoff = 0.0f; // log(1.0f)
 +
 +    int i = ngram.length - 1;
 +    int word = ngram[i];
 +    i -= 1;
 +
 +    int nodeID = ROOT_NODE_ID;
 +
 +    while (true) {
 +
 +      {
 +        long key = Bits.encodeAsLong(nodeID, word);
 +        if (logProbs.containsKey(key)) {
 +//          logProb = logProbs.get(key);
 +          backoff = 0.0f; // log(0.0f)
 +        }
 +      }
 +
 +      if (i < 0) {
 +        break;
 +      }
 +
 +      {
 +        long key = Bits.encodeAsLong(nodeID, ngram[i]);
 +
 +        if (children.containsKey(key)) {
 +          nodeID = children.get(key);
 +
 +          backoff += backoffs.get(nodeID);
 +
 +          i -= 1;
 +
 +        } else {
 +          break;
 +        }
 +      }
 +
 +    }
 +
 +//    double result = logProb + backoff;
 +//    if (result < -JoshuaConfiguration.lm_ceiling_cost) {
 +//      result = -JoshuaConfiguration.lm_ceiling_cost;
 +//    }
 +//
 +//    return result;
 +    return (Float) null;
 +  }
 +
 +  public Map<Long,Integer> getChildren() {
 +    return this.children;
 +  }
 +
 +  public static void main(String[] args) throws IOException {
 +
 +    LOG.info("Constructing ARPA file");
 +    ArpaFile arpaFile = new ArpaFile(args[0]);
 +
 +    LOG.info("Getting symbol table");
 +    Vocabulary vocab = arpaFile.getVocab();
 +
 +    LOG.info("Constructing TrieLM");
 +    TrieLM lm = new TrieLM(arpaFile);
 +
 +    int n = Integer.valueOf(args[2]);
 +    LOG.info("N-gram order will be {}", n);
 +
 +    Scanner scanner = new Scanner(new File(args[1]));
 +
-     LinkedList<String> wordList = new LinkedList<String>();
-     LinkedList<String> window = new LinkedList<String>();
++    LinkedList<String> wordList = new LinkedList<>();
++    LinkedList<String> window = new LinkedList<>();
 +
 +    LOG.info("Starting to scan {}", args[1]);
 +    while (scanner.hasNext()) {
 +
 +      LOG.info("Getting next line...");
 +      String line = scanner.nextLine();
 +      LOG.info("Line: {}", line);
 +
 +      String[] words = Regex.spaces.split(line);
 +      wordList.clear();
 +
 +      wordList.add("<s>");
-       for (String word : words) {
-         wordList.add(word);
-       }
++      Collections.addAll(wordList, words);
 +      wordList.add("</s>");
 +
-       ArrayList<Integer> sentence = new ArrayList<Integer>();
++      ArrayList<Integer> sentence = new ArrayList<>();
 +      //        int[] ids = new int[wordList.size()];
-       for (int i=0, size=wordList.size(); i<size; i++) {
-         sentence.add(vocab.id(wordList.get(i)));
++      for (String aWordList : wordList) {
++        sentence.add(Vocabulary.id(aWordList));
 +        //          ids[i] = ;
 +      }
 +
 +
 +
 +      while (! wordList.isEmpty()) {
 +        window.clear();
 +
 +        {
 +          int i=0;
 +          for (String word : wordList) {
 +            if (i>=n) break;
 +            window.add(word);
 +            i++;
 +          }
 +          wordList.remove();
 +        }
 +
 +        {
 +          int i=0;
 +          int[] wordIDs = new int[window.size()];
 +          for (String word : window) {
-             wordIDs[i] = vocab.id(word);
++            wordIDs[i] = Vocabulary.id(word);
 +            i++;
 +          }
 +
 +          LOG.info("logProb {} = {}", window, lm.ngramLogProbability(wordIDs, n));
 +        }
 +      }
 +
 +      double logProb = lm.sentenceLogProbability(sentence, n, 2);//.ngramLogProbability(ids, n);
 +      double prob = Math.exp(logProb);
 +
 +      LOG.info("Total logProb = {}", logProb);
 +      LOG.info("Total    prob = {}",  prob);
 +    }
 +
 +  }
 +
 +  @Override
 +  public boolean isOov(int id) {
 +    throw new RuntimeException("Not implemented!");
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
index fc6c831,0000000..31635ef
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
@@@ -1,60 -1,0 +1,76 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.phrase;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.StatelessFF;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.phrase.Hypothesis;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +public class Distortion extends StatelessFF {
 +
 +  public Distortion(FeatureVector weights, String[] args, JoshuaConfiguration config) {
 +    super(weights, "Distortion", args, config);
 +    
 +    if (! config.search_algorithm.equals("stack")) {
 +      String msg = "* FATAL: Distortion feature only application for phrase-based decoding. "
 +          + "Use -search phrase or remove this feature";
 +      throw new RuntimeException(msg);
 +    }
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +
-     if (rule != Hypothesis.BEGIN_RULE && rule != Hypothesis.END_RULE) {
-         int start_point = j - rule.getSource().length + rule.getArity();
++    if (rule == Hypothesis.MONO_RULE || rule == Hypothesis.SWAP_RULE) {
++//        int start_point = j - rule.getFrench().length + rule.getArity();
++//        int jump_size = Math.abs(tailNodes.get(0).j - start_point);
 +
-         int jump_size = Math.abs(tailNodes.get(0).j - start_point);
-         acc.add(featureId, -jump_size); 
++      if (rule == Hypothesis.MONO_RULE) {
++        int start_point = j - tailNodes.get(1).getHyperEdges().get(0).getRule().getSource().length;
++        int last_point = tailNodes.get(0).j;
++        int jump_size = Math.abs(start_point - last_point);
++      
++//        System.err.println(String.format("DISTORTION_mono(%d -> %d) = %d", 
++//            last_point, start_point, jump_size));
++
++        acc.add(featureId, -jump_size);
++      } else {
++        int start_point = j - tailNodes.get(0).getHyperEdges().get(0).getRule().getSource().length;
++        int last_point = tailNodes.get(1).j;
++        int jump_size = Math.abs(start_point - last_point);
++      
++//        System.err.println(String.format("DISTORTION_swap(%d -> %d) = %d", 
++//            last_point, start_point, jump_size));
++
++        acc.add(featureId, -jump_size);    
++      }
 +    }
 +    
-     // System.err.println(String.format("DISTORTION(%d, %d) from %d = %d", i, j, tailNodes != null ? tailNodes.get(0).j : -1, jump_size));
- 
 +    return null;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/similarity/EdgePhraseSimilarityFF.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/similarity/EdgePhraseSimilarityFF.java
index 9f402cb,0000000..38bd373
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/similarity/EdgePhraseSimilarityFF.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/similarity/EdgePhraseSimilarityFF.java
@@@ -1,279 -1,0 +1,278 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.similarity;
 +
 +import java.io.BufferedReader;
 +import java.io.IOException;
 +import java.io.InputStreamReader;
 +import java.io.PrintWriter;
 +import java.net.Socket;
 +import java.net.UnknownHostException;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.List;
 +
 +import com.google.common.base.Throwables;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.SourceDependentFF;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.state_maintenance.NgramDPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.Cache;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +public class EdgePhraseSimilarityFF extends StatefulFF implements SourceDependentFF {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(EdgePhraseSimilarityFF.class);
 +
-   private static Cache<String, Float> cache = new Cache<String, Float>(100000000);
++  private static final Cache<String, Float> cache = new Cache<>(100000000);
 +
-   private String host;
-   private int port;
++  private final String host;
++  private final int port;
 +
-   private Socket socket;
 +  private PrintWriter serverAsk;
 +  private BufferedReader serverReply;
 +
 +  private int[] source;
 +
 +  private final int MAX_PHRASE_LENGTH = 4;
-   private final int GAP = 0;
 +
 +  public EdgePhraseSimilarityFF(FeatureVector weights, String[] args, JoshuaConfiguration config) throws NumberFormatException, UnknownHostException, IOException {
 +    super(weights, "EdgePhraseSimilarity", args, config);
 +
 +    this.host = parsedArgs.get("host");
 +    this.port = Integer.parseInt(parsedArgs.get("port"));
 +
 +    initializeConnection();
 +  }
 +
 +  private void initializeConnection() throws NumberFormatException, IOException {
 +    LOG.info("Opening connection.");
-     socket = new Socket(host, port);
++    Socket socket = new Socket(host, port);
 +    serverAsk = new PrintWriter(socket.getOutputStream(), true);
 +    serverReply = new BufferedReader(new InputStreamReader(socket.getInputStream()));
 +  }
 +
 +  @Override
 +  public DPState compute(Rule rule, List<HGNode> tailNodes, int i, int j, SourcePath sourcePath,
 +      Sentence sentence, Accumulator acc) {
 +
 +    float value = computeScore(rule, tailNodes);
 +    acc.add(featureId, value);
 +
 +    // TODO 07/2013: EdgePhraseSimilarity needs to know its order rather than inferring it from tail
 +    // nodes.
 +    return new NgramDPState(new int[1], new int[1]);
 +  }
 +  
 +  @Override
 +  public DPState computeFinal(HGNode tailNode, int i, int j, SourcePath path, Sentence sentence, Accumulator acc) {
 +    return null;
 +  }
 +
 +  public float computeScore(Rule rule, List<HGNode> tailNodes) {
 +    if (tailNodes == null || tailNodes.isEmpty())
 +      return 0;
 +
 +    // System.err.println("RULE [" + spanStart + ", " + spanEnd + "]: " + rule.toString());
 +
 +    int[] target = rule.getTarget();
 +    int lm_state_size = 0;
 +    for (HGNode node : tailNodes) {
 +      NgramDPState state = (NgramDPState) node.getDPState(stateIndex);
 +      lm_state_size += state.getLeftLMStateWords().length + state.getRightLMStateWords().length;
 +    }
 +
-     ArrayList<int[]> batch = new ArrayList<int[]>();
++    ArrayList<int[]> batch = new ArrayList<>();
 +
 +    // Build joined target string.
 +    int[] join = new int[target.length + lm_state_size];
 +
 +    int idx = 0, num_gaps = 1, num_anchors = 0;
 +    int[] anchors = new int[rule.getArity() * 2];
 +    int[] indices = new int[rule.getArity() * 2];
 +    int[] gaps = new int[rule.getArity() + 2];
 +    gaps[0] = 0;
 +    for (int t = 0; t < target.length; t++) {
 +      if (target[t] < 0) {
 +        HGNode node = tailNodes.get(-(target[t] + 1));
 +        if (t != 0) {
 +          indices[num_anchors] = node.i;
 +          anchors[num_anchors++] = idx;
 +        }
 +        NgramDPState state = (NgramDPState) node.getDPState(stateIndex);
 +        // System.err.print("LEFT:  ");
 +        // for (int w : state.getLeftLMStateWords()) System.err.print(Vocabulary.word(w) + " ");
 +        // System.err.println();
 +        for (int w : state.getLeftLMStateWords())
 +          join[idx++] = w;
++        int GAP = 0;
 +        join[idx++] = GAP;
 +        gaps[num_gaps++] = idx;
 +        // System.err.print("RIGHT:  ");
 +        // for (int w : state.getRightLMStateWords()) System.err.print(Vocabulary.word(w) + " ");
 +        // System.err.println();
 +        for (int w : state.getRightLMStateWords())
 +          join[idx++] = w;
 +        if (t != target.length - 1) {
 +          indices[num_anchors] = node.j;
 +          anchors[num_anchors++] = idx;
 +        }
 +      } else {
 +        join[idx++] = target[t];
 +      }
 +    }
 +    gaps[gaps.length - 1] = join.length + 1;
 +
 +    // int c = 0;
 +    // System.err.print("> ");
 +    // for (int k = 0; k < join.length; k++) {
 +    // if (c < num_anchors && anchors[c] == k) {
 +    // c++;
 +    // System.err.print("| ");
 +    // }
 +    // System.err.print(Vocabulary.word(join[k]) + " ");
 +    // }
 +    // System.err.println("<");
 +
 +    int g = 0;
 +    for (int a = 0; a < num_anchors; a++) {
 +      if (a > 0 && anchors[a - 1] == anchors[a])
 +        continue;
 +      if (anchors[a] > gaps[g + 1])
 +        g++;
 +      int left = Math.max(gaps[g], anchors[a] - MAX_PHRASE_LENGTH + 1);
 +      int right = Math.min(gaps[g + 1] - 1, anchors[a] + MAX_PHRASE_LENGTH - 1);
 +
 +      int[] target_phrase = new int[right - left];
 +      System.arraycopy(join, left, target_phrase, 0, target_phrase.length);
 +      int[] source_phrase = getSourcePhrase(indices[a]);
 +
 +      if (source_phrase != null && target_phrase.length != 0) {
 +        // System.err.println("ANCHOR: " + indices[a]);
 +        batch.add(source_phrase);
 +        batch.add(target_phrase);
 +      }
 +    }
 +    return getSimilarity(batch);
 +  }
 +
 +  @Override
 +  public float estimateFutureCost(Rule rule, DPState currentState, Sentence sentence) {
 +    return 0.0f;
 +  }
 +
 +  /**
 +   * From SourceDependentFF interface.
 +   */
 +  @Override
 +  public void setSource(Sentence sentence) {
 +    if (! sentence.isLinearChain())
 +      throw new RuntimeException("EdgePhraseSimilarity not defined for lattices");
 +    this.source = sentence.getWordIDs();
 +  }
 +
 +  public EdgePhraseSimilarityFF clone() {
 +    try {
 +      return new EdgePhraseSimilarityFF(this.weights, args, config);
 +    } catch (Exception e) {
 +      throw Throwables.propagate(e);
 +    }
 +  }
 +
 +  @Override
 +  public float estimateCost(Rule rule, Sentence sentence) {
 +    return 0.0f;
 +  }
 +
-   private final int[] getSourcePhrase(int anchor) {
++  private int[] getSourcePhrase(int anchor) {
 +    int idx;
 +    int length = Math.min(anchor, MAX_PHRASE_LENGTH - 1)
 +        + Math.min(source.length - anchor, MAX_PHRASE_LENGTH - 1);
 +    if (length <= 0)
 +      return null;
 +    int[] phrase = new int[length];
 +    idx = 0;
 +    for (int p = Math.max(0, anchor - MAX_PHRASE_LENGTH + 1); p < Math.min(source.length, anchor
 +        + MAX_PHRASE_LENGTH - 1); p++)
 +      phrase[idx++] = source[p];
 +    return phrase;
 +  }
 +
 +  private float getSimilarity(List<int[]> batch) {
 +    float similarity = 0.0f;
 +    int count = 0;
 +    StringBuilder query = new StringBuilder();
-     List<String> to_cache = new ArrayList<String>();
++    List<String> to_cache = new ArrayList<>();
 +    query.append("xb");
 +    for (int i = 0; i < batch.size(); i += 2) {
 +      int[] source = batch.get(i);
 +      int[] target = batch.get(i + 1);
 +
 +      if (Arrays.equals(source, target)) {
 +        similarity += 1;
 +        count++;
 +      } else {
 +        String source_string = Vocabulary.getWords(source);
 +        String target_string = Vocabulary.getWords(target);
 +
 +        String both;
 +        if (source_string.compareTo(target_string) > 0)
 +          both = source_string + " ||| " + target_string;
 +        else
 +          both = target_string + " ||| " + source_string;
 +
 +        Float cached = cache.get(both);
 +        if (cached != null) {
 +          // System.err.println("SIM: " + source_string + " X " + target_string + " = " + cached);
 +          similarity += cached;
 +          count++;
 +        } else {
 +          query.append("\t").append(source_string);
 +          query.append("\t").append(target_string);
 +          to_cache.add(both);
 +        }
 +      }
 +    }
 +    if (!to_cache.isEmpty()) {
 +      try {
 +        serverAsk.println(query.toString());
 +        String response = serverReply.readLine();
 +        String[] scores = response.split("\\s+");
 +        for (int i = 0; i < scores.length; i++) {
 +          Float score = Float.parseFloat(scores[i]);
 +          cache.put(to_cache.get(i), score);
 +          similarity += score;
 +          count++;
 +        }
 +      } catch (Exception e) {
 +        return 0;
 +      }
 +    }
 +    return (count == 0 ? 0 : similarity / count);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/state_maintenance/NgramDPState.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/state_maintenance/NgramDPState.java
index b269bd9,0000000..ef72b3d
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/state_maintenance/NgramDPState.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/state_maintenance/NgramDPState.java
@@@ -1,100 -1,0 +1,100 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.state_maintenance;
 +
 +import java.util.Arrays;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +
 +/**
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Juri Ganitkevitch, juri@cs.jhu.edu
 + */
 +public class NgramDPState extends DPState {
 +
 +  private int[] left;
 +  private int[] right;
 +
 +  private int hash = 0;
 +
 +  public NgramDPState(int[] l, int[] r) {
 +    left = l;
 +    right = r;
 +    assertLengths();
 +  }
 +
 +  public void setLeftLMStateWords(int[] words) {
 +    left = words;
 +    assertLengths();
 +  }
 +
 +  public int[] getLeftLMStateWords() {
 +    return left;
 +  }
 +
 +  public void setRightLMStateWords(int[] words) {
 +    right = words;
 +    assertLengths();
 +  }
 +
 +  public int[] getRightLMStateWords() {
 +    return right;
 +  }
 +
-   private final void assertLengths() {
++  private void assertLengths() {
 +    if (left.length != right.length)
 +      throw new RuntimeException("Unequal lengths in left and right state: < "
 +          + Vocabulary.getWords(left) + " | " + Vocabulary.getWords(right) + " >");
 +  }
 +
 +  @Override
 +  public int hashCode() {
 +    if (hash == 0) {
 +      hash = 31 + Arrays.hashCode(left);
 +      hash = hash * 19 + Arrays.hashCode(right);
 +    }
 +    return hash;
 +  }
 +
 +  @Override
 +  public boolean equals(Object other) {
 +    if (other instanceof NgramDPState) {
 +      NgramDPState that = (NgramDPState) other;
 +      if (this.left.length == that.left.length && this.right.length == that.right.length) {
 +        for (int i = 0; i < left.length; ++i)
 +          if (this.left[i] != that.left[i] || this.right[i] != that.right[i])
 +            return false;
 +        return true;
 +      }
 +    }
 +    return false;
 +  }
 +
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    sb.append("<");
 +    for (int id : left)
-       sb.append(" " + Vocabulary.word(id));
++      sb.append(" ").append(Vocabulary.word(id));
 +    sb.append(" |");
 +    for (int id : right)
-       sb.append(" " + Vocabulary.word(id));
++      sb.append(" ").append(Vocabulary.word(id));
 +    sb.append(" >");
 +    return sb.toString();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/AbstractGrammar.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/AbstractGrammar.java
index 70e4daf,0000000..91cf00f
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/AbstractGrammar.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/AbstractGrammar.java
@@@ -1,230 -1,0 +1,230 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm;
 +
 +import java.util.Arrays;
 +import java.util.HashSet;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.phrase.PhraseTable;
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.lattice.Arc;
 +import org.apache.joshua.lattice.Lattice;
 +import org.apache.joshua.lattice.Node;
 +
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Partial implementation of the <code>Grammar</code> interface that provides logic for sorting a
 + * grammar.
 + * <p>
 + * <em>Note</em>: New classes implementing the <code>Grammar</code> interface should probably
 + * inherit from this class, unless a specific sorting technique different from that implemented by
 + * this class is required.
 + * 
 + * @author Zhifei Li
 + * @author Lane Schwartz
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public abstract class AbstractGrammar implements Grammar {
 +
 +  /** Logger for this class. */
 +  private static final Logger LOG = LoggerFactory.getLogger(AbstractGrammar.class);
 +  /**
 +   * Indicates whether the rules in this grammar have been sorted based on the latest feature
 +   * function values.
 +   */
 +  protected boolean sorted = false;
 +
 +  /*
 +   * The grammar's owner, used to determine which weights are applicable to the dense features found
 +   * within.
 +   */
 +  protected final OwnerId owner;
 +  
 +  /*
 +   * The maximum length of a source-side phrase. Mostly used by the phrase-based decoder.
 +   */
 +  protected int maxSourcePhraseLength = -1;
 +  
 +    /**
 +   * Returns the longest source phrase read.
 +   * 
 +   * @return the longest source phrase read (nonterminal + terminal symbols).
 +   */
 +  @Override
 +  public int getMaxSourcePhraseLength() {
 +    return maxSourcePhraseLength;
 +  }
 +  
 +  @Override
 +  public OwnerId getOwner() {
 +    return owner;
 +  }
 +  
 +  public int getSpanLimit() {
 +    return spanLimit;
 +  }
 +
 +  /* The maximum span of the input this grammar rules can be applied to. */
 +  protected final int spanLimit;
 +
 +  protected final JoshuaConfiguration joshuaConfiguration;
 +
 +  /**
 +   * Creates an empty, unsorted grammar with given owner and spanlimit
 +   * 
 +   * @see Grammar#isSorted()
 +   * @param owner the associated decoder-wide {@link org.apache.joshua.decoder.ff.tm.OwnerMap}
 +   * @param config a {@link org.apache.joshua.decoder.JoshuaConfiguration} object
 +   * @param spanLimit the maximum span of the input grammar rule(s) can be applied to.
 +   */
 +  public AbstractGrammar(final String owner, final JoshuaConfiguration config, final int spanLimit) {
 +    this.sorted = false;
 +    this.owner = OwnerMap.register(owner);
 +    this.joshuaConfiguration = config;
 +    this.spanLimit = spanLimit;
 +  }
 +
 +  public static final int OOV_RULE_ID = 0;
 +
 +  /**
 +   * Cube-pruning requires that the grammar be sorted based on the latest feature functions. To
 +   * avoid synchronization, this method should be called before multiple threads are initialized for
 +   * parallel decoding
 +   * @param models {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   */
 +  public void sortGrammar(List<FeatureFunction> models) {
 +    Trie root = getTrieRoot();
 +    if (root != null) {
 +      sort(root, models);
 +      setSorted(true);
 +    }
 +  }
 +
 +  /* See Javadoc comments for Grammar interface. */
 +  public boolean isSorted() {
 +    return sorted;
 +  }
 +
 +  /**
 +   * Sets the flag indicating whether this grammar is sorted.
 +   * <p>
 +   * This method is called by {@link org.apache.joshua.decoder.ff.tm.AbstractGrammar#sortGrammar(List)}
 +   * to indicate that the grammar has been sorted.</p>
 +   * 
 +   * <p>Its scope is protected so that child classes that override <code>sortGrammar</code> will also
 +   * be able to call this method to indicate that the grammar has been sorted.</p>
 +   * 
 +   * @param sorted set to true if the grammar is sorted
 +   */
 +  protected void setSorted(boolean sorted) {
 +    this.sorted = sorted;
 +    LOG.debug("This grammar is now sorted: {}",  this);
 +  }
 +
 +  /**
 +   * Recursively sorts the grammar using the provided feature functions.
 +   * <p>
 +   * This method first sorts the rules stored at the provided node, then recursively calls itself on
 +   * the child nodes of the provided node.
 +   * 
 +   * @param node Grammar node in the <code>Trie</code> whose rules should be sorted.
 +   * @param models Feature function models to use during sorting.
 +   */
 +  private void sort(Trie node, List<FeatureFunction> models) {
 +
 +    if (node != null) {
 +      if (node.hasRules()) {
 +        RuleCollection rules = node.getRuleCollection();
 +        LOG.debug("Sorting node {}", Arrays.toString(rules.getSourceSide()));
 +
 +        /* This causes the rules at this trie node to be sorted */
 +        rules.getSortedRules(models);
 +
 +        if (LOG.isDebugEnabled()) {
 +          StringBuilder s = new StringBuilder();
 +          for (Rule r : rules.getSortedRules(models)) {
 +            s.append("\n\t" + r.getLHS() + " ||| " + Arrays.toString(r.getSource()) + " ||| "
 +                + Arrays.toString(r.getTarget()) + " ||| " + r.getFeatureVector() + " ||| "
 +                + r.getEstimatedCost() + "  " + r.getClass().getName() + "@"
 +                + Integer.toHexString(System.identityHashCode(r)));
 +          }
 +          LOG.debug("{}", s);
 +        }
 +      }
 +
 +      if (node.hasExtensions()) {
 +        for (Trie child : node.getExtensions()) {
 +          sort(child, models);
 +        }
 +      } else {
 +        LOG.debug("Node has 0 children to extend: {}", node);
 +      }
 +    }
 +  }
 +
 +  // write grammar to disk
 +  public void writeGrammarOnDisk(String file) {
 +  }
 +  
 +  /**
 +   * Adds OOV rules for all words in the input lattice to the current grammar. Uses addOOVRule() so that
 +   * sub-grammars can define different types of OOV rules if needed (as is used in {@link PhraseTable}).
 +   * 
 +   * @param grammar Grammar in the Trie
 +   * @param inputLattice the lattice representing the input sentence
 +   * @param featureFunctions a list of feature functions used for scoring
 +   * @param onlyTrue determine if word is actual OOV.
 +   */
 +  public static void addOOVRules(Grammar grammar, Lattice<Token> inputLattice, 
 +      List<FeatureFunction> featureFunctions, boolean onlyTrue) {
 +    /*
 +     * Add OOV rules; This should be called after the manual constraints have
 +     * been set up.
 +     */
-     HashSet<Integer> words = new HashSet<Integer>();
++    HashSet<Integer> words = new HashSet<>();
 +    for (Node<Token> node : inputLattice) {
 +      for (Arc<Token> arc : node.getOutgoingArcs()) {
 +        // create a rule, but do not add into the grammar trie
 +        // TODO: which grammar should we use to create an OOV rule?
 +        int sourceWord = arc.getLabel().getWord();
 +        if (sourceWord == Vocabulary.id(Vocabulary.START_SYM)
 +            || sourceWord == Vocabulary.id(Vocabulary.STOP_SYM))
 +          continue;
 +
 +        // Determine if word is actual OOV.
 +        if (onlyTrue && ! Vocabulary.hasId(sourceWord))
 +          continue;
 +
 +        words.add(sourceWord);
 +      }
 +    }
 +
 +    for (int sourceWord: words) 
 +      grammar.addOOVRules(sourceWord, featureFunctions);
 +
 +    // Sort all the rules (not much to actually do, this just marks it as sorted)
 +    grammar.sortGrammar(featureFunctions);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/BasicRuleCollection.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/BasicRuleCollection.java
index 4cffb2f,0000000..4d577dc
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/BasicRuleCollection.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/BasicRuleCollection.java
@@@ -1,101 -1,0 +1,101 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm;
 +
 +import java.util.ArrayList;
 +import java.util.Collections;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +
 +/**
 + * Basic collection of translation rules.
 + * 
 + * @author Lane Schwartz
 + * @author Zhifei Li
 + */
 +public class BasicRuleCollection implements RuleCollection {
 +
 +  /**
 +   * Indicates whether the rules in this collection have been sorted based on the latest feature
 +   * function values.
 +   */
 +  protected boolean sorted;
 +
 +  /** List of rules stored in this collection. */
 +  protected final List<Rule> rules;
 +
 +  /** Number of nonterminals in the source pattern. */
 +  protected int arity;
 +
 +  /**
 +   * Sequence of terminals and nonterminals in the source pattern.
 +   */
 +  protected int[] sourceTokens;
 +
 +  /**
 +   * Constructs an initially empty rule collection.
 +   * 
 +   * @param arity Number of nonterminals in the source pattern
 +   * @param sourceTokens Sequence of terminals and nonterminals in the source pattern
 +   */
 +  public BasicRuleCollection(int arity, int[] sourceTokens) {
-     this.rules = new ArrayList<Rule>();
++    this.rules = new ArrayList<>();
 +    this.sourceTokens = sourceTokens;
 +    this.arity = arity;
 +    this.sorted = false;
 +  }
 +
 +  public int getArity() {
 +    return this.arity;
 +  }
 +
 +  /**
 +   * Returns a list of the rules, without ensuring that they are first sorted.
 +   */
 +  @Override
 +  public List<Rule> getRules() {
 +    return this.rules;
 +  }
 +  
 +  @Override
 +  public boolean isSorted() {
 +    return sorted;
 +  }
 +
 +  /**
 +   * Return a list of rules sorted according to their estimated model costs.
 +   */
 +  @Override
 +  public synchronized List<Rule> getSortedRules(List<FeatureFunction> models) {
 +    if (! isSorted()) {
 +      for (Rule rule: getRules())
 +        rule.estimateRuleCost(models);
 +
 +      Collections.sort(rules, Rule.EstimatedCostComparator);
 +      this.sorted = true;      
 +    }
 +    
 +    return this.rules;
 +  }
 +
 +  public int[] getSourceSide() {
 +    return this.sourceTokens;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/CreateGlueGrammar.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/CreateGlueGrammar.java
index ce1e7d1,0000000..2424a1e
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/CreateGlueGrammar.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/CreateGlueGrammar.java
@@@ -1,126 -1,0 +1,126 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm;
 +
 +import static org.apache.joshua.decoder.ff.tm.packed.PackedGrammar.VOCABULARY_FILENAME;
 +import static org.apache.joshua.util.FormatUtils.cleanNonTerminal;
 +import static org.apache.joshua.util.FormatUtils.isNonterminal;
 +
 +import java.io.File;
 +import java.io.IOException;
 +import java.util.HashSet;
 +import java.util.Set;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.util.io.LineReader;
 +
 +import org.kohsuke.args4j.CmdLineException;
 +import org.kohsuke.args4j.CmdLineParser;
 +import org.kohsuke.args4j.Option;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +public class CreateGlueGrammar {
 +
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(CreateGlueGrammar.class);
 +
 +  private final Set<String> nonTerminalSymbols = new HashSet<>();
 +
 +  @Option(name = "--grammar", aliases = {"-g"}, required = true, usage = "provide grammar to determine list of NonTerminal symbols.")
 +  private String grammarPath;
 +  
 +  @Option(name = "--goal", aliases = {"-goal"}, required = false, usage = "specify custom GOAL symbol. Default: 'GOAL'")
-   private String goalSymbol = cleanNonTerminal(new JoshuaConfiguration().goal_symbol);
++  private final String goalSymbol = cleanNonTerminal(new JoshuaConfiguration().goal_symbol);
 +
 +  /* Rule templates */
 +  // [GOAL] ||| <s> ||| <s> ||| 0
 +  private static final String R_START = "[%1$s] ||| <s> ||| <s> ||| 0";
 +  // [GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
 +  private static final String R_TWO = "[%1$s] ||| [%1$s,1] [%2$s,2] ||| [%1$s,1] [%2$s,2] ||| -1";
 +  // [GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0
 +  private static final String R_END = "[%1$s] ||| [%1$s,1] </s> ||| [%1$s,1] </s> ||| 0";
 +  // [GOAL] ||| <s> [X,1] </s> ||| <s> [X,1] </s> ||| 0
 +  private static final String R_TOP = "[%1$s] ||| <s> [%2$s,1] </s> ||| <s> [%2$s,1] </s> ||| 0";
 +  
 +  private void run() throws IOException {
 +    
 +    File grammar_file = new File(grammarPath);
 +    if (!grammar_file.exists()) {
 +      throw new IOException("Grammar file doesn't exist: " + grammarPath);
 +    }
 +
 +    // in case of a packedGrammar, we read the serialized vocabulary,
 +    // collecting all cleaned nonTerminal symbols.
 +    if (grammar_file.isDirectory()) {
 +      Vocabulary.read(new File(grammarPath + File.separator + VOCABULARY_FILENAME));
 +      for (int i = 0; i < Vocabulary.size(); ++i) {
 +        final String token = Vocabulary.word(i);
 +        if (isNonterminal(token)) {
 +          nonTerminalSymbols.add(cleanNonTerminal(token));
 +        }
 +      }
 +    // otherwise we collect cleaned left-hand sides from the rules in the text grammar.
 +    } else { 
 +      final LineReader reader = new LineReader(grammarPath);
 +      while (reader.hasNext()) {
 +        final String line = reader.next();
 +        int lhsStart = line.indexOf("[") + 1;
 +        int lhsEnd = line.indexOf("]");
 +        if (lhsStart < 1 || lhsEnd < 0) {
 +          LOG.info("malformed rule: {}\n", line);
 +          continue;
 +        }
 +        final String lhs = line.substring(lhsStart, lhsEnd);
 +        nonTerminalSymbols.add(lhs);
 +      }
 +    }
 +    
 +    LOG.info("{} nonTerminal symbols read: {}", nonTerminalSymbols.size(),
 +        nonTerminalSymbols.toString());
 +
 +    // write glue rules to stdout
 +    
 +    System.out.println(String.format(R_START, goalSymbol));
 +    
 +    for (String nt : nonTerminalSymbols)
 +      System.out.println(String.format(R_TWO, goalSymbol, nt));
 +    
 +    System.out.println(String.format(R_END, goalSymbol));
 +    
 +    for (String nt : nonTerminalSymbols)
 +      System.out.println(String.format(R_TOP, goalSymbol, nt));
 +
 +  }
 +  
 +  public static void main(String[] args) throws IOException {
 +    final CreateGlueGrammar glueCreator = new CreateGlueGrammar();
 +    final CmdLineParser parser = new CmdLineParser(glueCreator);
 +
 +    try {
 +      parser.parseArgument(args);
 +      glueCreator.run();
 +    } catch (CmdLineException e) {
 +      LOG.error(e.getMessage(), e);
 +      parser.printUsage(System.err);
 +      System.exit(1);
 +    }
 +   }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/OwnerMap.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/OwnerMap.java
index 16b8bfc,0000000..5d5ca9f
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/OwnerMap.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/OwnerMap.java
@@@ -1,86 -1,0 +1,86 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm;
 +
 +import java.util.concurrent.locks.StampedLock;
 +
 +import com.google.common.collect.BiMap;
 +import com.google.common.collect.HashBiMap;
 +
 +/**
 + * OwnerMap maintains a decoder-wide mapping between 'owner' strings and
 + * corresponding IDs, typed as OwnerId. Using this more strongly typed mapping,
 + * we can separate wordIDs in {@link org.apache.joshua.corpus.Vocabulary} from 
 + * {@link org.apache.joshua.decoder.ff.tm.OwnerId}s. For example, this prevents 
 + * packed grammars to overwrite the owner mappings from previously loaded packaged 
 + * grammars.
 + * 
 + * @author fhieber
 + *
 + */
 +public class OwnerMap {
 +
 +  // bi-directional mapping between OwnerId and Owner strings
-   private static BiMap<OwnerId, String> map = HashBiMap.create();
++  private static final BiMap<OwnerId, String> map = HashBiMap.create();
 +
 +  public static final OwnerId UNKNOWN_OWNER_ID = new OwnerId(0);
 +  public static final String UNKNOWN_OWNER = "<unowned>";
 +
 +  private static final StampedLock lock = new StampedLock();
 +
 +  static {
 +    clear();
 +  }
 +
 +  /**
 +   * Register or get OwnerId for given ownerString. This is only called during
 +   * feature function and grammar initalization and thus does not require
 +   * sophisticated locking.
 +   * @param ownerString the OwnerId to register or get
 +   * @return the registered or existing OwnerId
 +   */
 +  public static synchronized OwnerId register(String ownerString) {
 +    if (map.inverse().containsKey(ownerString)) {
 +      return map.inverse().get(ownerString);
 +    }
 +
 +    final OwnerId newId = new OwnerId(map.size());
 +    map.put(newId, ownerString);
 +    return newId;
 +  }
 +
 +  public static String getOwner(final OwnerId id) {
 +    long lock_stamp = lock.readLock();
 +    try {
 +      if (map.containsKey(id)) {
 +        return map.get(id);
 +      }
 +      throw new IllegalArgumentException(
 +          String.format("OwnerMap does not contain mapping for %s", id));
 +    } finally {
 +      lock.unlockRead(lock_stamp);
 +    }
 +  }
 +
 +  public static synchronized void clear() {
 +    map.clear();
 +    map.put(UNKNOWN_OWNER_ID, UNKNOWN_OWNER);
 +  }
 +
 +}


[06/50] [abbrv] incubator-joshua git commit: Bug fix in reporting inside cost — everything now works

Posted by mj...@apache.org.
Bug fix in reporting inside cost \u2014�everything now works


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/293db94c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/293db94c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/293db94c

Branch: refs/heads/7
Commit: 293db94c2853f7dc15bd6fecdf3b39bd3a4b4965
Parents: e3b60ca
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 06:53:41 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 06:53:41 2016 -0500

----------------------------------------------------------------------
 .../apache/joshua/decoder/phrase/Candidate.java | 42 ++++++++++----------
 1 file changed, 20 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/293db94c/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index 1342ea5..a446eab 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@ -45,7 +45,7 @@ import org.apache.joshua.decoder.hypergraph.HGNode;
 import org.apache.joshua.decoder.hypergraph.HyperEdge;
 import org.apache.joshua.decoder.segment_file.Sentence;
 
-public class Candidate {
+public class Candidate implements Comparable<Candidate> {
   
   private List<FeatureFunction> featureFunctions;
   private Sentence sentence;
@@ -76,6 +76,7 @@ public class Candidate {
    * as part of its constructor, so we delay computing it unless needed.
    */
   private HGNode phraseNode;
+  private ComputeNodeResult phraseResult;
   
   /**
    * When candidate objects are extended, the new one is initialized with the same underlying
@@ -114,9 +115,9 @@ public class Candidate {
   
   @Override
   public String toString() {
-    return String.format("CANDIDATE(hyp %d/%d, phr %d/%d) [%s] phrase=[%s] span=%s",
-        ranks[0], hypotheses.size(), ranks[1], phrases.size(),
-        getHypothesis(), getPhraseNode(), getSpan());
+    return String.format("CANDIDATE(hyp %d/%d, phr %d/%d) %.3f [%s] phrase=[%s] span=%s",
+        ranks[0], hypotheses.size(), ranks[1], phrases.size(), score(),
+        getHypothesis(), getPhraseNode().bestHyperedge.getRule().getEnglishWords(), getSpan());
   }
 
   public Candidate(List<FeatureFunction> featureFunctions, Sentence sentence, 
@@ -130,10 +131,11 @@ public class Candidate {
     this.rule = isMonotonic() ? Hypothesis.MONO_RULE : Hypothesis.SWAP_RULE;
 //    this.score = hypotheses.get(ranks[0]).score + phrases.get(ranks[1]).getEstimatedCost();
 
+    this.phraseNode = null;
+    this.computedResult = null;
+    
     // TODO: compute this proactively or lazily according to a parameter
     computeResult();
-//    this.phraseNode = null;
-//    this.computedResult = null;
   }
   
   /**
@@ -233,9 +235,9 @@ public class Candidate {
   public ComputeNodeResult computeResult() {
     if (computedResult == null) {
       // add the phrase node
-      ComputeNodeResult phraseResult = new ComputeNodeResult(featureFunctions, getPhraseRule(), null, phrases.i, phrases.j, null, sentence);
+      phraseResult = new ComputeNodeResult(featureFunctions, getPhraseRule(), null, phrases.i, phrases.j, null, sentence);
       HyperEdge edge = new HyperEdge(getPhraseRule(), phraseResult.getViterbiCost(), phraseResult.getTransitionCost(), null, null);
-      phraseNode = new HGNode(phrases.i, phrases.j, rule.getLHS(), phraseResult.getDPStates(), edge, phraseResult.getPruningEstimate());
+      phraseNode = new HGNode(phrases.i, phrases.j, getPhraseRule().getLHS(), phraseResult.getDPStates(), edge, phraseResult.getPruningEstimate());
 
       // add the rule
       // TODO: sourcepath
@@ -284,24 +286,20 @@ public class Candidate {
   }
 
   /**
-   * This returns the sum of two costs: the HypoState cost + the transition cost. The HypoState cost
-   * is in turn the sum of two costs: the Viterbi cost of the underlying hypothesis, and the adjustment
-   * to the future score incurred by translating the words under the source phrase being added.
-   * The transition cost is the sum of new features incurred along the transition (mostly, the
-   * language model costs).
+   * This returns the sum of two costs: the Viterbi cost of the edge represented by the current
+   * cube pruning state, plus the difference to the future cost incurred by translating the
+   * current phrase.
    * 
-   * The Future Cost item should probably just be implemented as another kind of feature function,
-   * but it would require some reworking of that interface, which isn't worth it. 
+   * Note that in phrase-based decoding, the Hypothesis scores include the future cost estimate,
+   * which means that the Viterbi cost (which includes only the inside estimates) is not the complete
+   * cost; instead, you have to chain the calls to the hypothesis. This should be fixed and cleaned
+   * up to formally separate the "inside" and "outside" costs.
    * 
-   * @return the sum of two costs: the HypoState cost + the transition cost
+   * @return the inside + outside cost
    */
   public float score() {
-    float score = computedResult.getPruningEstimate();
-
-//    float score = getHypothesis().getScore() + future_delta;
-//    if (computedResult != null)
-//      score += computedResult.getTransitionCost();
-    
+//    float score = computedResult.getViterbiCost() + future_delta;
+    float score = getHypothesis().getScore() + future_delta + phraseResult.getTransitionCost() + computedResult.getTransitionCost();
     return score;
   }
   


[03/50] [abbrv] incubator-joshua git commit: moved comparator into Candidate

Posted by mj...@apache.org.
moved comparator into Candidate


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/36cde50b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/36cde50b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/36cde50b

Branch: refs/heads/7
Commit: 36cde50ba37df9c9b2ead6b063ac5935e3dd253d
Parents: 16d5647
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sat Aug 20 08:30:42 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sat Aug 20 08:30:42 2016 -0500

----------------------------------------------------------------------
 .../apache/joshua/decoder/phrase/Candidate.java |  5 ++++
 .../decoder/phrase/CandidateComparator.java     | 28 --------------------
 .../org/apache/joshua/decoder/phrase/Stack.java |  2 +-
 3 files changed, 6 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/36cde50b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index 9c7b3d1..1342ea5 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@ -320,4 +320,9 @@ public class Candidate {
   public int getPhraseEnd() {
     return phrases.j;
   }
+
+  @Override
+  public int compareTo(Candidate other) {
+    return Float.compare(other.score(), score());
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/36cde50b/src/main/java/org/apache/joshua/decoder/phrase/CandidateComparator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/CandidateComparator.java b/src/main/java/org/apache/joshua/decoder/phrase/CandidateComparator.java
deleted file mode 100644
index 322f47a..0000000
--- a/src/main/java/org/apache/joshua/decoder/phrase/CandidateComparator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.joshua.decoder.phrase;
-
-import java.util.Comparator;
-
-public class CandidateComparator implements Comparator<Candidate> {
-  @Override
-  public int compare(Candidate one, Candidate another) {
-    return Float.compare(another.score(), one.score());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/36cde50b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Stack.java b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
index 3b8a976..67f62b6 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
@@ -65,7 +65,7 @@ public class Stack extends ArrayList<Hypothesis> {
     this.sentence = sentence;
     this.config = config;
     
-    this.candidates = new PriorityQueue<Candidate>(1, new CandidateComparator());
+    this.candidates = new PriorityQueue<Candidate>(1);
     this.coverages = new HashMap<Coverage, ArrayList<Hypothesis>>();
     this.visitedStates = new HashSet<Candidate>();
     this.deduper = new HashMap<Hypothesis,Hypothesis>();


[18/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/lm_oov/joshua.config
----------------------------------------------------------------------
diff --git a/resources/lm_oov/joshua.config b/resources/lm_oov/joshua.config
deleted file mode 100644
index 3ffb611..0000000
--- a/resources/lm_oov/joshua.config
+++ /dev/null
@@ -1,17 +0,0 @@
-feature-function = LanguageModel -lm_type berkeleylm -lm_order 5 -lm_file resources/berkeley_lm/lm -oov_feature
-
-tm = thrax -owner pt -maxspan 12 -path resources/kbest_extraction/grammar
-tm = thrax -owner glue -maxspan -1 -path resources/kbest_extraction/glue-grammar
-
-top-n = 0
-
-#feature_function = WordPenalty
-feature_function = OOVPenalty
-
-# Model Weights ####
-
-lm_0 0
-lm_0_oov 1
-OOVPenalty 1
-tm_pt_0 0
-tm_glue 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/config
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/config b/resources/phrase_decoder/config
deleted file mode 100644
index de781e3..0000000
--- a/resources/phrase_decoder/config
+++ /dev/null
@@ -1,29 +0,0 @@
-tm = moses -owner pt -maxspan 0 -path resources/phrase_decoder/rules.1.gz -max-source-len 5
-feature-function = StateMinimizingLanguageModel -lm_order 5 -lm_file resources/phrase_decoder/lm.1.gz
-
-search = stack
-
-mark-oovs = false
-pop-limit = 10
-top-n = 1
-
-output-format = %i ||| %s ||| %f ||| %c
-
-include-align-index = true
-reordering-limit = 6
-
-# And these are the feature functions to activate.
-feature-function = OOVPenalty
-feature-function = WordPenalty
-feature-function = Distortion
-feature-function = PhrasePenalty -owner pt
-
-OOVPenalty 1.0
-Distortion 0.114849
-WordPenalty -0.201544
-PhrasePenalty -0.236965
-tm_pt_0 0.0370068
-tm_pt_1 0.0495759
-tm_pt_2 0.196742
-tm_pt_3 0.0745423
-lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/constrained.config
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/constrained.config b/resources/phrase_decoder/constrained.config
deleted file mode 100644
index 4642650..0000000
--- a/resources/phrase_decoder/constrained.config
+++ /dev/null
@@ -1,28 +0,0 @@
-tm = moses pt 0 resources/phrase_decoder/rules.1.gz
-
-lm = kenlm 5 true false 100 resources/phrase_decoder/lm.1.gz
-
-mark-oovs = false
-pop-limit = 10
-top-n = 5
-
-output-format = %i ||| %s ||| %f ||| %c
-
-include-align-index = true
-reordering-limit = 10
-
-# And these are the feature functions to activate.
-feature-function = OOVPenalty
-feature-function = WordPenalty
-feature-function = Distortion
-feature-function = PhrasePenalty -owner pt
-
-OOVPenalty 1.0
-Distortion 0.114849
-WordPenalty -0.201544
-PhrasePenalty -0.236965
-tm_pt_0 0.0370068
-tm_pt_1 0.0495759
-tm_pt_2 0.196742
-tm_pt_3 0.0745423
-lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/constrained.output.gold
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/constrained.output.gold b/resources/phrase_decoder/constrained.output.gold
deleted file mode 100644
index 238387c..0000000
--- a/resources/phrase_decoder/constrained.output.gold
+++ /dev/null
@@ -1,5 +0,0 @@
-0 ||| President Obama |8-8| to |7-7| hinder |4-4| a strategy |0-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-15.792 tm_pt_1=-17.550 tm_pt_2=-14.599 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=7.000 ||| -15.163
-0 ||| President Obama |8-8| to |7-7| hinder |4-4| a |0-0| strategy |1-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.919 tm_pt_1=-17.550 tm_pt_2=-14.917 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=8.000 ||| -15.505
-0 ||| President Obama |8-8| to hinder |3-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-14.986 tm_pt_1=-17.951 tm_pt_2=-14.075 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=6.000 ||| -15.762
-0 ||| President Obama |8-8| to hinder |3-4| a |0-0| strategy |1-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.112 tm_pt_1=-17.951 tm_pt_2=-14.393 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.103
-0 ||| President Obama |8-8| to |3-3| hinder |4-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.329 tm_pt_1=-17.951 tm_pt_2=-15.136 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.257

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/lm.1.gz
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/lm.1.gz b/resources/phrase_decoder/lm.1.gz
deleted file mode 100644
index 3f4c453..0000000
Binary files a/resources/phrase_decoder/lm.1.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/output.gold
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/output.gold b/resources/phrase_decoder/output.gold
deleted file mode 100644
index 509a3de..0000000
--- a/resources/phrase_decoder/output.gold
+++ /dev/null
@@ -1 +0,0 @@
-0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/phrase_decoder/rules.1.gz
----------------------------------------------------------------------
diff --git a/resources/phrase_decoder/rules.1.gz b/resources/phrase_decoder/rules.1.gz
deleted file mode 100644
index 14466e9..0000000
Binary files a/resources/phrase_decoder/rules.1.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar
----------------------------------------------------------------------
diff --git a/resources/wa_grammar b/resources/wa_grammar
deleted file mode 100644
index 82d0052..0000000
--- a/resources/wa_grammar
+++ /dev/null
@@ -1,3 +0,0 @@
-[X] ||| A [X,1] B1 [X,2] B2 C ||| a b [X,2] c1 [X,1] c2 ||| 1 1 1 1 1 1 OOV=1 ||| 0-0 2-1 4-1 5-3 5-5
-[X] ||| U Z1 Z2 ||| n1 u z ||| 1 1 1 1 1 1 OOV=2 ||| 0-1 1-2 2-2
-[X] ||| K ||| k1 k2 k3 n1 n2 n3 ||| 1 1 1 1 1 1 OOV=4 ||| 0-0 0-1 0-2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/config
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/config b/resources/wa_grammar.packed/config
deleted file mode 100644
index fbc07d0..0000000
--- a/resources/wa_grammar.packed/config
+++ /dev/null
@@ -1,2 +0,0 @@
-max-source-len = 6
-version = 3

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/encoding
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/encoding b/resources/wa_grammar.packed/encoding
deleted file mode 100644
index 630f69f..0000000
Binary files a/resources/wa_grammar.packed/encoding and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/slice_00000.alignments
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/slice_00000.alignments b/resources/wa_grammar.packed/slice_00000.alignments
deleted file mode 100644
index f1425eb..0000000
Binary files a/resources/wa_grammar.packed/slice_00000.alignments and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/slice_00000.features
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/slice_00000.features b/resources/wa_grammar.packed/slice_00000.features
deleted file mode 100644
index 5a4c774..0000000
Binary files a/resources/wa_grammar.packed/slice_00000.features and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/slice_00000.source
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/slice_00000.source b/resources/wa_grammar.packed/slice_00000.source
deleted file mode 100644
index 4607b89..0000000
Binary files a/resources/wa_grammar.packed/slice_00000.source and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/slice_00000.target
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/slice_00000.target b/resources/wa_grammar.packed/slice_00000.target
deleted file mode 100644
index fe11a38..0000000
Binary files a/resources/wa_grammar.packed/slice_00000.target and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/slice_00000.target.lookup
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/slice_00000.target.lookup b/resources/wa_grammar.packed/slice_00000.target.lookup
deleted file mode 100644
index 7d82179..0000000
Binary files a/resources/wa_grammar.packed/slice_00000.target.lookup and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/wa_grammar.packed/vocabulary
----------------------------------------------------------------------
diff --git a/resources/wa_grammar.packed/vocabulary b/resources/wa_grammar.packed/vocabulary
deleted file mode 100644
index 637651e..0000000
Binary files a/resources/wa_grammar.packed/vocabulary and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
index 7752785..cbe6a7f 100644
--- a/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
+++ b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
@@ -33,7 +33,7 @@ public class LMBerkeleySentenceProbablityTest {
 
   @Test
   public void verifySentenceLogProbability() {
-    LMGrammarBerkeley grammar = new LMGrammarBerkeley(2, "resources/berkeley_lm/lm");
+    LMGrammarBerkeley grammar = new LMGrammarBerkeley(2, "src/test/resources/berkeley_lm/lm");
     grammar.registerWord("the", 2);
     grammar.registerWord("chat-rooms", 3);
     grammar.registerWord("<unk>", 0);
@@ -52,7 +52,7 @@ public class LMBerkeleySentenceProbablityTest {
   
   @Test
   public void givenUnknownWord_whenIsOov_thenCorrectlyDetected() {
-    LMGrammarBerkeley lm = new LMGrammarBerkeley(2, "resources/berkeley_lm/lm");
+    LMGrammarBerkeley lm = new LMGrammarBerkeley(2, "src/test/resources/berkeley_lm/lm");
     assertTrue(lm.isOov(Vocabulary.id("UNKNOWN_WORD")));
     assertFalse(lm.isOov(Vocabulary.id("chat-rooms")));
   }

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
index b0612d4..32c0762 100644
--- a/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
+++ b/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
@@ -44,10 +44,10 @@ public class LMGrammarBerkeleyTest {
 
   @DataProvider(name = "languageModelFiles")
   public Object[][] lmFiles() {
-    return new Object[][]{{"resources/berkeley_lm/lm"},
-            {"resources/berkeley_lm/lm.gz"},
-            {"resources/berkeley_lm/lm.berkeleylm"},
-            {"resources/berkeley_lm/lm.berkeleylm.gz"}};
+    return new Object[][]{{"src/test/resources/berkeley_lm/lm"},
+            {"src/test/resources/berkeley_lm/lm.gz"},
+            {"src/test/resources/berkeley_lm/lm.berkeleylm"},
+            {"src/test/resources/berkeley_lm/lm.berkeleylm.gz"}};
   }
 
   @AfterMethod
@@ -74,7 +74,7 @@ public class LMGrammarBerkeleyTest {
   public void givenLmWithOovFeature_whenDecoder_thenCorrectFeaturesReturned() {
     joshuaConfig = new JoshuaConfiguration();
     joshuaConfig.processCommandLineOptions(OPTIONS);
-    joshuaConfig.features.add("LanguageModel -lm_type berkeleylm -oov_feature -lm_order 2 -lm_file resources/berkeley_lm/lm");
+    joshuaConfig.features.add("LanguageModel -lm_type berkeleylm -oov_feature -lm_order 2 -lm_file src/test/resources/berkeley_lm/lm");
     decoder = new Decoder(joshuaConfig, null);
     final String translation = decode(INPUT).toString();
     assertEquals(Decoder.weights.getDenseFeatures().size(), 3);

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java b/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
index 5946abd..98a94f0 100644
--- a/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
+++ b/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
@@ -49,8 +49,8 @@ public class ClassBasedLanguageModelTest {
     FeatureVector weights = new FeatureVector();
     weights.set("lm_0", WEIGHT);
     String[] args = { "-lm_type", "kenlm", "-lm_order", "9",
-      "-lm_file", "./src/test/resources/lm/class_lm/class_lm_9gram.gz",
-      "-class_map", "./src/test/resources/lm/class_lm/class.map" };
+      "-lm_file", "src/test/resources/lm/class_lm/class_lm_9gram.gz",
+      "-class_map", "src/test/resources/lm/class_lm/class.map" };
 
     JoshuaConfiguration config = new JoshuaConfiguration();
     KenLmTestUtil.Guard(() -> ff = new LanguageModelFF(weights, args, config));

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java b/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
index 5b9db06..bc16a40 100644
--- a/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
+++ b/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
@@ -43,9 +43,9 @@ import static org.testng.Assert.assertEquals;
 
 public class KBestExtractionTest {
 
-  private static final String CONFIG = "resources/kbest_extraction/joshua.config";
+  private static final String CONFIG = "src/test/resources/kbest_extraction/joshua.config";
   private static final String INPUT = "a b c d e";
-  private static final Path GOLD_PATH = Paths.get("resources/kbest_extraction/output.scores.gold");
+  private static final Path GOLD_PATH = Paths.get("src/test/resources/kbest_extraction/output.scores.gold");
 
   private JoshuaConfiguration joshuaConfig = null;
   private Decoder decoder = null;

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
index 8be3c36..625fe0c 100644
--- a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
+++ b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
@@ -36,7 +36,7 @@ import org.testng.annotations.Test;
  */
 public class PhraseDecodingTest {
 
-  private static final String CONFIG = "resources/phrase_decoder/config";
+  private static final String CONFIG = "src/test/resources/phrase_decoder/config";
   private static final String INPUT = "una estrategia republicana para obstaculizar la reelecci�n de Obama";
   private static final String OUTPUT = "0 ||| a strategy republican to hinder reelection Obama ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";
   private static final String OUTPUT_WITH_ALIGNMENTS = "0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java b/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
index d6fc16d..69e5aa9 100644
--- a/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
+++ b/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
@@ -32,7 +32,7 @@ import org.testng.annotations.Test;
 
 public class LmOovFeatureTest {
 
-  private static final String CONFIG = "resources/lm_oov/joshua.config";
+  private static final String CONFIG = "src/test/resources/lm_oov/joshua.config";
   private static final String INPUT = "a chat-rooms full";
   // expecting 2 lm oovs ('a' & 'full') and 2 grammar OOVs ('chat-rooms' & 'full') and score -198.000
   private static final String EXPECTED_FEATURES = "tm_pt_0=-2.000 tm_glue_0=3.000 lm_0=-206.718 lm_0_oov=2.000 OOVPenalty=-200.000 | -198.000";

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java b/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
index 092dbc6..7b1c47f 100644
--- a/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
+++ b/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
@@ -60,8 +60,8 @@ public class MultithreadedTranslationTests {
     joshuaConfig.use_unique_nbest = false;
     joshuaConfig.include_align_index = false;
     joshuaConfig.topN = 0;
-    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar.packed");
-    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
+    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar.packed");
+    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
     joshuaConfig.goal_symbol = "[GOAL]";
     joshuaConfig.default_non_terminal = "[X]";
     joshuaConfig.features.add("OOVPenalty");

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/system/StructuredOutputTest.java b/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
index 2c9e0bd..051c163 100644
--- a/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
+++ b/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
@@ -62,8 +62,8 @@ public class StructuredOutputTest {
     joshuaConfig.use_unique_nbest = false;
     joshuaConfig.include_align_index = false;
     joshuaConfig.topN = 0;
-    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar");
-    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
+    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar");
+    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
     joshuaConfig.goal_symbol = "[GOAL]";
     joshuaConfig.default_non_terminal = "[X]";
     joshuaConfig.features.add("OOVPenalty");

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java b/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
index 4977d08..de95ded 100644
--- a/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
+++ b/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
@@ -81,8 +81,8 @@ public class StructuredTranslationTest {
     joshuaConfig.use_unique_nbest = false;
     joshuaConfig.include_align_index = false;
     joshuaConfig.topN = 0;
-    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar");
-    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
+    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar");
+    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
     joshuaConfig.goal_symbol = "[GOAL]";
     joshuaConfig.default_non_terminal = "[X]";
     joshuaConfig.features.add("OOVPenalty");

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/berkeley_lm/lm
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm b/src/test/resources/berkeley_lm/lm
new file mode 100644
index 0000000..05b4e6b
--- /dev/null
+++ b/src/test/resources/berkeley_lm/lm
@@ -0,0 +1,16 @@
+
+\data\
+ngram 1=5
+ngram 2=3
+
+\1-grams:
+-99.000000	<unk>
+-99.000000	<s>	-1.752754
+-2.034158	the	-0.800943
+-5.318589	chat-rooms	-0.151088
+-1.495702	</s>
+
+\2-grams:
+-1.773970	<s> the
+-4.878868	the chat-rooms
+-0.499794	chat-rooms </s>

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/berkeley_lm/lm.berkeleylm
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.berkeleylm b/src/test/resources/berkeley_lm/lm.berkeleylm
new file mode 100644
index 0000000..c048464
Binary files /dev/null and b/src/test/resources/berkeley_lm/lm.berkeleylm differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/berkeley_lm/lm.berkeleylm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.berkeleylm.gz b/src/test/resources/berkeley_lm/lm.berkeleylm.gz
new file mode 100644
index 0000000..f9f8d16
Binary files /dev/null and b/src/test/resources/berkeley_lm/lm.berkeleylm.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/berkeley_lm/lm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.gz b/src/test/resources/berkeley_lm/lm.gz
new file mode 100644
index 0000000..ae47266
Binary files /dev/null and b/src/test/resources/berkeley_lm/lm.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/grammar.glue
----------------------------------------------------------------------
diff --git a/src/test/resources/grammar.glue b/src/test/resources/grammar.glue
new file mode 100644
index 0000000..69e1520
--- /dev/null
+++ b/src/test/resources/grammar.glue
@@ -0,0 +1,4 @@
+[GOAL] ||| <s> ||| <s> ||| 0
+[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
+[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0
+[GOAL] ||| <s> [X,1] </s> ||| <s> [X,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/glue-grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/glue-grammar b/src/test/resources/kbest_extraction/glue-grammar
new file mode 100644
index 0000000..6a1162f
--- /dev/null
+++ b/src/test/resources/kbest_extraction/glue-grammar
@@ -0,0 +1,3 @@
+[GOAL] ||| <s> ||| <s> ||| 0
+[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
+[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/grammar b/src/test/resources/kbest_extraction/grammar
new file mode 100644
index 0000000..a03b2d9
--- /dev/null
+++ b/src/test/resources/kbest_extraction/grammar
@@ -0,0 +1,25 @@
+[X] ||| a ||| A ||| 2 
+[X] ||| a ||| B ||| 3
+[X] ||| a ||| C ||| 5
+[X] ||| a ||| D ||| 7
+[X] ||| a ||| E ||| 11
+[X] ||| b ||| A ||| 13
+[X] ||| b ||| B ||| 17
+[X] ||| b ||| C ||| 19
+[X] ||| b ||| D ||| 23
+[X] ||| b ||| E ||| 29
+[X] ||| c ||| A ||| 31
+[X] ||| c ||| B ||| 37
+[X] ||| c ||| C ||| 41
+[X] ||| c ||| D ||| 43
+[X] ||| c ||| E ||| 47
+[X] ||| d ||| A ||| 53
+[X] ||| d ||| B ||| 59
+[X] ||| d ||| C ||| 61
+[X] ||| d ||| D ||| 67
+[X] ||| d ||| E ||| 71
+[X] ||| e ||| A ||| 73
+[X] ||| e ||| B ||| 79
+[X] ||| e ||| C ||| 83
+[X] ||| e ||| D ||| 89
+[X] ||| e ||| E ||| 97

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/joshua.config
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/joshua.config b/src/test/resources/kbest_extraction/joshua.config
new file mode 100644
index 0000000..69ec9c9
--- /dev/null
+++ b/src/test/resources/kbest_extraction/joshua.config
@@ -0,0 +1,27 @@
+feature-function = StateMinimizingLanguageModel -lm_type kenlm -lm_order 5 -lm_file src/test/resources/kbest_extraction/lm.gz
+
+tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
+tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
+
+mark_oovs=false
+
+#tm config
+default_non_terminal=X
+goalSymbol=GOAL
+
+#pruning config
+pop-limit=100
+
+#nbest config
+use_unique_nbest=true
+top-n = 3126
+
+#feature_function = WordPenalty
+feature_function = OOVPenalty
+
+# Model Weights ####
+
+lm_0 1
+tm_pt_0 1
+tm_glue_0 1
+OOVPenalty 10000

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/lm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/lm.gz b/src/test/resources/kbest_extraction/lm.gz
new file mode 100644
index 0000000..a26335e
Binary files /dev/null and b/src/test/resources/kbest_extraction/lm.gz differ


[21/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
Moved test file locations from resources/ to src/test/resources


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/20e6bf4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/20e6bf4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/20e6bf4b

Branch: refs/heads/7
Commit: 20e6bf4b069d261718f819a72c9e9b2c62bcbb26
Parents: 2041a3f
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 17:03:53 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 17:03:53 2016 -0500

----------------------------------------------------------------------
 resources/berkeley_lm/lm                        |   16 -
 resources/berkeley_lm/lm.berkeleylm             |  Bin 4294 -> 0 bytes
 resources/berkeley_lm/lm.berkeleylm.gz          |  Bin 1786 -> 0 bytes
 resources/berkeley_lm/lm.gz                     |  Bin 162 -> 0 bytes
 resources/grammar.glue                          |    4 -
 resources/kbest_extraction/glue-grammar         |    3 -
 resources/kbest_extraction/grammar              |   25 -
 resources/kbest_extraction/joshua.config        |   27 -
 resources/kbest_extraction/lm.gz                |  Bin 2466496 -> 0 bytes
 resources/kbest_extraction/output.gold          | 3126 ------------------
 resources/kbest_extraction/output.scores.gold   | 3126 ------------------
 resources/kenlm/oilers.kenlm                    |  Bin 49011 -> 0 bytes
 resources/lm_oov/joshua.config                  |   17 -
 resources/phrase_decoder/config                 |   29 -
 resources/phrase_decoder/constrained.config     |   28 -
 .../phrase_decoder/constrained.output.gold      |    5 -
 resources/phrase_decoder/lm.1.gz                |  Bin 2235 -> 0 bytes
 resources/phrase_decoder/output.gold            |    1 -
 resources/phrase_decoder/rules.1.gz             |  Bin 2998042 -> 0 bytes
 resources/wa_grammar                            |    3 -
 resources/wa_grammar.packed/config              |    2 -
 resources/wa_grammar.packed/encoding            |  Bin 154 -> 0 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 45 -> 0 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 47 -> 0 bytes
 resources/wa_grammar.packed/slice_00000.source  |  Bin 204 -> 0 bytes
 resources/wa_grammar.packed/slice_00000.target  |  Bin 128 -> 0 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 32 -> 0 bytes
 resources/wa_grammar.packed/vocabulary          |  Bin 238 -> 0 bytes
 .../LMBerkeleySentenceProbablityTest.java       |    4 +-
 .../lm/berkeley_lm/LMGrammarBerkeleyTest.java   |   10 +-
 .../class_lm/ClassBasedLanguageModelTest.java   |    4 +-
 .../kbest_extraction/KBestExtractionTest.java   |    4 +-
 .../phrase/decode/PhraseDecodingTest.java       |    2 +-
 .../apache/joshua/system/LmOovFeatureTest.java  |    2 +-
 .../system/MultithreadedTranslationTests.java   |    4 +-
 .../joshua/system/StructuredOutputTest.java     |    4 +-
 .../system/StructuredTranslationTest.java       |    4 +-
 src/test/resources/berkeley_lm/lm               |   16 +
 src/test/resources/berkeley_lm/lm.berkeleylm    |  Bin 0 -> 4294 bytes
 src/test/resources/berkeley_lm/lm.berkeleylm.gz |  Bin 0 -> 1786 bytes
 src/test/resources/berkeley_lm/lm.gz            |  Bin 0 -> 162 bytes
 src/test/resources/grammar.glue                 |    4 +
 .../resources/kbest_extraction/glue-grammar     |    3 +
 src/test/resources/kbest_extraction/grammar     |   25 +
 .../resources/kbest_extraction/joshua.config    |   27 +
 src/test/resources/kbest_extraction/lm.gz       |  Bin 0 -> 2466496 bytes
 src/test/resources/kbest_extraction/output.gold | 3126 ++++++++++++++++++
 .../kbest_extraction/output.scores.gold         | 3126 ++++++++++++++++++
 src/test/resources/kenlm/oilers.kenlm           |  Bin 0 -> 49011 bytes
 src/test/resources/lm_oov/joshua.config         |   17 +
 src/test/resources/phrase_decoder/config        |   29 +
 .../resources/phrase_decoder/constrained.config |   28 +
 .../phrase_decoder/constrained.output.gold      |    5 +
 src/test/resources/phrase_decoder/lm.1.gz       |  Bin 0 -> 2235 bytes
 src/test/resources/phrase_decoder/output.gold   |    1 +
 src/test/resources/phrase_decoder/rules.1.gz    |  Bin 0 -> 2998042 bytes
 src/test/resources/wa_grammar                   |    3 +
 src/test/resources/wa_grammar.packed/config     |    2 +
 src/test/resources/wa_grammar.packed/encoding   |  Bin 0 -> 154 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 0 -> 45 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 0 -> 47 bytes
 .../wa_grammar.packed/slice_00000.source        |  Bin 0 -> 204 bytes
 .../wa_grammar.packed/slice_00000.target        |  Bin 0 -> 128 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 0 -> 32 bytes
 src/test/resources/wa_grammar.packed/vocabulary |  Bin 0 -> 238 bytes
 65 files changed, 6431 insertions(+), 6431 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/berkeley_lm/lm
----------------------------------------------------------------------
diff --git a/resources/berkeley_lm/lm b/resources/berkeley_lm/lm
deleted file mode 100644
index 05b4e6b..0000000
--- a/resources/berkeley_lm/lm
+++ /dev/null
@@ -1,16 +0,0 @@
-
-\data\
-ngram 1=5
-ngram 2=3
-
-\1-grams:
--99.000000	<unk>
--99.000000	<s>	-1.752754
--2.034158	the	-0.800943
--5.318589	chat-rooms	-0.151088
--1.495702	</s>
-
-\2-grams:
--1.773970	<s> the
--4.878868	the chat-rooms
--0.499794	chat-rooms </s>

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/berkeley_lm/lm.berkeleylm
----------------------------------------------------------------------
diff --git a/resources/berkeley_lm/lm.berkeleylm b/resources/berkeley_lm/lm.berkeleylm
deleted file mode 100644
index c048464..0000000
Binary files a/resources/berkeley_lm/lm.berkeleylm and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/berkeley_lm/lm.berkeleylm.gz
----------------------------------------------------------------------
diff --git a/resources/berkeley_lm/lm.berkeleylm.gz b/resources/berkeley_lm/lm.berkeleylm.gz
deleted file mode 100644
index f9f8d16..0000000
Binary files a/resources/berkeley_lm/lm.berkeleylm.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/berkeley_lm/lm.gz
----------------------------------------------------------------------
diff --git a/resources/berkeley_lm/lm.gz b/resources/berkeley_lm/lm.gz
deleted file mode 100644
index ae47266..0000000
Binary files a/resources/berkeley_lm/lm.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/grammar.glue
----------------------------------------------------------------------
diff --git a/resources/grammar.glue b/resources/grammar.glue
deleted file mode 100644
index 69e1520..0000000
--- a/resources/grammar.glue
+++ /dev/null
@@ -1,4 +0,0 @@
-[GOAL] ||| <s> ||| <s> ||| 0
-[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
-[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0
-[GOAL] ||| <s> [X,1] </s> ||| <s> [X,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/glue-grammar
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/glue-grammar b/resources/kbest_extraction/glue-grammar
deleted file mode 100644
index 6a1162f..0000000
--- a/resources/kbest_extraction/glue-grammar
+++ /dev/null
@@ -1,3 +0,0 @@
-[GOAL] ||| <s> ||| <s> ||| 0
-[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
-[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/grammar
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/grammar b/resources/kbest_extraction/grammar
deleted file mode 100644
index a03b2d9..0000000
--- a/resources/kbest_extraction/grammar
+++ /dev/null
@@ -1,25 +0,0 @@
-[X] ||| a ||| A ||| 2 
-[X] ||| a ||| B ||| 3
-[X] ||| a ||| C ||| 5
-[X] ||| a ||| D ||| 7
-[X] ||| a ||| E ||| 11
-[X] ||| b ||| A ||| 13
-[X] ||| b ||| B ||| 17
-[X] ||| b ||| C ||| 19
-[X] ||| b ||| D ||| 23
-[X] ||| b ||| E ||| 29
-[X] ||| c ||| A ||| 31
-[X] ||| c ||| B ||| 37
-[X] ||| c ||| C ||| 41
-[X] ||| c ||| D ||| 43
-[X] ||| c ||| E ||| 47
-[X] ||| d ||| A ||| 53
-[X] ||| d ||| B ||| 59
-[X] ||| d ||| C ||| 61
-[X] ||| d ||| D ||| 67
-[X] ||| d ||| E ||| 71
-[X] ||| e ||| A ||| 73
-[X] ||| e ||| B ||| 79
-[X] ||| e ||| C ||| 83
-[X] ||| e ||| D ||| 89
-[X] ||| e ||| E ||| 97

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/joshua.config
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/joshua.config b/resources/kbest_extraction/joshua.config
deleted file mode 100644
index cdab98e..0000000
--- a/resources/kbest_extraction/joshua.config
+++ /dev/null
@@ -1,27 +0,0 @@
-feature-function = StateMinimizingLanguageModel -lm_type kenlm -lm_order 5 -lm_file resources/kbest_extraction/lm.gz
-
-tm = thrax -owner pt -maxspan 12 -path resources/kbest_extraction/grammar
-tm = thrax -owner glue -maxspan -1 -path resources/kbest_extraction/glue-grammar
-
-mark_oovs=false
-
-#tm config
-default_non_terminal=X
-goalSymbol=GOAL
-
-#pruning config
-pop-limit=100
-
-#nbest config
-use_unique_nbest=true
-top-n = 3126
-
-#feature_function = WordPenalty
-feature_function = OOVPenalty
-
-# Model Weights ####
-
-lm_0 1
-tm_pt_0 1
-tm_glue_0 1
-OOVPenalty 10000

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/lm.gz
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/lm.gz b/resources/kbest_extraction/lm.gz
deleted file mode 100644
index a26335e..0000000
Binary files a/resources/kbest_extraction/lm.gz and /dev/null differ


[15/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/lm_oov/joshua.config
----------------------------------------------------------------------
diff --git a/src/test/resources/lm_oov/joshua.config b/src/test/resources/lm_oov/joshua.config
new file mode 100644
index 0000000..9cbd603
--- /dev/null
+++ b/src/test/resources/lm_oov/joshua.config
@@ -0,0 +1,17 @@
+feature-function = LanguageModel -lm_type berkeleylm -lm_order 5 -lm_file src/test/resources/berkeley_lm/lm -oov_feature
+
+tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
+tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
+
+top-n = 0
+
+#feature_function = WordPenalty
+feature_function = OOVPenalty
+
+# Model Weights ####
+
+lm_0 0
+lm_0_oov 1
+OOVPenalty 1
+tm_pt_0 0
+tm_glue 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/config
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/config b/src/test/resources/phrase_decoder/config
new file mode 100644
index 0000000..11e0108
--- /dev/null
+++ b/src/test/resources/phrase_decoder/config
@@ -0,0 +1,29 @@
+tm = moses -owner pt -maxspan 0 -path src/test/resources/phrase_decoder/rules.1.gz -max-source-len 5
+feature-function = StateMinimizingLanguageModel -lm_order 5 -lm_file src/test/resources/phrase_decoder/lm.1.gz
+
+search = stack
+
+mark-oovs = false
+pop-limit = 10
+top-n = 1
+
+output-format = %i ||| %s ||| %f ||| %c
+
+include-align-index = true
+reordering-limit = 6
+
+# And these are the feature functions to activate.
+feature-function = OOVPenalty
+feature-function = WordPenalty
+feature-function = Distortion
+feature-function = PhrasePenalty -owner pt
+
+OOVPenalty 1.0
+Distortion 0.114849
+WordPenalty -0.201544
+PhrasePenalty -0.236965
+tm_pt_0 0.0370068
+tm_pt_1 0.0495759
+tm_pt_2 0.196742
+tm_pt_3 0.0745423
+lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/constrained.config
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/constrained.config b/src/test/resources/phrase_decoder/constrained.config
new file mode 100644
index 0000000..ffa988c
--- /dev/null
+++ b/src/test/resources/phrase_decoder/constrained.config
@@ -0,0 +1,28 @@
+tm = moses pt 0 src/test/resources/phrase_decoder/rules.1.gz
+
+lm = kenlm 5 true false 100 src/test/resources/phrase_decoder/lm.1.gz
+
+mark-oovs = false
+pop-limit = 10
+top-n = 5
+
+output-format = %i ||| %s ||| %f ||| %c
+
+include-align-index = true
+reordering-limit = 10
+
+# And these are the feature functions to activate.
+feature-function = OOVPenalty
+feature-function = WordPenalty
+feature-function = Distortion
+feature-function = PhrasePenalty -owner pt
+
+OOVPenalty 1.0
+Distortion 0.114849
+WordPenalty -0.201544
+PhrasePenalty -0.236965
+tm_pt_0 0.0370068
+tm_pt_1 0.0495759
+tm_pt_2 0.196742
+tm_pt_3 0.0745423
+lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/constrained.output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/constrained.output.gold b/src/test/resources/phrase_decoder/constrained.output.gold
new file mode 100644
index 0000000..238387c
--- /dev/null
+++ b/src/test/resources/phrase_decoder/constrained.output.gold
@@ -0,0 +1,5 @@
+0 ||| President Obama |8-8| to |7-7| hinder |4-4| a strategy |0-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-15.792 tm_pt_1=-17.550 tm_pt_2=-14.599 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=7.000 ||| -15.163
+0 ||| President Obama |8-8| to |7-7| hinder |4-4| a |0-0| strategy |1-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.919 tm_pt_1=-17.550 tm_pt_2=-14.917 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=8.000 ||| -15.505
+0 ||| President Obama |8-8| to hinder |3-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-14.986 tm_pt_1=-17.951 tm_pt_2=-14.075 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=6.000 ||| -15.762
+0 ||| President Obama |8-8| to hinder |3-4| a |0-0| strategy |1-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.112 tm_pt_1=-17.951 tm_pt_2=-14.393 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.103
+0 ||| President Obama |8-8| to |3-3| hinder |4-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.329 tm_pt_1=-17.951 tm_pt_2=-15.136 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.257

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/lm.1.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/lm.1.gz b/src/test/resources/phrase_decoder/lm.1.gz
new file mode 100644
index 0000000..3f4c453
Binary files /dev/null and b/src/test/resources/phrase_decoder/lm.1.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/output.gold b/src/test/resources/phrase_decoder/output.gold
new file mode 100644
index 0000000..509a3de
--- /dev/null
+++ b/src/test/resources/phrase_decoder/output.gold
@@ -0,0 +1 @@
+0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/phrase_decoder/rules.1.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/rules.1.gz b/src/test/resources/phrase_decoder/rules.1.gz
new file mode 100644
index 0000000..14466e9
Binary files /dev/null and b/src/test/resources/phrase_decoder/rules.1.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar b/src/test/resources/wa_grammar
new file mode 100644
index 0000000..82d0052
--- /dev/null
+++ b/src/test/resources/wa_grammar
@@ -0,0 +1,3 @@
+[X] ||| A [X,1] B1 [X,2] B2 C ||| a b [X,2] c1 [X,1] c2 ||| 1 1 1 1 1 1 OOV=1 ||| 0-0 2-1 4-1 5-3 5-5
+[X] ||| U Z1 Z2 ||| n1 u z ||| 1 1 1 1 1 1 OOV=2 ||| 0-1 1-2 2-2
+[X] ||| K ||| k1 k2 k3 n1 n2 n3 ||| 1 1 1 1 1 1 OOV=4 ||| 0-0 0-1 0-2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/config
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/config b/src/test/resources/wa_grammar.packed/config
new file mode 100644
index 0000000..fbc07d0
--- /dev/null
+++ b/src/test/resources/wa_grammar.packed/config
@@ -0,0 +1,2 @@
+max-source-len = 6
+version = 3

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/encoding
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/encoding b/src/test/resources/wa_grammar.packed/encoding
new file mode 100644
index 0000000..630f69f
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/encoding differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/slice_00000.alignments
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.alignments b/src/test/resources/wa_grammar.packed/slice_00000.alignments
new file mode 100644
index 0000000..f1425eb
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/slice_00000.alignments differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/slice_00000.features
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.features b/src/test/resources/wa_grammar.packed/slice_00000.features
new file mode 100644
index 0000000..5a4c774
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/slice_00000.features differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/slice_00000.source
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.source b/src/test/resources/wa_grammar.packed/slice_00000.source
new file mode 100644
index 0000000..4607b89
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/slice_00000.source differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/slice_00000.target
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.target b/src/test/resources/wa_grammar.packed/slice_00000.target
new file mode 100644
index 0000000..fe11a38
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/slice_00000.target differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.target.lookup b/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
new file mode 100644
index 0000000..7d82179
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/slice_00000.target.lookup differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/wa_grammar.packed/vocabulary
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/vocabulary b/src/test/resources/wa_grammar.packed/vocabulary
new file mode 100644
index 0000000..637651e
Binary files /dev/null and b/src/test/resources/wa_grammar.packed/vocabulary differ


[44/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/lm_oov/joshua.config
----------------------------------------------------------------------
diff --git a/src/test/resources/lm_oov/joshua.config b/src/test/resources/lm_oov/joshua.config
deleted file mode 100644
index 9cbd603..0000000
--- a/src/test/resources/lm_oov/joshua.config
+++ /dev/null
@@ -1,17 +0,0 @@
-feature-function = LanguageModel -lm_type berkeleylm -lm_order 5 -lm_file src/test/resources/berkeley_lm/lm -oov_feature
-
-tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
-tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
-
-top-n = 0
-
-#feature_function = WordPenalty
-feature_function = OOVPenalty
-
-# Model Weights ####
-
-lm_0 0
-lm_0_oov 1
-OOVPenalty 1
-tm_pt_0 0
-tm_glue 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/config
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/config b/src/test/resources/phrase_decoder/config
deleted file mode 100644
index 11e0108..0000000
--- a/src/test/resources/phrase_decoder/config
+++ /dev/null
@@ -1,29 +0,0 @@
-tm = moses -owner pt -maxspan 0 -path src/test/resources/phrase_decoder/rules.1.gz -max-source-len 5
-feature-function = StateMinimizingLanguageModel -lm_order 5 -lm_file src/test/resources/phrase_decoder/lm.1.gz
-
-search = stack
-
-mark-oovs = false
-pop-limit = 10
-top-n = 1
-
-output-format = %i ||| %s ||| %f ||| %c
-
-include-align-index = true
-reordering-limit = 6
-
-# And these are the feature functions to activate.
-feature-function = OOVPenalty
-feature-function = WordPenalty
-feature-function = Distortion
-feature-function = PhrasePenalty -owner pt
-
-OOVPenalty 1.0
-Distortion 0.114849
-WordPenalty -0.201544
-PhrasePenalty -0.236965
-tm_pt_0 0.0370068
-tm_pt_1 0.0495759
-tm_pt_2 0.196742
-tm_pt_3 0.0745423
-lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/constrained.config
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/constrained.config b/src/test/resources/phrase_decoder/constrained.config
deleted file mode 100644
index ffa988c..0000000
--- a/src/test/resources/phrase_decoder/constrained.config
+++ /dev/null
@@ -1,28 +0,0 @@
-tm = moses pt 0 src/test/resources/phrase_decoder/rules.1.gz
-
-lm = kenlm 5 true false 100 src/test/resources/phrase_decoder/lm.1.gz
-
-mark-oovs = false
-pop-limit = 10
-top-n = 5
-
-output-format = %i ||| %s ||| %f ||| %c
-
-include-align-index = true
-reordering-limit = 10
-
-# And these are the feature functions to activate.
-feature-function = OOVPenalty
-feature-function = WordPenalty
-feature-function = Distortion
-feature-function = PhrasePenalty -owner pt
-
-OOVPenalty 1.0
-Distortion 0.114849
-WordPenalty -0.201544
-PhrasePenalty -0.236965
-tm_pt_0 0.0370068
-tm_pt_1 0.0495759
-tm_pt_2 0.196742
-tm_pt_3 0.0745423
-lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/constrained.output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/constrained.output.gold b/src/test/resources/phrase_decoder/constrained.output.gold
deleted file mode 100644
index 238387c..0000000
--- a/src/test/resources/phrase_decoder/constrained.output.gold
+++ /dev/null
@@ -1,5 +0,0 @@
-0 ||| President Obama |8-8| to |7-7| hinder |4-4| a strategy |0-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-15.792 tm_pt_1=-17.550 tm_pt_2=-14.599 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=7.000 ||| -15.163
-0 ||| President Obama |8-8| to |7-7| hinder |4-4| a |0-0| strategy |1-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.919 tm_pt_1=-17.550 tm_pt_2=-14.917 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=8.000 ||| -15.505
-0 ||| President Obama |8-8| to hinder |3-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-14.986 tm_pt_1=-17.951 tm_pt_2=-14.075 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=6.000 ||| -15.762
-0 ||| President Obama |8-8| to hinder |3-4| a |0-0| strategy |1-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.112 tm_pt_1=-17.951 tm_pt_2=-14.393 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.103
-0 ||| President Obama |8-8| to |3-3| hinder |4-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.329 tm_pt_1=-17.951 tm_pt_2=-15.136 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.257

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/lm.1.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/lm.1.gz b/src/test/resources/phrase_decoder/lm.1.gz
deleted file mode 100644
index 3f4c453..0000000
Binary files a/src/test/resources/phrase_decoder/lm.1.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/output.gold b/src/test/resources/phrase_decoder/output.gold
deleted file mode 100644
index 509a3de..0000000
--- a/src/test/resources/phrase_decoder/output.gold
+++ /dev/null
@@ -1 +0,0 @@
-0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/phrase_decoder/rules.1.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/phrase_decoder/rules.1.gz b/src/test/resources/phrase_decoder/rules.1.gz
deleted file mode 100644
index 14466e9..0000000
Binary files a/src/test/resources/phrase_decoder/rules.1.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar b/src/test/resources/wa_grammar
deleted file mode 100644
index 82d0052..0000000
--- a/src/test/resources/wa_grammar
+++ /dev/null
@@ -1,3 +0,0 @@
-[X] ||| A [X,1] B1 [X,2] B2 C ||| a b [X,2] c1 [X,1] c2 ||| 1 1 1 1 1 1 OOV=1 ||| 0-0 2-1 4-1 5-3 5-5
-[X] ||| U Z1 Z2 ||| n1 u z ||| 1 1 1 1 1 1 OOV=2 ||| 0-1 1-2 2-2
-[X] ||| K ||| k1 k2 k3 n1 n2 n3 ||| 1 1 1 1 1 1 OOV=4 ||| 0-0 0-1 0-2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/config
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/config b/src/test/resources/wa_grammar.packed/config
deleted file mode 100644
index fbc07d0..0000000
--- a/src/test/resources/wa_grammar.packed/config
+++ /dev/null
@@ -1,2 +0,0 @@
-max-source-len = 6
-version = 3

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/encoding
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/encoding b/src/test/resources/wa_grammar.packed/encoding
deleted file mode 100644
index 630f69f..0000000
Binary files a/src/test/resources/wa_grammar.packed/encoding and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/slice_00000.alignments
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.alignments b/src/test/resources/wa_grammar.packed/slice_00000.alignments
deleted file mode 100644
index f1425eb..0000000
Binary files a/src/test/resources/wa_grammar.packed/slice_00000.alignments and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/slice_00000.features
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.features b/src/test/resources/wa_grammar.packed/slice_00000.features
deleted file mode 100644
index 5a4c774..0000000
Binary files a/src/test/resources/wa_grammar.packed/slice_00000.features and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/slice_00000.source
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.source b/src/test/resources/wa_grammar.packed/slice_00000.source
deleted file mode 100644
index 4607b89..0000000
Binary files a/src/test/resources/wa_grammar.packed/slice_00000.source and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/slice_00000.target
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.target b/src/test/resources/wa_grammar.packed/slice_00000.target
deleted file mode 100644
index fe11a38..0000000
Binary files a/src/test/resources/wa_grammar.packed/slice_00000.target and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/slice_00000.target.lookup b/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
deleted file mode 100644
index 7d82179..0000000
Binary files a/src/test/resources/wa_grammar.packed/slice_00000.target.lookup and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/wa_grammar.packed/vocabulary
----------------------------------------------------------------------
diff --git a/src/test/resources/wa_grammar.packed/vocabulary b/src/test/resources/wa_grammar.packed/vocabulary
deleted file mode 100644
index 637651e..0000000
Binary files a/src/test/resources/wa_grammar.packed/vocabulary and /dev/null differ


[29/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/pro/PROCore.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/pro/PROCore.java
index 290000d,0000000..ec23e0a
mode 100755,000000..100755
--- a/joshua-core/src/main/java/org/apache/joshua/pro/PROCore.java
+++ b/joshua-core/src/main/java/org/apache/joshua/pro/PROCore.java
@@@ -1,3027 -1,0 +1,3027 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.pro;
 +
 +import java.io.BufferedReader;
 +import java.io.BufferedWriter;
 +import java.io.File;
 +import java.io.FileInputStream;
 +import java.io.FileNotFoundException;
 +import java.io.FileOutputStream;
 +import java.io.FileReader;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.InputStreamReader;
 +import java.io.OutputStream;
 +import java.io.OutputStreamWriter;
 +import java.io.PrintWriter;
 +import java.text.DecimalFormat;
 +import java.util.ArrayList;
 +import java.util.Date;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.Random;
 +import java.util.Scanner;
 +import java.util.TreeSet;
 +import java.util.Vector;
++import java.util.concurrent.ConcurrentHashMap;
 +import java.util.zip.GZIPInputStream;
 +import java.util.zip.GZIPOutputStream;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.metrics.EvaluationMetric;
 +import org.apache.joshua.util.StreamGobbler;
 +
- import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This code was originally written by Yuan Cao, who copied the MERT code to produce this file.
 + */
 +
 +public class PROCore {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(PROCore.class);
 +
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  private TreeSet<Integer>[] indicesOfInterest_all;
 +
 +  private final static DecimalFormat f4 = new DecimalFormat("###0.0000");
 +  private final Runtime myRuntime = Runtime.getRuntime();
 +
 +  private final static double NegInf = (-1.0 / 0.0);
 +  private final static double PosInf = (+1.0 / 0.0);
 +  private final static double epsilon = 1.0 / 1000000;
 +
 +  private int progress;
 +
 +  private int verbosity; // anything of priority <= verbosity will be printed
 +                         // (lower value for priority means more important)
 +
 +  private Random randGen;
 +  private int generatedRands;
 +
 +  private int numSentences;
 +  // number of sentences in the dev set
 +  // (aka the "MERT training" set)
 +
 +  private int numDocuments;
 +  // number of documents in the dev set
 +  // this should be 1, unless doing doc-level optimization
 +
 +  private int[] docOfSentence;
 +  // docOfSentence[i] stores which document contains the i'th sentence.
 +  // docOfSentence is 0-indexed, as are the documents (i.e. first doc is indexed 0)
 +
 +  private int[] docSubsetInfo;
 +  // stores information regarding which subset of the documents are evaluated
 +  // [0]: method (0-6)
 +  // [1]: first (1-indexed)
 +  // [2]: last (1-indexed)
 +  // [3]: size
 +  // [4]: center
 +  // [5]: arg1
 +  // [6]: arg2
 +  // [1-6] are 0 for method 0, [6] is 0 for methods 1-4 as well
 +  // only [1] and [2] are needed for optimization. The rest are only needed for an output message.
 +
 +  private int refsPerSen;
 +  // number of reference translations per sentence
 +
 +  private int textNormMethod;
 +  // 0: no normalization, 1: "NIST-style" tokenization, and also rejoin 'm, 're, *'s, 've, 'll, 'd,
 +  // and n't,
 +  // 2: apply 1 and also rejoin dashes between letters, 3: apply 1 and also drop non-ASCII
 +  // characters
 +  // 4: apply 1+2+3
 +
 +  private int numParams;
 +  // total number of firing features
 +  // this number may increase overtime as new n-best lists are decoded
 +  // initially it is equal to the # of params in the parameter config file
 +  private int numParamsOld;
 +  // number of features before observing the new features fired in the current iteration
 +
 +  private double[] normalizationOptions;
 +  // How should a lambda[] vector be normalized (before decoding)?
 +  // nO[0] = 0: no normalization
 +  // nO[0] = 1: scale so that parameter nO[2] has absolute value nO[1]
 +  // nO[0] = 2: scale so that the maximum absolute value is nO[1]
 +  // nO[0] = 3: scale so that the minimum absolute value is nO[1]
 +  // nO[0] = 4: scale so that the L-nO[1] norm equals nO[2]
 +
 +  /* *********************************************************** */
 +  /* NOTE: indexing starts at 1 in the following few arrays: */
 +  /* *********************************************************** */
 +
 +  // private double[] lambda;
 +  private ArrayList<Double> lambda = new ArrayList<Double>();
 +  // the current weight vector. NOTE: indexing starts at 1.
 +  private ArrayList<Double> bestLambda = new ArrayList<Double>();
 +  // the best weight vector across all iterations
 +
 +  private boolean[] isOptimizable;
 +  // isOptimizable[c] = true iff lambda[c] should be optimized
 +
 +  private double[] minRandValue;
 +  private double[] maxRandValue;
 +  // when choosing a random value for the lambda[c] parameter, it will be
 +  // chosen from the [minRandValue[c],maxRandValue[c]] range.
 +  // (*) minRandValue and maxRandValue must be real values, but not -Inf or +Inf
 +
 +  private double[] defaultLambda;
 +  // "default" parameter values; simply the values read in the parameter file
 +  // USED FOR NON-OPTIMIZABLE (FIXED) FEATURES
 +
 +  /* *********************************************************** */
 +  /* *********************************************************** */
 +
 +  private Decoder myDecoder;
 +  // COMMENT OUT if decoder is not Joshua
 +
 +  private String decoderCommand;
 +  // the command that runs the decoder; read from decoderCommandFileName
 +
 +  private int decVerbosity;
 +  // verbosity level for decoder output. If 0, decoder output is ignored.
 +  // If 1, decoder output is printed.
 +
 +  private int validDecoderExitValue;
 +  // return value from running the decoder command that indicates success
 +
 +  private int numOptThreads;
 +  // number of threads to run things in parallel
 +
 +  private int saveInterFiles;
 +  // 0: nothing, 1: only configs, 2: only n-bests, 3: both configs and n-bests
 +
 +  private int compressFiles;
 +  // should PRO gzip the large files? If 0, no compression takes place.
 +  // If 1, compression is performed on: decoder output files, temp sents files,
 +  // and temp feats files.
 +
 +  private int sizeOfNBest;
 +  // size of N-best list generated by decoder at each iteration
 +  // (aka simply N, but N is a bad variable name)
 +
 +  private long seed;
 +  // seed used to create random number generators
 +
 +  private boolean randInit;
 +  // if true, parameters are initialized randomly. If false, parameters
 +  // are initialized using values from parameter file.
 +
 +  private int maxMERTIterations, minMERTIterations, prevMERTIterations;
 +  // max: maximum number of MERT iterations
 +  // min: minimum number of MERT iterations before an early MERT exit
 +  // prev: number of previous MERT iterations from which to consider candidates (in addition to
 +  // the candidates from the current iteration)
 +
 +  private double stopSigValue;
 +  // early MERT exit if no weight changes by more than stopSigValue
 +  // (but see minMERTIterations above and stopMinIts below)
 +
 +  private int stopMinIts;
 +  // some early stopping criterion must be satisfied in stopMinIts *consecutive* iterations
 +  // before an early exit (but see minMERTIterations above)
 +
 +  private boolean oneModificationPerIteration;
 +  // if true, each MERT iteration performs at most one parameter modification.
 +  // If false, a new MERT iteration starts (i.e. a new N-best list is
 +  // generated) only after the previous iteration reaches a local maximum.
 +
 +  private String metricName;
 +  // name of evaluation metric optimized by MERT
 +
 +  private String metricName_display;
 +  // name of evaluation metric optimized by MERT, possibly with "doc-level " prefixed
 +
 +  private String[] metricOptions;
 +  // options for the evaluation metric (e.g. for BLEU, maxGramLength and effLengthMethod)
 +
 +  private EvaluationMetric evalMetric;
 +  // the evaluation metric used by MERT
 +
 +  private int suffStatsCount;
 +  // number of sufficient statistics for the evaluation metric
 +
 +  private String tmpDirPrefix;
 +  // prefix for the PRO.temp.* files
 +
 +  private boolean passIterationToDecoder;
 +  // should the iteration number be passed as an argument to decoderCommandFileName?
 +
 +  // used for pro
 +  private String classifierAlg; // the classification algorithm(percep, megam, maxent ...)
 +  private String[] classifierParams = null; // the param array for each classifier
 +  private int Tau;
 +  private int Xi;
 +  private double interCoef;
 +  private double metricDiff;
 +  private double prevMetricScore = 0; // final metric score of the previous iteration, used only
 +                                      // when returnBest = true
 +  private boolean returnBest = false; // return the best weight during tuning
 +
 +  private String dirPrefix; // where are all these files located?
 +  private String paramsFileName, docInfoFileName, finalLambdaFileName;
 +  private String sourceFileName, refFileName, decoderOutFileName;
 +  private String decoderConfigFileName, decoderCommandFileName;
 +  private String fakeFileNameTemplate, fakeFileNamePrefix, fakeFileNameSuffix;
 +
 +  // e.g. output.it[1-x].someOldRun would be specified as:
 +  // output.it?.someOldRun
 +  // and we'd have prefix = "output.it" and suffix = ".sameOldRun"
 +
 +  // private int useDisk;
 +
 +  public PROCore(JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +  }
 +
 +  public PROCore(String[] args, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    EvaluationMetric.set_knownMetrics();
 +    processArgsArray(args);
 +    initialize(0);
 +  }
 +
 +  public PROCore(String configFileName, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    EvaluationMetric.set_knownMetrics();
 +    processArgsArray(cfgFileToArgsArray(configFileName));
 +    initialize(0);
 +  }
 +
 +  private void initialize(int randsToSkip) {
 +    println("NegInf: " + NegInf + ", PosInf: " + PosInf + ", epsilon: " + epsilon, 4);
 +
 +    randGen = new Random(seed);
 +    for (int r = 1; r <= randsToSkip; ++r) {
 +      randGen.nextDouble();
 +    }
 +    generatedRands = randsToSkip;
 +
 +    if (randsToSkip == 0) {
 +      println("----------------------------------------------------", 1);
 +      println("Initializing...", 1);
 +      println("----------------------------------------------------", 1);
 +      println("", 1);
 +
 +      println("Random number generator initialized using seed: " + seed, 1);
 +      println("", 1);
 +    }
 +
 +    // COUNT THE TOTAL NUM OF SENTENCES TO BE DECODED, refFileName IS THE COMBINED REFERENCE FILE
 +    // NAME(AUTO GENERATED)
 +    numSentences = countLines(refFileName) / refsPerSen;
 +
 +    // ??
 +    processDocInfo();
 +    // sets numDocuments and docOfSentence[]
 +
 +    if (numDocuments > 1)
 +      metricName_display = "doc-level " + metricName;
 +
 +    // ??
 +    set_docSubsetInfo(docSubsetInfo);
 +
 +    // count the number of initial features
 +    numParams = countNonEmptyLines(paramsFileName) - 1;
 +    numParamsOld = numParams;
 +
 +    // read parameter config file
 +    try {
 +      // read dense parameter names
 +      BufferedReader inFile_names = new BufferedReader(new FileReader(paramsFileName));
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        String line = "";
 +        while (line != null && line.length() == 0) { // skip empty lines
 +          line = inFile_names.readLine();
 +        }
 +
 +        // save feature names
 +        String paramName = (line.substring(0, line.indexOf("|||"))).trim();
 +        Vocabulary.id(paramName);
 +        // System.err.println(String.format("VOCAB(%s) = %d", paramName, id));
 +      }
 +
 +      inFile_names.close();
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    // the parameter file contains one line per parameter
 +    // and one line for the normalization method
 +    // indexing starts at 1 in these arrays
 +    for (int p = 0; p <= numParams; ++p)
 +      lambda.add(new Double(0));
 +    bestLambda.add(new Double(0));
 +    // why only lambda is a list? because the size of lambda
 +    // may increase over time, but other arrays are specified in
 +    // the param config file, only used for initialization
 +    isOptimizable = new boolean[1 + numParams];
 +    minRandValue = new double[1 + numParams];
 +    maxRandValue = new double[1 + numParams];
 +    defaultLambda = new double[1 + numParams];
 +    normalizationOptions = new double[3];
 +
 +    // read initial param values
 +    processParamFile();
 +    // sets the arrays declared just above
 +
 +    // SentenceInfo.createV(); // uncomment ONLY IF using vocabulary implementation of SentenceInfo
 +
 +    String[][] refSentences = new String[numSentences][refsPerSen];
 +
 +    try {
 +
 +      // read in reference sentences
 +      InputStream inStream_refs = new FileInputStream(new File(refFileName));
 +      BufferedReader inFile_refs = new BufferedReader(new InputStreamReader(inStream_refs, "utf8"));
 +
 +      for (int i = 0; i < numSentences; ++i) {
 +        for (int r = 0; r < refsPerSen; ++r) {
 +          // read the rth reference translation for the ith sentence
 +          refSentences[i][r] = inFile_refs.readLine();
 +        }
 +      }
 +
 +      inFile_refs.close();
 +
 +      // normalize reference sentences
 +      for (int i = 0; i < numSentences; ++i) {
 +        for (int r = 0; r < refsPerSen; ++r) {
 +          // normalize the rth reference translation for the ith sentence
 +          refSentences[i][r] = normalize(refSentences[i][r], textNormMethod);
 +        }
 +      }
 +
 +      // read in decoder command, if any
 +      decoderCommand = null;
 +      if (decoderCommandFileName != null) {
 +        if (fileExists(decoderCommandFileName)) {
 +          BufferedReader inFile_comm = new BufferedReader(new FileReader(decoderCommandFileName));
 +          decoderCommand = inFile_comm.readLine(); // READ IN DECODE COMMAND
 +          inFile_comm.close();
 +        }
 +      }
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    // set static data members for the EvaluationMetric class
 +    EvaluationMetric.set_numSentences(numSentences);
 +    EvaluationMetric.set_numDocuments(numDocuments);
 +    EvaluationMetric.set_refsPerSen(refsPerSen);
 +    EvaluationMetric.set_refSentences(refSentences);
 +    EvaluationMetric.set_tmpDirPrefix(tmpDirPrefix);
 +
 +    evalMetric = EvaluationMetric.getMetric(metricName, metricOptions);
 +    // used only if returnBest = true
 +    prevMetricScore = evalMetric.getToBeMinimized() ? PosInf : NegInf;
 +
 +    // length of sufficient statistics
 +    // for bleu: suffstatscount=8 (2*ngram+2)
 +    suffStatsCount = evalMetric.get_suffStatsCount();
 +
 +    // set static data members for the IntermediateOptimizer class
 +    /*
 +     * IntermediateOptimizer.set_MERTparams(numSentences, numDocuments, docOfSentence,
 +     * docSubsetInfo, numParams, normalizationOptions, isOptimizable oneModificationPerIteration,
 +     * evalMetric, tmpDirPrefix, verbosity);
 +     */
 +
 +    // print info
 +    if (randsToSkip == 0) { // i.e. first iteration
 +      println("Number of sentences: " + numSentences, 1);
 +      println("Number of documents: " + numDocuments, 1);
 +      println("Optimizing " + metricName_display, 1);
 +
 +      /*
 +       * print("docSubsetInfo: {", 1); for (int f = 0; f < 6; ++f) print(docSubsetInfo[f] + ", ",
 +       * 1); println(docSubsetInfo[6] + "}", 1);
 +       */
 +
 +      println("Number of initial features: " + numParams, 1);
 +      print("Initial feature names: {", 1);
 +
 +      for (int c = 1; c <= numParams; ++c)
 +        print("\"" + Vocabulary.word(c) + "\"", 1);
 +      println("}", 1);
 +      println("", 1);
 +
 +      // TODO just print the correct info
 +      println("c    Default value\tOptimizable?\tRand. val. range", 1);
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        print(c + "     " + f4.format(lambda.get(c).doubleValue()) + "\t\t", 1);
 +
 +        if (!isOptimizable[c]) {
 +          println(" No", 1);
 +        } else {
 +          print(" Yes\t\t", 1);
 +          print(" [" + minRandValue[c] + "," + maxRandValue[c] + "]", 1);
 +          println("", 1);
 +        }
 +      }
 +
 +      println("", 1);
 +      print("Weight vector normalization method: ", 1);
 +      if (normalizationOptions[0] == 0) {
 +        println("none.", 1);
 +      } else if (normalizationOptions[0] == 1) {
 +        println(
 +            "weights will be scaled so that the \""
 +                + Vocabulary.word((int) normalizationOptions[2])
 +                + "\" weight has an absolute value of " + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 2) {
 +        println("weights will be scaled so that the maximum absolute value is "
 +            + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 3) {
 +        println("weights will be scaled so that the minimum absolute value is "
 +            + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 4) {
 +        println("weights will be scaled so that the L-" + normalizationOptions[1] + " norm is "
 +            + normalizationOptions[2] + ".", 1);
 +      }
 +
 +      println("", 1);
 +
 +      println("----------------------------------------------------", 1);
 +      println("", 1);
 +
 +      // rename original config file so it doesn't get overwritten
 +      // (original name will be restored in finish())
 +      renameFile(decoderConfigFileName, decoderConfigFileName + ".PRO.orig");
 +    } // if (randsToSkip == 0)
 +
 +    // by default, load joshua decoder
 +    if (decoderCommand == null && fakeFileNameTemplate == null) {
 +      println("Loading Joshua decoder...", 1);
 +      myDecoder = new Decoder(joshuaConfiguration, decoderConfigFileName + ".PRO.orig");
 +      println("...finished loading @ " + (new Date()), 1);
 +      println("");
 +    } else {
 +      myDecoder = null;
 +    }
 +
 +    @SuppressWarnings("unchecked")
 +    TreeSet<Integer>[] temp_TSA = new TreeSet[numSentences];
 +    indicesOfInterest_all = temp_TSA;
 +
 +    for (int i = 0; i < numSentences; ++i) {
 +      indicesOfInterest_all[i] = new TreeSet<Integer>();
 +    }
 +  } // void initialize(...)
 +
 +  // -------------------------
 +
 +  public void run_PRO() {
 +    run_PRO(minMERTIterations, maxMERTIterations, prevMERTIterations);
 +  }
 +
 +  public void run_PRO(int minIts, int maxIts, int prevIts) {
 +    // FIRST, CLEAN ALL PREVIOUS TEMP FILES
 +    String dir;
 +    int k = tmpDirPrefix.lastIndexOf("/");
 +    if (k >= 0) {
 +      dir = tmpDirPrefix.substring(0, k + 1);
 +    } else {
 +      dir = "./";
 +    }
 +    String files;
 +    File folder = new File(dir);
 +
 +    if (folder.exists()) {
 +      File[] listOfFiles = folder.listFiles();
 +
 +      for (int i = 0; i < listOfFiles.length; i++) {
 +        if (listOfFiles[i].isFile()) {
 +          files = listOfFiles[i].getName();
 +          if (files.startsWith("PRO.temp")) {
 +            deleteFile(files);
 +          }
 +        }
 +      }
 +    }
 +
 +    println("----------------------------------------------------", 1);
 +    println("PRO run started @ " + (new Date()), 1);
 +    // printMemoryUsage();
 +    println("----------------------------------------------------", 1);
 +    println("", 1);
 +
 +    // if no default lambda is provided
 +    if (randInit) {
 +      println("Initializing lambda[] randomly.", 1);
 +      // initialize optimizable parameters randomly (sampling uniformly from
 +      // that parameter's random value range)
 +      lambda = randomLambda();
 +    }
 +
 +    println("Initial lambda[]: " + lambdaToString(lambda), 1);
 +    println("", 1);
 +
 +    int[] maxIndex = new int[numSentences];
 +
 +    // HashMap<Integer,int[]>[] suffStats_array = new HashMap[numSentences];
 +    // suffStats_array[i] maps candidates of interest for sentence i to an array
 +    // storing the sufficient statistics for that candidate
 +
 +    int earlyStop = 0;
 +    // number of consecutive iteration an early stopping criterion was satisfied
 +
 +    for (int iteration = 1;; ++iteration) {
 +
 +      // what does "A" contain?
 +      // retA[0]: FINAL_score
 +      // retA[1]: earlyStop
 +      // retA[2]: should this be the last iteration?
 +      double[] A = run_single_iteration(iteration, minIts, maxIts, prevIts, earlyStop, maxIndex);
 +      if (A != null) {
 +        earlyStop = (int) A[1];
 +        if (A[2] == 1)
 +          break;
 +      } else {
 +        break;
 +      }
 +
 +    } // for (iteration)
 +
 +    println("", 1);
 +
 +    println("----------------------------------------------------", 1);
 +    println("PRO run ended @ " + (new Date()), 1);
 +    // printMemoryUsage();
 +    println("----------------------------------------------------", 1);
 +    println("", 1);
 +
 +    if (!returnBest)
 +      println("FINAL lambda: " + lambdaToString(lambda), 1);
 +    // + " (" + metricName_display + ": " + FINAL_score + ")",1);
 +    else
 +      println("BEST lambda: " + lambdaToString(lambda), 1);
 +    // + " (" + metricName_display + ": " + FINAL_score + ")",1);
 +
 +    // delete intermediate .temp.*.it* decoder output files
 +    for (int iteration = 1; iteration <= maxIts; ++iteration) {
 +      if (compressFiles == 1) {
 +        deleteFile(tmpDirPrefix + "temp.sents.it" + iteration + ".gz");
 +        deleteFile(tmpDirPrefix + "temp.feats.it" + iteration + ".gz");
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".copy.gz")) {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".copy.gz");
 +        } else {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".gz");
 +        }
 +      } else {
 +        deleteFile(tmpDirPrefix + "temp.sents.it" + iteration);
 +        deleteFile(tmpDirPrefix + "temp.feats.it" + iteration);
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".copy")) {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".copy");
 +        } else {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +      }
 +    }
 +  } // void run_PRO(int maxIts)
 +
 +  // this is the key function!
 +  @SuppressWarnings("unchecked")
 +  public double[] run_single_iteration(int iteration, int minIts, int maxIts, int prevIts,
 +      int earlyStop, int[] maxIndex) {
 +    double FINAL_score = 0;
 +
 +    double[] retA = new double[3];
 +    // retA[0]: FINAL_score
 +    // retA[1]: earlyStop
 +    // retA[2]: should this be the last iteration?
 +
 +    boolean done = false;
 +    retA[2] = 1; // will only be made 0 if we don't break from the following loop
 +
 +    // save feats and stats for all candidates(old & new)
 +    HashMap<String, String>[] feat_hash = new HashMap[numSentences];
 +    for (int i = 0; i < numSentences; i++)
 +      feat_hash[i] = new HashMap<String, String>();
 +
 +    HashMap<String, String>[] stats_hash = new HashMap[numSentences];
 +    for (int i = 0; i < numSentences; i++)
 +      stats_hash[i] = new HashMap<String, String>();
 +
 +    while (!done) { // NOTE: this "loop" will only be carried out once
 +      println("--- Starting PRO iteration #" + iteration + " @ " + (new Date()) + " ---", 1);
 +
 +      // printMemoryUsage();
 +
 +      /******************************/
 +      // CREATE DECODER CONFIG FILE //
 +      /******************************/
 +
 +      createConfigFile(lambda, decoderConfigFileName, decoderConfigFileName + ".PRO.orig");
 +      // i.e. use the original config file as a template
 +
 +      /***************/
 +      // RUN DECODER //
 +      /***************/
 +
 +      if (iteration == 1) {
 +        println("Decoding using initial weight vector " + lambdaToString(lambda), 1);
 +      } else {
 +        println("Redecoding using weight vector " + lambdaToString(lambda), 1);
 +      }
 +
 +      // generate the n-best file after decoding
 +      String[] decRunResult = run_decoder(iteration); // iteration passed in case fake decoder will
 +                                                      // be used
 +      // [0] name of file to be processed
 +      // [1] indicates how the output file was obtained:
 +      // 1: external decoder
 +      // 2: fake decoder
 +      // 3: internal decoder
 +
 +      if (!decRunResult[1].equals("2")) {
 +        println("...finished decoding @ " + (new Date()), 1);
 +      }
 +
 +      checkFile(decRunResult[0]);
 +
 +      /************* END OF DECODING **************/
 +
 +      println("Producing temp files for iteration " + iteration, 3);
 +
 +      produceTempFiles(decRunResult[0], iteration);
 +
 +      // save intermedidate output files
 +      // save joshua.config.pro.it*
 +      if (saveInterFiles == 1 || saveInterFiles == 3) { // make copy of intermediate config file
 +        if (!copyFile(decoderConfigFileName, decoderConfigFileName + ".PRO.it" + iteration)) {
 +          println("Warning: attempt to make copy of decoder config file (to create"
 +              + decoderConfigFileName + ".PRO.it" + iteration + ") was unsuccessful!", 1);
 +        }
 +      }
 +
 +      // save output.nest.PRO.it*
 +      if (saveInterFiles == 2 || saveInterFiles == 3) { // make copy of intermediate decoder output
 +                                                        // file...
 +
 +        if (!decRunResult[1].equals("2")) { // ...but only if no fake decoder
 +          if (!decRunResult[0].endsWith(".gz")) {
 +            if (!copyFile(decRunResult[0], decRunResult[0] + ".PRO.it" + iteration)) {
 +              println("Warning: attempt to make copy of decoder output file (to create"
 +                  + decRunResult[0] + ".PRO.it" + iteration + ") was unsuccessful!", 1);
 +            }
 +          } else {
 +            String prefix = decRunResult[0].substring(0, decRunResult[0].length() - 3);
 +            if (!copyFile(prefix + ".gz", prefix + ".PRO.it" + iteration + ".gz")) {
 +              println("Warning: attempt to make copy of decoder output file (to create" + prefix
 +                  + ".PRO.it" + iteration + ".gz" + ") was unsuccessful!", 1);
 +            }
 +          }
 +
 +          if (compressFiles == 1 && !decRunResult[0].endsWith(".gz")) {
 +            gzipFile(decRunResult[0] + ".PRO.it" + iteration);
 +          }
 +        } // if (!fake)
 +      }
 +
 +      // ------------- end of saving .pro.it* files ---------------
 +
 +      int[] candCount = new int[numSentences];
 +      int[] lastUsedIndex = new int[numSentences];
 +
 +      ConcurrentHashMap[] suffStats_array = new ConcurrentHashMap[numSentences];
 +      for (int i = 0; i < numSentences; ++i) {
 +        candCount[i] = 0;
 +        lastUsedIndex[i] = -1;
 +        // suffStats_array[i].clear();
-         suffStats_array[i] = new ConcurrentHashMap();
++        suffStats_array[i] = new ConcurrentHashMap<>();
 +      }
 +
 +      // initLambda[0] is not used!
 +      double[] initialLambda = new double[1 + numParams];
 +      for (int i = 1; i <= numParams; ++i)
 +        initialLambda[i] = lambda.get(i);
 +
 +      // the "score" in initialScore refers to that
 +      // assigned by the evaluation metric)
 +
 +      // you may consider all candidates from iter 1, or from iter (iteration-prevIts) to current
 +      // iteration
 +      int firstIt = Math.max(1, iteration - prevIts);
 +      // i.e. only process candidates from the current iteration and candidates
 +      // from up to prevIts previous iterations.
 +      println("Reading candidate translations from iterations " + firstIt + "-" + iteration, 1);
 +      println("(and computing " + metricName
 +          + " sufficient statistics for previously unseen candidates)", 1);
 +      print("  Progress: ");
 +
 +      int[] newCandidatesAdded = new int[1 + iteration];
 +      for (int it = 1; it <= iteration; ++it)
 +        newCandidatesAdded[it] = 0;
 +
 +      try {
 +        // read temp files from all past iterations
 +        // 3 types of temp files:
 +        // 1. output hypo at iter i
 +        // 2. feature value of each hypo at iter i
 +        // 3. suff stats of each hypo at iter i
 +
 +        // each inFile corresponds to the output of an iteration
 +        // (index 0 is not used; no corresponding index for the current iteration)
 +        BufferedReader[] inFile_sents = new BufferedReader[iteration];
 +        BufferedReader[] inFile_feats = new BufferedReader[iteration];
 +        BufferedReader[] inFile_stats = new BufferedReader[iteration];
 +
 +        // temp file(array) from previous iterations
 +        for (int it = firstIt; it < iteration; ++it) {
 +          InputStream inStream_sents, inStream_feats, inStream_stats;
 +          if (compressFiles == 0) {
 +            inStream_sents = new FileInputStream(tmpDirPrefix + "temp.sents.it" + it);
 +            inStream_feats = new FileInputStream(tmpDirPrefix + "temp.feats.it" + it);
 +            inStream_stats = new FileInputStream(tmpDirPrefix + "temp.stats.it" + it);
 +          } else {
 +            inStream_sents = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.sents.it"
 +                + it + ".gz"));
 +            inStream_feats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.feats.it"
 +                + it + ".gz"));
 +            inStream_stats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.stats.it"
 +                + it + ".gz"));
 +          }
 +
 +          inFile_sents[it] = new BufferedReader(new InputStreamReader(inStream_sents, "utf8"));
 +          inFile_feats[it] = new BufferedReader(new InputStreamReader(inStream_feats, "utf8"));
 +          inFile_stats[it] = new BufferedReader(new InputStreamReader(inStream_stats, "utf8"));
 +        }
 +
 +        InputStream inStream_sentsCurrIt, inStream_featsCurrIt, inStream_statsCurrIt;
 +        // temp file for current iteration!
 +        if (compressFiles == 0) {
 +          inStream_sentsCurrIt = new FileInputStream(tmpDirPrefix + "temp.sents.it" + iteration);
 +          inStream_featsCurrIt = new FileInputStream(tmpDirPrefix + "temp.feats.it" + iteration);
 +        } else {
 +          inStream_sentsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.sents.it" + iteration + ".gz"));
 +          inStream_featsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.feats.it" + iteration + ".gz"));
 +        }
 +
 +        BufferedReader inFile_sentsCurrIt = new BufferedReader(new InputStreamReader(
 +            inStream_sentsCurrIt, "utf8"));
 +        BufferedReader inFile_featsCurrIt = new BufferedReader(new InputStreamReader(
 +            inStream_featsCurrIt, "utf8"));
 +
 +        BufferedReader inFile_statsCurrIt = null; // will only be used if statsCurrIt_exists below
 +                                                  // is set to true
 +        PrintWriter outFile_statsCurrIt = null; // will only be used if statsCurrIt_exists below is
 +                                                // set to false
 +
 +        // just to check if temp.stat.it.iteration exists
 +        boolean statsCurrIt_exists = false;
 +
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration)) {
 +          inStream_statsCurrIt = new FileInputStream(tmpDirPrefix + "temp.stats.it" + iteration);
 +          inFile_statsCurrIt = new BufferedReader(new InputStreamReader(inStream_statsCurrIt,
 +              "utf8"));
 +          statsCurrIt_exists = true;
 +          copyFile(tmpDirPrefix + "temp.stats.it" + iteration, tmpDirPrefix + "temp.stats.it"
 +              + iteration + ".copy");
 +        } else if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".gz")) {
 +          inStream_statsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.stats.it" + iteration + ".gz"));
 +          inFile_statsCurrIt = new BufferedReader(new InputStreamReader(inStream_statsCurrIt,
 +              "utf8"));
 +          statsCurrIt_exists = true;
 +          copyFile(tmpDirPrefix + "temp.stats.it" + iteration + ".gz", tmpDirPrefix
 +              + "temp.stats.it" + iteration + ".copy.gz");
 +        } else {
 +          outFile_statsCurrIt = new PrintWriter(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +
 +        // output the 4^th temp file: *.temp.stats.merged
 +        PrintWriter outFile_statsMerged = new PrintWriter(tmpDirPrefix + "temp.stats.merged");
 +        // write sufficient statistics from all the sentences
 +        // from the output files into a single file
 +        PrintWriter outFile_statsMergedKnown = new PrintWriter(tmpDirPrefix
 +            + "temp.stats.mergedKnown");
 +        // write sufficient statistics from all the sentences
 +        // from the output files into a single file
 +
 +        // output the 5^th 6^th temp file, but will be deleted at the end of the function
 +        FileOutputStream outStream_unknownCands = new FileOutputStream(tmpDirPrefix
 +            + "temp.currIt.unknownCands", false);
 +        OutputStreamWriter outStreamWriter_unknownCands = new OutputStreamWriter(
 +            outStream_unknownCands, "utf8");
 +        BufferedWriter outFile_unknownCands = new BufferedWriter(outStreamWriter_unknownCands);
 +
 +        PrintWriter outFile_unknownIndices = new PrintWriter(tmpDirPrefix
 +            + "temp.currIt.unknownIndices");
 +
 +        String sents_str, feats_str, stats_str;
 +
 +        // BUG: this assumes a candidate string cannot be produced for two
 +        // different source sentences, which is not necessarily true
 +        // (It's not actually a bug, but only because existingCandStats gets
 +        // cleared before moving to the next source sentence.)
 +        // FIX: should be made an array, indexed by i
 +        HashMap<String, String> existingCandStats = new HashMap<String, String>();
 +        // VERY IMPORTANT:
 +        // A CANDIDATE X MAY APPEARED IN ITER 1, ITER 3
 +        // BUT IF THE USER SPECIFIED TO CONSIDER ITERATIONS FROM ONLY ITER 2, THEN
 +        // X IS NOT A "REPEATED" CANDIDATE IN ITER 3. THEREFORE WE WANT TO KEEP THE
 +        // SUFF STATS FOR EACH CANDIDATE(TO SAVE COMPUTATION IN THE FUTURE)
 +
 +        // Stores precalculated sufficient statistics for candidates, in case
 +        // the same candidate is seen again. (SS stored as a String.)
 +        // Q: Why do we care? If we see the same candidate again, aren't we going
 +        // to ignore it? So, why do we care about the SS of this repeat candidate?
 +        // A: A "repeat" candidate may not be a repeat candidate in later
 +        // iterations if the user specifies a value for prevMERTIterations
 +        // that causes MERT to skip candidates from early iterations.
 +
 +        String[] featVal_str;
 +
 +        int totalCandidateCount = 0;
 +
 +        // new candidate size for each sentence
 +        int[] sizeUnknown_currIt = new int[numSentences];
 +
 +        for (int i = 0; i < numSentences; ++i) {
 +          // process candidates from previous iterations
 +          // low efficiency? for each iteration, it reads in all previous iteration outputs
 +          // therefore a lot of overlapping jobs
 +          // this is an easy implementation to deal with the situation in which user only specified
 +          // "previt" and hopes to consider only the previous previt
 +          // iterations, then for each iteration the existing candadites will be different
 +          for (int it = firstIt; it < iteration; ++it) {
 +            // Why up to but *excluding* iteration?
 +            // Because the last iteration is handled a little differently, since
 +            // the SS must be calculated (and the corresponding file created),
 +            // which is not true for previous iterations.
 +
 +            for (int n = 0; n <= sizeOfNBest; ++n) {
 +              // note that in all temp files, "||||||" is a separator between 2 n-best lists
 +
 +              // Why up to and *including* sizeOfNBest?
 +              // So that it would read the "||||||" separator even if there is
 +              // a complete list of sizeOfNBest candidates.
 +
 +              // for the nth candidate for the ith sentence, read the sentence, feature values,
 +              // and sufficient statistics from the various temp files
 +
 +              // read one line of temp.sent, temp.feat, temp.stats from iteration it
 +              sents_str = inFile_sents[it].readLine();
 +              feats_str = inFile_feats[it].readLine();
 +              stats_str = inFile_stats[it].readLine();
 +
 +              if (sents_str.equals("||||||")) {
 +                n = sizeOfNBest + 1; // move on to the next n-best list
 +              } else if (!existingCandStats.containsKey(sents_str)) // if this candidate does not
 +                                                                    // exist
 +              {
 +                outFile_statsMergedKnown.println(stats_str);
 +
 +                // save feats & stats
 +                feat_hash[i].put(sents_str, feats_str);
 +                stats_hash[i].put(sents_str, stats_str);
 +
 +                // extract feature value
 +                featVal_str = feats_str.split("\\s+");
 +
 +                if (feats_str.indexOf('=') != -1) {
 +                  for (String featurePair : featVal_str) {
 +                    String[] pair = featurePair.split("=");
 +                    String name = pair[0];
 +                    Double value = Double.parseDouble(pair[1]);
 +                    int featId = Vocabulary.id(name);
 +                    // need to identify newly fired feats here
 +                    if (featId > numParams) {
 +                      ++numParams;
 +                      lambda.add(new Double(0));
 +                    }
 +                  }
 +                }
 +                existingCandStats.put(sents_str, stats_str);
 +                candCount[i] += 1;
 +                newCandidatesAdded[it] += 1;
 +              } // if unseen candidate
 +            } // for (n)
 +          } // for (it)
 +
 +          outFile_statsMergedKnown.println("||||||");
 +
 +          // ---------- end of processing previous iterations ----------
 +          // ---------- now start processing new candidates ----------
 +
 +          // now process the candidates of the current iteration
 +          // now determine the new candidates of the current iteration
 +
 +          /*
 +           * remember: BufferedReader inFile_sentsCurrIt BufferedReader inFile_featsCurrIt
 +           * PrintWriter outFile_statsCurrIt
 +           */
 +
 +          String[] sentsCurrIt_currSrcSent = new String[sizeOfNBest + 1];
 +
 +          Vector<String> unknownCands_V = new Vector<String>();
 +          // which candidates (of the i'th source sentence) have not been seen before
 +          // this iteration?
 +
 +          for (int n = 0; n <= sizeOfNBest; ++n) {
 +            // Why up to and *including* sizeOfNBest?
 +            // So that it would read the "||||||" separator even if there is
 +            // a complete list of sizeOfNBest candidates.
 +
 +            // for the nth candidate for the ith sentence, read the sentence,
 +            // and store it in the sentsCurrIt_currSrcSent array
 +
 +            sents_str = inFile_sentsCurrIt.readLine(); // read one candidate from the current
 +                                                       // iteration
 +            sentsCurrIt_currSrcSent[n] = sents_str; // Note: possibly "||||||"
 +
 +            if (sents_str.equals("||||||")) {
 +              n = sizeOfNBest + 1;
 +            } else if (!existingCandStats.containsKey(sents_str)) {
 +              unknownCands_V.add(sents_str); // NEW CANDIDATE FROM THIS ITERATION
 +              writeLine(sents_str, outFile_unknownCands);
 +              outFile_unknownIndices.println(i); // INDEX OF THE NEW CANDIDATES
 +              newCandidatesAdded[iteration] += 1;
 +              existingCandStats.put(sents_str, "U"); // i.e. unknown
 +              // we add sents_str to avoid duplicate entries in unknownCands_V
 +            }
 +          } // for (n)
 +
 +          // only compute suff stats for new candidates
 +          // now unknownCands_V has the candidates for which we need to calculate
 +          // sufficient statistics (for the i'th source sentence)
 +          int sizeUnknown = unknownCands_V.size();
 +          sizeUnknown_currIt[i] = sizeUnknown;
 +
 +          existingCandStats.clear();
 +
 +        } // for (i) each sentence
 +
 +        // ---------- end of merging candidates stats from previous iterations
 +        // and finding new candidates ------------
 +
 +        /*
 +         * int[][] newSuffStats = null; if (!statsCurrIt_exists && sizeUnknown > 0) { newSuffStats =
 +         * evalMetric.suffStats(unknownCands, indices); }
 +         */
 +
 +        outFile_statsMergedKnown.close();
 +        outFile_unknownCands.close();
 +        outFile_unknownIndices.close();
 +
 +        // want to re-open all temp files and start from scratch again?
 +        for (int it = firstIt; it < iteration; ++it) // previous iterations temp files
 +        {
 +          inFile_sents[it].close();
 +          inFile_stats[it].close();
 +
 +          InputStream inStream_sents, inStream_stats;
 +          if (compressFiles == 0) {
 +            inStream_sents = new FileInputStream(tmpDirPrefix + "temp.sents.it" + it);
 +            inStream_stats = new FileInputStream(tmpDirPrefix + "temp.stats.it" + it);
 +          } else {
 +            inStream_sents = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.sents.it"
 +                + it + ".gz"));
 +            inStream_stats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.stats.it"
 +                + it + ".gz"));
 +          }
 +
 +          inFile_sents[it] = new BufferedReader(new InputStreamReader(inStream_sents, "utf8"));
 +          inFile_stats[it] = new BufferedReader(new InputStreamReader(inStream_stats, "utf8"));
 +        }
 +
 +        inFile_sentsCurrIt.close();
 +        // current iteration temp files
 +        if (compressFiles == 0) {
 +          inStream_sentsCurrIt = new FileInputStream(tmpDirPrefix + "temp.sents.it" + iteration);
 +        } else {
 +          inStream_sentsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.sents.it" + iteration + ".gz"));
 +        }
 +        inFile_sentsCurrIt = new BufferedReader(new InputStreamReader(inStream_sentsCurrIt, "utf8"));
 +
 +        // calculate SS for unseen candidates and write them to file
 +        FileInputStream inStream_statsCurrIt_unknown = null;
 +        BufferedReader inFile_statsCurrIt_unknown = null;
 +
 +        if (!statsCurrIt_exists && newCandidatesAdded[iteration] > 0) {
 +          // create the file...
 +          evalMetric.createSuffStatsFile(tmpDirPrefix + "temp.currIt.unknownCands", tmpDirPrefix
 +              + "temp.currIt.unknownIndices", tmpDirPrefix + "temp.stats.unknown", sizeOfNBest);
 +
 +          // ...and open it
 +          inStream_statsCurrIt_unknown = new FileInputStream(tmpDirPrefix + "temp.stats.unknown");
 +          inFile_statsCurrIt_unknown = new BufferedReader(new InputStreamReader(
 +              inStream_statsCurrIt_unknown, "utf8"));
 +        }
 +
 +        // open mergedKnown file
 +        // newly created by the big loop above
 +        FileInputStream instream_statsMergedKnown = new FileInputStream(tmpDirPrefix
 +            + "temp.stats.mergedKnown");
 +        BufferedReader inFile_statsMergedKnown = new BufferedReader(new InputStreamReader(
 +            instream_statsMergedKnown, "utf8"));
 +
 +        // num of features before observing new firing features from this iteration
 +        numParamsOld = numParams;
 +
 +        for (int i = 0; i < numSentences; ++i) {
 +          // reprocess candidates from previous iterations
 +          for (int it = firstIt; it < iteration; ++it) {
 +            for (int n = 0; n <= sizeOfNBest; ++n) {
 +              sents_str = inFile_sents[it].readLine();
 +              stats_str = inFile_stats[it].readLine();
 +
 +              if (sents_str.equals("||||||")) {
 +                n = sizeOfNBest + 1;
 +              } else if (!existingCandStats.containsKey(sents_str)) {
 +                existingCandStats.put(sents_str, stats_str);
 +              } // if unseen candidate
 +            } // for (n)
 +          } // for (it)
 +
 +          // copy relevant portion from mergedKnown to the merged file
 +          String line_mergedKnown = inFile_statsMergedKnown.readLine();
 +          while (!line_mergedKnown.equals("||||||")) {
 +            outFile_statsMerged.println(line_mergedKnown);
 +            line_mergedKnown = inFile_statsMergedKnown.readLine();
 +          }
 +
 +          int[] stats = new int[suffStatsCount];
 +
 +          for (int n = 0; n <= sizeOfNBest; ++n) {
 +            sents_str = inFile_sentsCurrIt.readLine();
 +            feats_str = inFile_featsCurrIt.readLine();
 +
 +            if (sents_str.equals("||||||")) {
 +              n = sizeOfNBest + 1;
 +            } else if (!existingCandStats.containsKey(sents_str)) {
 +
 +              if (!statsCurrIt_exists) {
 +                stats_str = inFile_statsCurrIt_unknown.readLine();
 +
 +                String[] temp_stats = stats_str.split("\\s+");
 +                for (int s = 0; s < suffStatsCount; ++s) {
 +                  stats[s] = Integer.parseInt(temp_stats[s]);
 +                }
 +
 +                outFile_statsCurrIt.println(stats_str);
 +              } else {
 +                stats_str = inFile_statsCurrIt.readLine();
 +
 +                String[] temp_stats = stats_str.split("\\s+");
 +                for (int s = 0; s < suffStatsCount; ++s) {
 +                  stats[s] = Integer.parseInt(temp_stats[s]);
 +                }
 +              }
 +
 +              outFile_statsMerged.println(stats_str);
 +
 +              // save feats & stats
 +              // System.out.println(sents_str+" "+feats_str);
 +
 +              feat_hash[i].put(sents_str, feats_str);
 +              stats_hash[i].put(sents_str, stats_str);
 +
 +              featVal_str = feats_str.split("\\s+");
 +
 +              if (feats_str.indexOf('=') != -1) {
 +                for (String featurePair : featVal_str) {
 +                  String[] pair = featurePair.split("=");
 +                  String name = pair[0];
 +                  int featId = Vocabulary.id(name);
 +                  // need to identify newly fired feats here
 +                  if (featId > numParams) {
 +                    ++numParams;
 +                    lambda.add(new Double(0));
 +                  }
 +                }
 +              }
 +              existingCandStats.put(sents_str, stats_str);
 +              candCount[i] += 1;
 +
 +              // newCandidatesAdded[iteration] += 1;
 +              // moved to code above detecting new candidates
 +            } else {
 +              if (statsCurrIt_exists)
 +                inFile_statsCurrIt.readLine();
 +              else {
 +                // write SS to outFile_statsCurrIt
 +                stats_str = existingCandStats.get(sents_str);
 +                outFile_statsCurrIt.println(stats_str);
 +              }
 +            }
 +
 +          } // for (n)
 +
 +          // now d = sizeUnknown_currIt[i] - 1
 +
 +          if (statsCurrIt_exists)
 +            inFile_statsCurrIt.readLine();
 +          else
 +            outFile_statsCurrIt.println("||||||");
 +
 +          existingCandStats.clear();
 +          totalCandidateCount += candCount[i];
 +
 +          // output sentence progress
 +          if ((i + 1) % 500 == 0) {
 +            print((i + 1) + "\n" + "            ", 1);
 +          } else if ((i + 1) % 100 == 0) {
 +            print("+", 1);
 +          } else if ((i + 1) % 25 == 0) {
 +            print(".", 1);
 +          }
 +
 +        } // for (i)
 +
 +        inFile_statsMergedKnown.close();
 +        outFile_statsMerged.close();
 +
 +        // for testing
 +        /*
 +         * int total_sent = 0; for( int i=0; i<numSentences; i++ ) {
 +         * System.out.println(feat_hash[i].size()+" "+candCount[i]); total_sent +=
 +         * feat_hash[i].size(); feat_hash[i].clear(); }
 +         * System.out.println("----------------total sent: "+total_sent); total_sent = 0; for( int
 +         * i=0; i<numSentences; i++ ) { System.out.println(stats_hash[i].size()+" "+candCount[i]);
 +         * total_sent += stats_hash[i].size(); stats_hash[i].clear(); }
 +         * System.out.println("*****************total sent: "+total_sent);
 +         */
 +
 +        println("", 1); // finish progress line
 +
 +        for (int it = firstIt; it < iteration; ++it) {
 +          inFile_sents[it].close();
 +          inFile_feats[it].close();
 +          inFile_stats[it].close();
 +        }
 +
 +        inFile_sentsCurrIt.close();
 +        inFile_featsCurrIt.close();
 +        if (statsCurrIt_exists)
 +          inFile_statsCurrIt.close();
 +        else
 +          outFile_statsCurrIt.close();
 +
 +        if (compressFiles == 1 && !statsCurrIt_exists) {
 +          gzipFile(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +
 +        // clear temp files
 +        deleteFile(tmpDirPrefix + "temp.currIt.unknownCands");
 +        deleteFile(tmpDirPrefix + "temp.currIt.unknownIndices");
 +        deleteFile(tmpDirPrefix + "temp.stats.unknown");
 +        deleteFile(tmpDirPrefix + "temp.stats.mergedKnown");
 +
 +        // cleanupMemory();
 +
 +        println("Processed " + totalCandidateCount + " distinct candidates " + "(about "
 +            + totalCandidateCount / numSentences + " per sentence):", 1);
 +        for (int it = firstIt; it <= iteration; ++it) {
 +          println("newCandidatesAdded[it=" + it + "] = " + newCandidatesAdded[it] + " (about "
 +              + newCandidatesAdded[it] / numSentences + " per sentence)", 1);
 +        }
 +
 +        println("", 1);
 +
 +        println("Number of features observed so far: " + numParams);
 +        println("", 1);
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +
 +      // n-best list converges
 +      if (newCandidatesAdded[iteration] == 0) {
 +        if (!oneModificationPerIteration) {
 +          println("No new candidates added in this iteration; exiting PRO.", 1);
 +          println("", 1);
 +          println("---  PRO iteration #" + iteration + " ending @ " + (new Date()) + "  ---", 1);
 +          println("", 1);
 +          deleteFile(tmpDirPrefix + "temp.stats.merged");
 +
 +          if (returnBest) {
 +            // note that bestLambda.size() <= lambda.size()
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              lambda.set(p, bestLambda.get(p));
 +            // and set the rest of lambda to be 0
 +            for (int p = 0; p < lambda.size() - bestLambda.size(); ++p)
 +              lambda.set(p + bestLambda.size(), new Double(0));
 +          }
 +
 +          return null; // this means that the old values should be kept by the caller
 +        } else {
 +          println("Note: No new candidates added in this iteration.", 1);
 +        }
 +      }
 +
 +      /************* start optimization **************/
 +
 +      /*
 +       * for( int v=1; v<initialLambda[1].length; v++ ) System.out.print(initialLambda[1][v]+" ");
 +       * System.exit(0);
 +       */
 +
 +      Vector<String> output = new Vector<String>();
 +
 +      // note: initialLambda[] has length = numParamsOld
 +      // augmented with new feature weights, initial values are 0
 +      double[] initialLambdaNew = new double[1 + numParams];
 +      System.arraycopy(initialLambda, 1, initialLambdaNew, 1, numParamsOld);
 +
 +      // finalLambda[] has length = numParams (considering new features)
 +      double[] finalLambda = new double[1 + numParams];
 +
 +      Optimizer opt = new Optimizer(seed + iteration, isOptimizable, output, initialLambdaNew,
 +          feat_hash, stats_hash, evalMetric, Tau, Xi, metricDiff, normalizationOptions,
 +          classifierAlg, classifierParams);
 +      finalLambda = opt.run_Optimizer();
 +
 +      if (returnBest) {
 +        double metricScore = opt.getMetricScore();
 +        if (!evalMetric.getToBeMinimized()) {
 +          if (metricScore > prevMetricScore) {
 +            prevMetricScore = metricScore;
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              bestLambda.set(p, finalLambda[p]);
 +            if (1 + numParams > bestLambda.size()) {
 +              for (int p = bestLambda.size(); p <= numParams; ++p)
 +                bestLambda.add(p, finalLambda[p]);
 +            }
 +          }
 +        } else {
 +          if (metricScore < prevMetricScore) {
 +            prevMetricScore = metricScore;
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              bestLambda.set(p, finalLambda[p]);
 +            if (1 + numParams > bestLambda.size()) {
 +              for (int p = bestLambda.size(); p <= numParams; ++p)
 +                bestLambda.add(p, finalLambda[p]);
 +            }
 +          }
 +        }
 +      }
 +
 +      // System.out.println(finalLambda.length);
 +      // for( int i=0; i<finalLambda.length-1; i++ )
 +      // System.out.print(finalLambda[i+1]+" ");
 +      // System.out.println();
 +
 +      /************* end optimization **************/
 +
 +      for (int i = 0; i < output.size(); i++)
 +        println(output.get(i));
 +
 +      // check if any parameter has been updated
 +      boolean anyParamChanged = false;
 +      boolean anyParamChangedSignificantly = false;
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        if (finalLambda[c] != lambda.get(c)) {
 +          anyParamChanged = true;
 +        }
 +        if (Math.abs(finalLambda[c] - lambda.get(c)) > stopSigValue) {
 +          anyParamChangedSignificantly = true;
 +        }
 +      }
 +
 +      // System.arraycopy(finalLambda,1,lambda,1,numParams);
 +
 +      println("---  PRO iteration #" + iteration + " ending @ " + (new Date()) + "  ---", 1);
 +      println("", 1);
 +
 +      if (!anyParamChanged) {
 +        println("No parameter value changed in this iteration; exiting PRO.", 1);
 +        println("", 1);
 +        break; // exit for (iteration) loop preemptively
 +      }
 +
 +      // was an early stopping criterion satisfied?
 +      boolean critSatisfied = false;
 +      if (!anyParamChangedSignificantly && stopSigValue >= 0) {
 +        println("Note: No parameter value changed significantly " + "(i.e. by more than "
 +            + stopSigValue + ") in this iteration.", 1);
 +        critSatisfied = true;
 +      }
 +
 +      if (critSatisfied) {
 +        ++earlyStop;
 +        println("", 1);
 +      } else {
 +        earlyStop = 0;
 +      }
 +
 +      // if min number of iterations executed, investigate if early exit should happen
 +      if (iteration >= minIts && earlyStop >= stopMinIts) {
 +        println("Some early stopping criteria has been observed " + "in " + stopMinIts
 +            + " consecutive iterations; exiting PRO.", 1);
 +        println("", 1);
 +
 +        if (returnBest) {
 +          // note that numParams >= bestLamba.size()-1 here!
 +          for (int f = 1; f <= bestLambda.size() - 1; ++f)
 +            lambda.set(f, bestLambda.get(f));
 +        } else {
 +          for (int f = 1; f <= numParams; ++f)
 +            lambda.set(f, finalLambda[f]);
 +        }
 +
 +        break; // exit for (iteration) loop preemptively
 +      }
 +
 +      // if max number of iterations executed, exit
 +      if (iteration >= maxIts) {
 +        println("Maximum number of PRO iterations reached; exiting PRO.", 1);
 +        println("", 1);
 +
 +        if (returnBest) {
 +          // note that numParams >= bestLamba.size()-1 here!
 +          for (int f = 1; f <= bestLambda.size() - 1; ++f)
 +            lambda.set(f, bestLambda.get(f));
 +        } else {
 +          for (int f = 1; f <= numParams; ++f)
 +            lambda.set(f, finalLambda[f]);
 +        }
 +
 +        break; // exit for (iteration) loop
 +      }
 +
 +      // use the new wt vector to decode the next iteration
 +      // (interpolation with previous wt vector)
 +      for (int i = 1; i <= numParams; i++)
 +        lambda.set(i, interCoef * finalLambda[i] + (1 - interCoef) * lambda.get(i).doubleValue());
 +
 +      println("Next iteration will decode with lambda: " + lambdaToString(lambda), 1);
 +      println("", 1);
 +
 +      // printMemoryUsage();
 +      for (int i = 0; i < numSentences; ++i) {
 +        suffStats_array[i].clear();
 +      }
 +      // cleanupMemory();
 +      // println("",2);
 +
 +      retA[2] = 0; // i.e. this should NOT be the last iteration
 +      done = true;
 +
 +    } // while (!done) // NOTE: this "loop" will only be carried out once
 +
 +    // delete .temp.stats.merged file, since it is not needed in the next
 +    // iteration (it will be recreated from scratch)
 +    deleteFile(tmpDirPrefix + "temp.stats.merged");
 +
 +    retA[0] = FINAL_score;
 +    retA[1] = earlyStop;
 +    return retA;
 +
 +  } // run_single_iteration
 +
 +  private String lambdaToString(ArrayList<Double> lambdaA) {
 +    String retStr = "{";
 +    int featToPrint = numParams > 15 ? 15 : numParams;
 +    // print at most the first 15 features
 +
 +    retStr += "(listing the first " + featToPrint + " lambdas)";
 +    for (int c = 1; c <= featToPrint - 1; ++c) {
 +      retStr += "" + String.format("%.4f", lambdaA.get(c).doubleValue()) + ", ";
 +    }
 +    retStr += "" + String.format("%.4f", lambdaA.get(numParams).doubleValue()) + "}";
 +
 +    return retStr;
 +  }
 +
 +  private String[] run_decoder(int iteration) {
 +    String[] retSA = new String[2];
 +
 +    // retsa saves the output file name(nbest-file)
 +    // and the decoder type
 +
 +    // [0] name of file to be processed
 +    // [1] indicates how the output file was obtained:
 +    // 1: external decoder
 +    // 2: fake decoder
 +    // 3: internal decoder
 +
 +    // use fake decoder
 +    if (fakeFileNameTemplate != null
 +        && fileExists(fakeFileNamePrefix + iteration + fakeFileNameSuffix)) {
 +      String fakeFileName = fakeFileNamePrefix + iteration + fakeFileNameSuffix;
 +      println("Not running decoder; using " + fakeFileName + " instead.", 1);
 +      /*
 +       * if (fakeFileName.endsWith(".gz")) { copyFile(fakeFileName,decoderOutFileName+".gz");
 +       * gunzipFile(decoderOutFileName+".gz"); } else { copyFile(fakeFileName,decoderOutFileName); }
 +       */
 +      retSA[0] = fakeFileName;
 +      retSA[1] = "2";
 +
 +    } else {
 +      println("Running external decoder...", 1);
 +
 +      try {
 +        ArrayList<String> cmd = new ArrayList<String>();
 +        cmd.add(decoderCommandFileName);
 +
 +        if (passIterationToDecoder)
 +          cmd.add(Integer.toString(iteration));
 +
 +        ProcessBuilder pb = new ProcessBuilder(cmd);
 +        // this merges the error and output streams of the subprocess
 +        pb.redirectErrorStream(true);
 +        Process p = pb.start();
 +
 +        // capture the sub-command's output
 +        new StreamGobbler(p.getInputStream(), decVerbosity).start();
 +
 +        int decStatus = p.waitFor();
 +        if (decStatus != validDecoderExitValue) {
 +          throw new RuntimeException("Call to decoder returned " + decStatus + "; was expecting "
 +              + validDecoderExitValue + ".");
 +        }
 +      } catch (IOException | InterruptedException e) {
 +        throw new RuntimeException(e);
 +      }
 +
 +      retSA[0] = decoderOutFileName;
 +      retSA[1] = "1";
 +
 +    }
 +
 +    return retSA;
 +  }
 +
 +  private void produceTempFiles(String nbestFileName, int iteration) {
 +    try {
 +      String sentsFileName = tmpDirPrefix + "temp.sents.it" + iteration;
 +      String featsFileName = tmpDirPrefix + "temp.feats.it" + iteration;
 +
 +      FileOutputStream outStream_sents = new FileOutputStream(sentsFileName, false);
 +      OutputStreamWriter outStreamWriter_sents = new OutputStreamWriter(outStream_sents, "utf8");
 +      BufferedWriter outFile_sents = new BufferedWriter(outStreamWriter_sents);
 +
 +      PrintWriter outFile_feats = new PrintWriter(featsFileName);
 +
 +      InputStream inStream_nbest = null;
 +      if (nbestFileName.endsWith(".gz")) {
 +        inStream_nbest = new GZIPInputStream(new FileInputStream(nbestFileName));
 +      } else {
 +        inStream_nbest = new FileInputStream(nbestFileName);
 +      }
 +      BufferedReader inFile_nbest = new BufferedReader(
 +          new InputStreamReader(inStream_nbest, "utf8"));
 +
 +      String line; // , prevLine;
 +      String candidate_str = "";
 +      String feats_str = "";
 +
 +      int i = 0;
 +      int n = 0;
 +      line = inFile_nbest.readLine();
 +
 +      while (line != null) {
 +
 +        /*
 +         * line format:
-          * 
++         *
 +         * i ||| words of candidate translation . ||| feat-1_val feat-2_val ... feat-numParams_val
 +         * .*
 +         */
 +
 +        // in a well formed file, we'd find the nth candidate for the ith sentence
 +
 +        int read_i = Integer.parseInt((line.substring(0, line.indexOf("|||"))).trim());
 +
 +        if (read_i != i) {
 +          writeLine("||||||", outFile_sents);
 +          outFile_feats.println("||||||");
 +          n = 0;
 +          ++i;
 +        }
 +
 +        line = (line.substring(line.indexOf("|||") + 3)).trim(); // get rid of initial text
 +
 +        candidate_str = (line.substring(0, line.indexOf("|||"))).trim();
 +        feats_str = (line.substring(line.indexOf("|||") + 3)).trim();
 +        // get rid of candidate string
 +
 +        int junk_i = feats_str.indexOf("|||");
 +        if (junk_i >= 0) {
 +          feats_str = (feats_str.substring(0, junk_i)).trim();
 +        }
 +
 +        writeLine(normalize(candidate_str, textNormMethod), outFile_sents);
 +        outFile_feats.println(feats_str);
 +
 +        ++n;
 +        if (n == sizeOfNBest) {
 +          writeLine("||||||", outFile_sents);
 +          outFile_feats.println("||||||");
 +          n = 0;
 +          ++i;
 +        }
 +
 +        line = inFile_nbest.readLine();
 +      }
 +
 +      if (i != numSentences) { // last sentence had too few candidates
 +        writeLine("||||||", outFile_sents);
 +        outFile_feats.println("||||||");
 +      }
 +
 +      inFile_nbest.close();
 +      outFile_sents.close();
 +      outFile_feats.close();
 +
 +      if (compressFiles == 1) {
 +        gzipFile(sentsFileName);
 +        gzipFile(featsFileName);
 +      }
 +
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +  }
 +
 +  private void createConfigFile(ArrayList<Double> params, String cfgFileName,
 +      String templateFileName) {
 +    try {
 +      // i.e. create cfgFileName, which is similar to templateFileName, but with
 +      // params[] as parameter values
 +
 +      BufferedReader inFile = new BufferedReader(new FileReader(templateFileName));
 +      PrintWriter outFile = new PrintWriter(cfgFileName);
 +
 +      BufferedReader inFeatDefFile = null;
 +      PrintWriter outFeatDefFile = null;
 +      int origFeatNum = 0; // feat num in the template file
 +
 +      String line = inFile.readLine();
 +      while (line != null) {
 +        int c_match = -1;
 +        for (int c = 1; c <= numParams; ++c) {
 +          if (line.startsWith(Vocabulary.word(c) + " ")) {
 +            c_match = c;
 +            ++origFeatNum;
 +            break;
 +          }
 +        }
 +
 +        if (c_match == -1) {
 +          outFile.println(line);
 +        } else {
 +          if (Math.abs(params.get(c_match).doubleValue()) > 1e-20)
 +            outFile.println(Vocabulary.word(c_match) + " " + params.get(c_match));
 +        }
 +
 +        line = inFile.readLine();
 +      }
 +
 +      // now append weights of new features
 +      for (int c = origFeatNum + 1; c <= numParams; ++c) {
 +        if (Math.abs(params.get(c).doubleValue()) > 1e-20)
 +          outFile.println(Vocabulary.word(c) + " " + params.get(c));
 +      }
 +
 +      inFile.close();
 +      outFile.close();
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +  }
 +
 +  private void processParamFile() {
 +    // process parameter file
 +    Scanner inFile_init = null;
 +    try {
 +      inFile_init = new Scanner(new FileReader(paramsFileName));
 +    } catch (FileNotFoundException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    String dummy = "";
 +
 +    // initialize lambda[] and other related arrays
 +    for (int c = 1; c <= numParams; ++c) {
 +      // skip parameter name
 +      while (!dummy.equals("|||")) {
 +        dummy = inFile_init.next();
 +      }
 +
 +      // read default value
 +      lambda.set(c, inFile_init.nextDouble());
 +      defaultLambda[c] = lambda.get(c).doubleValue();
 +
 +      // read isOptimizable
 +      dummy = inFile_init.next();
 +      if (dummy.equals("Opt")) {
 +        isOptimizable[c] = true;
 +      } else if (dummy.equals("Fix")) {
 +        isOptimizable[c] = false;
 +      } else {
 +        throw new RuntimeException("Unknown isOptimizable string " + dummy + " (must be either Opt or Fix)");
 +      }
 +
 +      if (!isOptimizable[c]) { // skip next two values
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +      } else {
 +        // the next two values are not used, only to be consistent with ZMERT's params file format
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        // set minRandValue[c] and maxRandValue[c] (range for random values)
 +        dummy = inFile_init.next();
 +        if (dummy.equals("-Inf") || dummy.equals("+Inf")) {
 +          throw new RuntimeException("minRandValue[" + c + "] cannot be -Inf or +Inf!");
 +        } else {
 +          minRandValue[c] = Double.parseDouble(dummy);
 +        }
 +
 +        dummy = inFile_init.next();
 +        if (dummy.equals("-Inf") || dummy.equals("+Inf")) {
 +          throw new RuntimeException("maxRandValue[" + c + "] cannot be -Inf or +Inf!");
 +        } else {
 +          maxRandValue[c] = Double.parseDouble(dummy);
 +        }
 +
 +        // check for illogical values
 +        if (minRandValue[c] > maxRandValue[c]) {
 +          throw new RuntimeException("minRandValue[" + c + "]=" + minRandValue[c] + " > " + maxRandValue[c]
 +              + "=maxRandValue[" + c + "]!");
 +        }
 +
 +        // check for odd values
 +        if (minRandValue[c] == maxRandValue[c]) {
 +          println("Warning: lambda[" + c + "] has " + "minRandValue = maxRandValue = "
 +              + minRandValue[c] + ".", 1);
 +        }
 +      } // if (!isOptimizable[c])
 +
 +      /*
 +       * precision[c] = inFile_init.nextDouble(); if (precision[c] < 0) { println("precision[" + c +
 +       * "]=" + precision[c] + " < 0!  Must be non-negative."); System.exit(21); }
 +       */
 +
 +    }
 +
 +    // set normalizationOptions[]
 +    String origLine = "";
 +    while (origLine != null && origLine.length() == 0) {
 +      origLine = inFile_init.nextLine();
 +    }
 +
 +    // How should a lambda[] vector be normalized (before decoding)?
 +    // nO[0] = 0: no normalization
 +    // nO[0] = 1: scale so that parameter nO[2] has absolute value nO[1]
 +    // nO[0] = 2: scale so that the maximum absolute value is nO[1]
 +    // nO[0] = 3: scale so that the minimum absolute value is nO[1]
 +    // nO[0] = 4: scale so that the L-nO[1] norm equals nO[2]
 +
 +    // normalization = none
 +    // normalization = absval 1 lm
 +    // normalization = maxabsval 1
 +    // normalization = minabsval 1
 +    // normalization = LNorm 2 1
 +
 +    dummy = (origLine.substring(origLine.indexOf("=") + 1)).trim();
 +    String[] dummyA = dummy.split("\\s+");
 +
 +    if (dummyA[0].equals("none")) {
 +      normalizationOptions[0] = 0;
 +    } else if (dummyA[0].equals("absval")) {
 +      normalizationOptions[0] = 1;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      String pName = dummyA[2];
 +      for (int i = 3; i < dummyA.length; ++i) { // in case parameter name has multiple words
 +        pName = pName + " " + dummyA[i];
 +      }
 +      normalizationOptions[2] = Vocabulary.id(pName);
 +
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the absval normalization method must be positive.");
 +      }
 +      if (normalizationOptions[2] == 0) {
 +        throw new RuntimeException("Unrecognized feature name " + normalizationOptions[2]
 +            + " for absval normalization method.");
 +      }
 +    } else if (dummyA[0].equals("maxabsval")) {
 +      normalizationOptions[0] = 2;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the maxabsval normalization method must be positive.");
 +      }
 +    } else if (dummyA[0].equals("minabsval")) {
 +      normalizationOptions[0] = 3;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the minabsval normalization method must be positive.");
 +      }
 +    } else if (dummyA[0].equals("LNorm")) {
 +      normalizationOptions[0] = 4;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      normalizationOptions[2] = Double.parseDouble(dummyA[2]);
 +      if (normalizationOptions[1] <= 0 || normalizationOptions[2] <= 0) {
 +        throw new RuntimeException("Both values for the LNorm normalization method must be positive.");
 +      }
 +    } else {
 +      throw new RuntimeException("Unrecognized normalization method " + dummyA[0] + "; "
 +          + "must be one of none, absval, maxabsval, and LNorm.");
 +    } // if (dummyA[0])
 +
 +    inFile_init.close();
 +  } // processParamFile()
 +
 +  private void processDocInfo() {
 +    // sets numDocuments and docOfSentence[]
 +    docOfSentence = new int[numSentences];
 +
 +    if (docInfoFileName == null) {
 +      for (int i = 0; i < numSentences; ++i)
 +        docOfSentence[i] = 0;
 +      numDocuments = 1;
 +    } else {
 +
 +      try {
 +
 +        // 4 possible formats:
 +        // 1) List of numbers, one per document, indicating # sentences in each document.
 +        // 2) List of "docName size" pairs, one per document, indicating name of document and #
 +        // sentences.
 +        // 3) List of docName's, one per sentence, indicating which doument each sentence belongs
 +        // to.
 +        // 4) List of docName_number's, one per sentence, indicating which doument each sentence
 +        // belongs to,
 +        // and its order in that document. (can also use '-' instead of '_')
 +
 +        int docInfoSize = countNonEmptyLines(docInfoFileName);
 +
 +        if (docInfoSize < numSentences) { // format #1 or #2
 +          numDocuments = docInfoSize;
 +          int i = 0;
 +
 +          BufferedReader inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          String line = inFile.readLine();
 +          boolean format1 = (!(line.contains(" ")));
 +
 +          for (int doc = 0; doc < numDocuments; ++doc) {
 +
 +            if (doc != 0)
 +              line = inFile.readLine();
 +
 +            int docSize = 0;
 +            if (format1) {
 +              docSize = Integer.parseInt(line);
 +            } else {
 +              docSize = Integer.parseInt(line.split("\\s+")[1]);
 +            }
 +
 +            for (int i2 = 1; i2 <= docSize; ++i2) {
 +              docOfSentence[i] = doc;
 +              ++i;
 +            }
 +
 +          }
 +
 +          // now i == numSentences
 +
 +          inFile.close();
 +
 +        } else if (docInfoSize == numSentences) { // format #3 or #4
 +
 +          boolean format3 = false;
 +
 +          HashSet<String> seenStrings = new HashSet<String>();
 +          BufferedReader inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          for (int i = 0; i < numSentences; ++i) {
 +            // set format3 = true if a duplicate is found
 +            String line = inFile.readLine();
 +            if (seenStrings.contains(line))
 +              format3 = true;
 +            seenStrings.add(line);
 +          }
 +
 +          inFile.close();
 +
 +          HashSet<String> seenDocNames = new HashSet<String>();
 +          HashMap<String, Integer> docOrder = new HashMap<String, Integer>();
 +          // maps a document name to the order (0-indexed) in which it was seen
 +
 +          inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          for (int i = 0; i < numSentences; ++i) {
 +            String line = inFile.readLine();
 +
 +            String docName = "";
 +            if (format3) {
 +              docName = line;
 +            } else {
 +              int sep_i = Math.max(line.lastIndexOf('_'), line.lastIndexOf('-'));
 +              docName = line.substring(0, sep_i);
 +            }
 +
 +            if (!seenDocNames.contains(docName)) {
 +              seenDocNames.add(docName);
 +              docOrder.put(docName, seenDocNames.size() - 1);
 +            }
 +
 +            int docOrder_i = docOrder.get(docName);
 +
 +            docOfSentence[i] = docOrder_i;
 +
 +          }
 +
 +          inFile.close();
 +
 +          numDocuments = seenDocNames.size();
 +
 +        } else { // badly formatted
 +
 +        }
 +
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +    }
 +
 +  }
 +
 +  private boolean copyFile(String origFileName, String newFileName) {
 +    try {
 +      File inputFile = new File(origFileName);
 +      File outputFile = new File(newFileName);
 +
 +      InputStream in = new FileInputStream(inputFile);
 +      OutputStream out = new FileOutputStream(outputFile);
 +
 +      byte[] buffer = new byte[1024];
 +      int len;
 +      while ((len = in.read(buffer)) > 0) {
 +        out.write(buffer, 0, len);
 +      }
 +      in.close();
 +      out.close();
 +
 +      /*
 +       * InputStream inStream = new FileInputStream(new File(origFileName)); BufferedReader inFile =
 +       * new BufferedReader(new InputStreamReader(inStream, "utf8"));
-        * 
++       *
 +       * FileOutputStream outStream = new FileOutputStream(newFileName, false); OutputStreamWriter
 +       * outStreamWriter = new OutputStreamWriter(outStream, "utf8"); BufferedWriter outFile = new
 +       * BufferedWriter(outStreamWriter);
-        * 
++       *
 +       * String line; while(inFile.ready()) { line = inFile.readLine(); writeLine(line, outFile); }
-        * 
++       *
 +       * inFile.close(); outFile.close();
 +       */
 +      return true;
 +    } catch (IOException e) {
 +      LOG.error(e.getMessage(), e);
 +      return false;
 +    }
 +  }
 +
 +  private void renameFile(String origFileName, String newFileName) {
 +    if (fileExists(origFileName)) {
 +      deleteFile(newFileName);
 +      File oldFile = new File(origFileName);
 +      File newFile = new File(newFileName);
 +      if (!oldFile.renameTo(newFile)) {
 +        println("Warning: attempt to rename " + origFileName + " to " + newFileName
 +            + " was unsuccessful!", 1);
 +      }
 +    } else {
 +      println("Warning: file " + origFileName + " does not exist! (in PROCore.renameFile)", 1);
 +    }
 +  }
 +
 +  private void deleteFile(String fileName) {
 +    if (fileExists(fileName)) {
 +      File fd = new File(fileName);
 +      if (!fd.delete()) {
 +        println("Warning: attempt to delete " + fileName + " was unsuccessful!", 1);
 +      }
 +    }
 +  }
 +
 +  private void writeLine(String line, BufferedWriter writer) throws IOException {
 +    writer.write(line, 0, line.length());
 +    writer.newLine();
 +    writer.flush();
 +  }
 +
 +  // need to re-write to handle different forms of lambda
 +  public void finish() {
 +    if (myDecoder != null) {
 +      myDecoder.cleanUp();
 +    }
 +
 +    // create config file with final values
 +    createConfigFile(lambda, decoderConfigFileName + ".PRO.final", decoderConfigFileName
 +        + ".PRO.orig");
 +
 +    // delete current decoder config file and decoder output
 +    deleteFile(decoderConfigFileName);
 +    deleteFile(decoderOutFileName);
 +
 +    // restore original name for config file (name was changed
 +    // in initialize() so it doesn't get overwritten)
 +    renameFile(decoderConfigFileName + ".PRO.orig", decoderConfigFileName);
 +
 +    if (finalLambdaFileName != null) {
 +      try {
 +        PrintWriter outFile_lambdas = new PrintWriter(finalLambdaFileName);
 +        for (int c = 1; c <= numParams; ++c) {
 +          outFile_lambdas.println(Vocabulary.word(c) + " ||| " + lambda.get(c).doubleValue());
 +        }
 +        outFile_lambdas.close();
 +
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +    }
 +
 +  }
 +
 +  private String[] cfgFileToArgsArray(String fileName) {
 +    checkFile(fileName);
 +
 +    Vector<String> argsVector = new Vector<String>();
 +
 +    BufferedReader inFile = null;
 +    try {
 +      inFile = new BufferedReader(new FileReader(fileName));
 +      String line, origLine;
 +      do {
 +        line = inFile.readLine();
 +        origLine = line; // for error reporting purposes
 +
 +        if (line != null && line.length() > 0 && line.charAt(0) != '#') {
 +
 +          if (line.indexOf("#") != -1) { // discard comment
 +            line = line.substring(0, line.indexOf("#"));
 +          }
 +
 +          line = line.trim();
 +
 +          // now line should look like "-xxx XXX"
 +
 +          /*
 +           * OBSOLETE MODIFICATION //SPECIAL HANDLING FOR PRO CLASSIFIER PARAMETERS String[] paramA
 +           * = line.split("\\s+");
-            * 
++           *
 +           * if( paramA[0].equals("-classifierParams") ) { String classifierParam = ""; for(int p=1;
 +           * p<=paramA.length-1; p++) classifierParam += paramA[p]+" ";
-            * 
++           *
 +           * if(paramA.length>=2) { String[] tmpParamA = new String[2]; tmpParamA[0] = paramA[0];
 +           * tmpParamA[1] = classifierParam; paramA = tmpParamA; } else {
 +           * println("Malformed line in config file:"); println(origLine); System.exit(70); } }//END
 +           * MODIFICATION
 +           */
 +
 +          // CMU MODIFICATION(FROM METEOR FOR ZMERT)
 +          // Parse args
 +          ArrayList<String> argList = new ArrayList<String>();
 +          StringBuilder arg = new StringBuilder();
 +          boolean quoted = false;
 +          for (int i = 0; i < line.length(); i++) {
 +            if (Character.isWhitespace(line.charAt(i))) {
 +              if (quoted)
 +                arg.append(line.charAt(i));
 +              else if (arg.length() > 0) {
 +                argList.add(arg.toString());
 +                arg = new StringBuilder();
 +              }
 +            } else if (line.charAt(i) == '\'') {
 +              if (quoted) {
 +                argList.add(arg.toString());
 +                arg = new StringBuilder();
 +              }
 +              quoted = !quoted;
 +            } else
 +              arg.append(line.charAt(i));
 +          }
 +          if (arg.length() > 0)
 +            argList.add(arg.toString());
 +          // Create paramA
 +          String[] paramA = new String[argList.size()];
 +          for (int i = 0; i < paramA.length; paramA[i] = argList.get(i++))
 +            ;
 +          // END CMU MODIFICATION
 +
 +          if (paramA.length == 2 && paramA[0].charAt(0) == '-') {
 +            argsVector.add(paramA[0]);
 +            argsVector.add(paramA[1]);
 +          } else if (paramA.length > 2 && (paramA[0].equals("-m") || paramA[0].equals("-docSet"))) {
 +            // -m (metricName), -docSet are allowed to have extra optinos
 +            for (int opt = 0; opt < paramA.length; ++opt) {
 +              argsVector.add(paramA[opt]);
 +            }
 +          } else {
 +            throw new RuntimeException("Malformed line in config file:" + origLine);
 +          }
 +
 +        }
 +      } while (line != null);
 +
 +      inFile.close();
 +    } catch (FileNotFoundException e) {
 +      println("PRO configuration file " + fileName + " was not found!");
 +      throw new RuntimeException(e);
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    String[] argsArray = new String[argsVector.size()];
 +
 +    for (int i = 0; i < argsVector.size(); ++i) {
 +      argsArray[i] = argsVector.elementAt(i);
 +    }
 +
 +    return argsArray;
 +  }
 +
 +  private void processArgsArray(String[] args) {
 +    processArgsArray(args, true);
 +  }
 +
 +  private void processArgsArray(String[] args, boolean firstTime) {
 +    /* set default values */
 +    // Relevant files
 +    dirPrefix = null;
 +    sourceFileName = null;
 +    refFileName = "reference.txt";
 +    refsPerSen = 1;
 +    textNormMethod = 1;
 +    paramsFileName = "params.txt";
 +    docInfoFileName = null;
 +    finalLambdaFileName = null;
 +    // MERT specs
 +    metricName = "BLEU";
 +    metricName_display = metricName;
 +    metricOptions = new String[2];
 +    metricOptions[0] = "4";
 +    metricOptions[1] = "closest";
 +    docSubsetInfo = new int[7];
 +    docSubsetInfo[0] = 0;
 +    maxMERTIterations = 20;
 +    prevMERTIterations = 20;
 +    minMERTIterations = 5;
 +    stopMinIts = 3;
 +    stopSigValue = -1;
 +    //
 +    // /* possibly other early stopping criteria here */
 +    //
 +    numOptThreads = 1;
 +    saveInterFiles = 3;
 +    compressFiles = 0;
 +    oneModificationPerIteration = false;
 +    randInit = false;
 +    seed = System.currentTimeMillis();
 +    // useDisk = 2;
 +    // Decoder specs
 +    decoderCommandFileName = null;
 +    passIterationToDecoder = false;
 +    decoderOutFileName = "output.nbest";
 +    validDecoderExitValue = 0;
 +    decoderConfigFileName = "dec_cfg.txt";
 +    sizeOfNBest = 100;
 +    fakeFileNameTemplate = null;
 +    fakeFileNamePrefix = null;
 +    fakeFileNameSuffix = null;
 +    // Output specs
 +    verbosity = 1;
 +    decVerbosity = 0;
 +
 +    int i = 0;
 +
 +    while (i < args.length) {
 +      String option = args[i];
 +      // Relevant files
 +      if (option.equals("-dir")) {
 +        dirPrefix = args[i + 1];
 +      } else if (option.equals("-s")) {
 +        sourceFileName = args[i + 1];
 +      } else if (option.equals("-r")) {
 +        refFileName = args[i + 1];
 +      } else if (option.equals("-rps")) {
 +        refsPerSen = Integer.parseInt(args[i + 1]);
 +        if (refsPerSen < 1) {
 +          throw new RuntimeException("refsPerSen must be positive.");
 +        }
 +      } else if (option.equals("-txtNrm")) {
 +        textNormMethod = Integer.parseInt(args[i + 1]);
 +        if (textNormMethod < 0 || textNormMethod > 4) {
 +          throw new RuntimeException("textNormMethod should be between 0 and 4");
 +        }
 +      } else if (option.equals("-p")) {
 +        paramsFileName = args[i + 1];
 +      } else if (option.equals("-docInfo")) {
 +        docInfoFileName = args[i + 1];
 +      } else if (option.equals("-fin")) {
 +        finalLambdaFileName = args[i + 1];
 +        // MERT specs
 +      } else if (option.equals("-m")) {
 +        metricName = args[i + 1];
 +        metricName_display = metricName;
 +        if (EvaluationMetric.knownMetricName(metricName)) {
 +          int optionCount = EvaluationMetric.metricOptionCount(metricName);
 +          metricOptions = new String[optionCount];
 +          for (int opt = 0; opt < optionCount; ++opt) {
 +            metricOptions[opt] = args[i + opt + 2];
 +          }
 +          i += optionCount;
 +        } else {
 +          throw new RuntimeException("Unknown metric name " + metricName + ".");
 +        }
 +      } else if (option.equals("-docSet")) {
 +        String method = args[i + 1];
 +
 +        if (method.equals("all")) {
 +          docSubsetInfo[0] = 0;
 +          i += 0;
 +        } else if (method.equals("bottom")) {
 +          String a = args[i + 2];
 +          if (a.endsWith("d")) {
 +            docSubsetInfo[0] = 1;
 +            a = a.substring(0, a.indexOf("d"));
 +          } else {
 +            docSubsetInfo[0] = 2;
 +            a = a.substring(0, a.indexOf("%"));
 +          }
 +          docSubsetInfo[5] = Integer.parseInt(a);
 +          i += 1;
 +        } else if (method.equals("top")) {
 +          String a = args[i + 2];
 +          if (a.endsWith("d")) {
 +            docSubsetInfo[0] = 3;
 +            a = a.substring(0, a.indexOf("d"));
 +          } else {
 +            docSubsetInfo[0] = 4;
 +            a = a.substring(0, a.indexOf("%"));
 +          }
 +          docSubsetInfo[5] = Integer.parseInt(a);
 +          i += 1;
 +        } else if (method.equals("window")) {
 +          String a1 = args[i + 2];
 +          a1 = a1.substring(0, a1.indexOf("d")); // size of window
 +          String a2 = args[i + 4];
 +          if (a2.indexOf("p") > 0) {
 +            docSubsetInfo[0] = 5;
 +            a2 = a2.substring(0, a2.indexOf("p"));
 +          } else {
 +            docSubsetInfo[0] = 6;
 +            a2 = a2.substring(0, a2.indexOf("r"));
 +          }
 +          docSubsetInfo[5] = Integer.parseInt(a1);
 +          docSubsetInfo[6] = Integer.parseInt(a2);
 +          i += 3;
 +        } else {
 +          throw new RuntimeException("Unknown docSet method " + method + ".");
 +        }
 +      } else if (option.equals("-maxIt")) {
 +        maxMERTIterations = Integer.parseInt(args[i + 1]);
 +        if (maxMERTIterations < 1) {
 +          throw new RuntimeException("maxMERTIts must be positive.");
 +        }
 +      } else if (option.equals("-minIt")) {
 +        minMERTIterations = Integer.parseInt(args[i + 1]);
 +        if (minMERTIterations < 1) {
 +          throw new RuntimeException("minMERTIts must be positive.");
 +        }
 +      } else if (option.equals("-prevIt")) {
 +        prevMERTIterations = Integer.parseInt(args[i + 1]);
 +        if (prevMERTIterations < 0) {
 +          throw new RuntimeException("prevMERTIts must be non-negative.");
 +        }
 +      } else if (option.equals("-stopIt")) {
 +        stopMinIts = Integer.parseInt(args[i + 1]);
 +        if (stopMinIts < 1) {
 +          throw new RuntimeException("stopMinIts must be positive.");
 +        }
 +      } else if (option.equals("-stopSig")) {
 +        stopSigValue = Double.parseDouble(args[i + 1]);
 +      }
 +      //
 +      // /* possibly other early stopping criteria here */
 +      //
 +      else if (option.equals("-thrCnt")) {
 +        numOptThreads = Integer.parseInt(args[i + 1]);
 +        if (numOptThreads < 1) {
 +          throw new RuntimeException("threadCount must be positive.");
 +        }
 +      } else if (option.equals("-save")) {
 +        saveInterFiles = Integer.parseInt(args[i + 1]);
 +        if (saveInterFiles < 0 || saveInterFiles > 3) {
 +          throw new RuntimeException("save should be between 0 and 3");
 +        }
 +      } else if (option.equals("-compress")) {
 +        compressFiles = Integer.parseInt(args[i + 1]);
 +        if (compressFiles < 0 || compressFiles > 1) {
 +          throw new RuntimeException("compressFiles should be either 0 or 1");
 +        }
 +      }

<TRUNCATED>


[13/50] [abbrv] incubator-joshua git commit: added note about phrase-based change to CHANGELOG

Posted by mj...@apache.org.
added note about phrase-based change to CHANGELOG


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/bf12adc8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/bf12adc8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/bf12adc8

Branch: refs/heads/7
Commit: bf12adc8b8e130c9f9addc69f47e9cf7e0774f72
Parents: 12b834e
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 16:26:44 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 16:26:44 2016 -0500

----------------------------------------------------------------------
 CHANGELOG | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/bf12adc8/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 95cbaf4..f80e4b9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,10 @@
+6.1 (TBD)
+=========
+
+- Phrase-based decoder has been rewritten to use glue rules, instead of adding a preterminal
+  to all phrase-based rules. This means that phrase-based grammars can be used directly out
+  of Thrax.
+
 6.0.5 (October 23, 2015)
 ========================
 


[30/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/ConstraintRule.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/ConstraintRule.java
index 5146e2c,0000000..0db76cb
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/ConstraintRule.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/ConstraintRule.java
@@@ -1,100 -1,0 +1,100 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.segment_file;
 +
 +import javax.swing.text.Segment;
 +
 +/**
 + * This interface is for an individual (partial) item to seed the chart with. All rules should be
 + * flat (no hierarchical nonterminals).
 + * <p>
 + * The {@link Segment}, {@link ConstraintSpan}, and {@link ConstraintRule} interfaces are for
 + * defining an interchange format between a SegmentFileParser and the Chart class. These interfaces
 + * <b>should not</b> be used internally by the Chart. The objects returned by a
 + * SegmentFileParser will not be optimal for use during decoding. The Chart should convert each of
 + * these objects into its own internal representation during construction. That is the contract
 + * described by these interfaces.
 + * 
 + * @see org.apache.joshua.decoder.segment_file.ConstraintRule.Type
 + * 
 + * @author wren ng thornton wren@users.sourceforge.net
 + * @version $LastChangedDate: 2009-03-26 15:06:57 -0400 (Thu, 26 Mar 2009) $
 + */
 +public interface ConstraintRule {
 +
 +  /**
 +   * <p>There are three types of ConstraintRule. The RULE type returns non-null values for all methods.
 +   * The LHS type provides a (non-null) value for the lhs method, but returns null for everything
 +   * else. And the RHS type provides a (non-null) value for nativeRhs and foreignRhs but returns
 +   * null for the lhs and features.</p>
 +   * <p>
 +   * The interpretation of a RULE is that it adds a new rule to the grammar which only applies to
 +   * the associated span. If the associated span is hard, then the set of rules for that span will
 +   * override the regular grammar.</p>
 +   * <p>
 +   * The intepretation of a LHS is that it provides a hard constraint that the associated span be
 +   * treated as the nonterminal for that span, thus filtering the regular grammar.</p>
 +   * <p>
 +   * The interpretation of a RHS is that it provides a hard constraint to filter the regular grammar
 +   * such that only rules generating the desired translation can be used.</p>
 +   */
-   public enum Type {
++  enum Type {
 +    RULE, LHS, RHS
-   };
++  }
 +
 +  /** 
 +   * Return the type of this ConstraintRule.
 +   * @return the {@link org.apache.joshua.decoder.segment_file.ConstraintRule.Type}
 +   */
 +  Type type();
 +
 +
 +  /**
 +   * Return the left hand side of the constraint rule. If this is null, then this object is
 +   * specifying a translation for the span, but that translation may be derived from any
 +   * nonterminal. The nonterminal here must be one used by the regular grammar.
 +   * @return the left hand side of the constraint rule
 +   */
 +  String lhs();
 +
 +
 +  /**
 +   * Return the native right hand side of the constraint rule. If this is null, then the regular
 +   * grammar will be used to fill in the derivation from the lhs.
 +   * @return the native right hand side of the constraint rule
 +   */
 +  String nativeRhs();
 +
 +
 +  /**
 +   * Return the foreign right hand side of the constraint rule. This must be consistent with the
 +   * sentence for the associated span, and is provided as a convenience method.
 +   * @return the foreign right hand side of the constraint rule
 +   */
 +  String foreignRhs();
 +
 +
 +  /**
 +   * Return the grammar feature values for the RULE. The length of this array must be the same as
 +   * for the regular grammar. We cannot enforce this requirement, but the
 +   * {@link org.apache.joshua.decoder.chart_parser.Chart} must throw an error if there is a mismatch.
 +   * @return an array of floating feature values for the RULE 
 +   */
 +  float[] features();
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Sentence.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Sentence.java
index e323ef6,0000000..7127870
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Sentence.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Sentence.java
@@@ -1,450 -1,0 +1,450 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.segment_file;
 +
 +import static org.apache.joshua.util.FormatUtils.addSentenceMarkers;
 +
 +import java.util.ArrayList;
 +import java.util.HashSet;
 +import java.util.Iterator;
 +import java.util.LinkedList;
 +import java.util.List;
 +import java.util.StringTokenizer;
 +import java.util.regex.Matcher;
 +import java.util.regex.Pattern;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.lattice.Arc;
 +import org.apache.joshua.lattice.Lattice;
 +import org.apache.joshua.lattice.Node;
 +import org.apache.joshua.util.ChartSpan;
 +import org.apache.joshua.util.Regex;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class represents lattice input. The lattice is contained on a single line and is represented
 + * in PLF (Python Lattice Format), e.g.,
 + * 
 + * <pre>
 + * ((('ein',0.1,1),('dieses',0.2,1),('haus',0.4,2),),(('haus',0.8,1),),)
 + * </pre>
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + */
 +
 +public class Sentence {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Sentence.class);
 +
 +  /* The sentence number. */
 +  public int id = -1;
 +
 +  /*
 +   * The source and target sides of the input sentence. Target sides are present when doing
 +   * alignment or forced decoding.
 +   */
 +  protected String source = null;
 +  protected String fullSource = null;
 +  
 +  protected String target = null;
 +  protected String fullTarget = null;
 +  protected String[] references = null;
 +
 +  /* Lattice representation of the source sentence. */
 +  protected Lattice<Token> sourceLattice = null;
 +
 +  /* List of constraints */
 +  private final List<ConstraintSpan> constraints;
 +  
 +  public JoshuaConfiguration config = null;
 +
 +  /**
 +   * Constructor. Receives a string representing the input sentence. This string may be a
 +   * string-encoded lattice or a plain text string for decoding.
 +   * 
 +   * @param inputString representing the input sentence
 +   * @param id ID to associate with the input string
 +   * @param joshuaConfiguration a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   */
 +  public Sentence(String inputString, int id, JoshuaConfiguration joshuaConfiguration) {
 +  
 +    inputString = Regex.spaces.replaceAll(inputString, " ").trim();
 +    
 +    config = joshuaConfiguration;
 +    
-     this.constraints = new LinkedList<ConstraintSpan>();
++    this.constraints = new LinkedList<>();
 +
 +    // Check if the sentence has SGML markings denoting the
 +    // sentence ID; if so, override the id passed in to the
 +    // constructor
 +    Matcher start = SEG_START.matcher(inputString);
 +    if (start.find()) {
 +      source = SEG_END.matcher(start.replaceFirst("")).replaceFirst("");
 +      String idstr = start.group(1);
 +      this.id = Integer.parseInt(idstr);
 +
 +    } else {
-       if (inputString.indexOf(" ||| ") != -1) {
++      if (inputString.contains(" ||| ")) {
 +        /* Target-side given; used for parsing and forced decoding */
 +        String[] pieces = inputString.split("\\s?\\|{3}\\s?");
 +        source = pieces[0];
 +        target = pieces[1];
 +        if (target.equals(""))
 +          target = null;
 +        if (pieces.length > 2) {
 +          references = new String[pieces.length - 2];
 +          System.arraycopy(pieces, 2, references, 0, pieces.length - 2);
 +        }
 +        this.id = id;
 +
 +      } else {
 +        /* Regular ol' input sentence */
 +        source = inputString;
 +        this.id = id;
 +      }
 +    }
 +    
 +    // Only trim strings
 +    if (! (joshuaConfiguration.lattice_decoding && source.startsWith("(((")))
 +      adjustForLength(joshuaConfiguration.maxlen);
 +  }
 +
 +  /**
 +   * Indicates whether the underlying lattice is a linear chain, i.e., a sentence.
 +   * 
 +   * @return true if this is a linear chain, false otherwise
 +   */
 +  public boolean isLinearChain() {
 +    return ! this.getLattice().hasMoreThanOnePath();
 +  }
 +
 +  // Matches the opening and closing <seg> tags, e.g.,
 +  // <seg id="72">this is a test input sentence</seg>.
 +  protected static final Pattern SEG_START = Pattern
 +      .compile("^\\s*<seg\\s+id=\"?(\\d+)\"?[^>]*>\\s*");
 +  protected static final Pattern SEG_END = Pattern.compile("\\s*</seg\\s*>\\s*$");
 +
 +  /**
 +   * Returns the length of the sentence. For lattices, the length is the shortest path through the
 +   * lattice. The length includes the &lt;s&gt; and &lt;/s&gt; sentence markers. 
 +   * 
 +   * @return number of input tokens + 2 (for start and end of sentence markers)
 +   */
 +  public int length() {
 +    return this.getLattice().getShortestDistance();
 +  }
 +
 +  /**
 +   * Returns the annotations for a specific word (specified by an index) in the 
 +   * sentence
 +   * 
 +   * @param index The location of the word in the sentence
 +   * @param key The annotation identity
 +   * @return The annotations associated with this word
 +   */
 +  public String getAnnotation(int index, String key) {
 +    return getTokens().get(index).getAnnotation(key);
 +  }
 +
 +  /**
 +   * This function computes the intersection of \sigma^+ (where \sigma is the terminal vocabulary)
 +   * with all character-level segmentations of each OOV in the input sentence.
 +   * 
 +   * The idea is to break apart noun compounds in languages like German (such as the word "golfloch"
 +   * = "golf" (golf) + "loch" (hole)), allowing them to be translated.
 +   * 
 +   * @param grammars a list of grammars to consult to find in- and out-of-vocabulary items
 +   */
 +  public void segmentOOVs(Grammar[] grammars) {
 +    Lattice<Token> oldLattice = this.getLattice();
 +
 +    /* Build a list of terminals across all grammars */
-     HashSet<Integer> vocabulary = new HashSet<Integer>();
++    HashSet<Integer> vocabulary = new HashSet<>();
 +    for (Grammar grammar : grammars) {
 +      Iterator<Integer> iterator = grammar.getTrieRoot().getTerminalExtensionIterator();
 +      while (iterator.hasNext())
 +        vocabulary.add(iterator.next());
 +    }
 +
 +    List<Node<Token>> oldNodes = oldLattice.getNodes();
 +
 +    /* Find all the subwords that appear in the vocabulary, and create the lattice */
 +    for (int nodeid = oldNodes.size() - 3; nodeid >= 1; nodeid -= 1) {
 +      if (oldNodes.get(nodeid).getOutgoingArcs().size() == 1) {
 +        Arc<Token> arc = oldNodes.get(nodeid).getOutgoingArcs().get(0);
 +        String word = Vocabulary.word(arc.getLabel().getWord());
 +        if (!vocabulary.contains(arc.getLabel())) {
 +          // System.err.println(String.format("REPL: '%s'", word));
 +          List<Arc<Token>> savedArcs = oldNodes.get(nodeid).getOutgoingArcs();
 +
 +          char[] chars = word.toCharArray();
-           ChartSpan<Boolean> wordChart = new ChartSpan<Boolean>(chars.length + 1, false);
-           ArrayList<Node<Token>> nodes = new ArrayList<Node<Token>>(chars.length + 1);
++          ChartSpan<Boolean> wordChart = new ChartSpan<>(chars.length + 1, false);
++          ArrayList<Node<Token>> nodes = new ArrayList<>(chars.length + 1);
 +          nodes.add(oldNodes.get(nodeid));
 +          for (int i = 1; i < chars.length; i++)
-             nodes.add(new Node<Token>(i));
++            nodes.add(new Node<>(i));
 +          nodes.add(oldNodes.get(nodeid + 1));
 +          for (int width = 1; width <= chars.length; width++) {
 +            for (int i = 0; i <= chars.length - width; i++) {
 +              int j = i + width;
 +              if (width != chars.length) {
 +                Token token = new Token(word.substring(i, j), config);
 +                if (vocabulary.contains(id)) {
 +                  nodes.get(i).addArc(nodes.get(j), 0.0f, token);
 +                  wordChart.set(i, j, true);
 +                  //                    System.err.println(String.format("  FOUND '%s' at (%d,%d)", word.substring(i, j),
 +                  //                        i, j));
 +                }
 +              }
 +
 +              for (int k = i + 1; k < j; k++) {
 +                if (wordChart.get(i, k) && wordChart.get(k, j)) {
 +                  wordChart.set(i, j, true);
 +                  //                    System.err.println(String.format("    PATH FROM %d-%d-%d", i, k, j));
 +                }
 +              }
 +            }
 +          }
 +
 +          /* If there's a path from beginning to end */
 +          if (wordChart.get(0, chars.length)) {
 +            // Remove nodes not part of a complete path
-             HashSet<Node<Token>> deletedNodes = new HashSet<Node<Token>>();
++            HashSet<Node<Token>> deletedNodes = new HashSet<>();
 +            for (int k = 1; k < nodes.size() - 1; k++)
 +              if (!(wordChart.get(0, k) && wordChart.get(k, chars.length)))
 +                nodes.set(k, null);
 +
 +            int delIndex = 1;
 +            while (delIndex < nodes.size())
 +              if (nodes.get(delIndex) == null) {
 +                deletedNodes.add(nodes.get(delIndex));
 +                nodes.remove(delIndex);
 +              } else
 +                delIndex++;
 +
 +            for (Node<Token> node : nodes) {
 +              int arcno = 0;
 +              while (arcno != node.getOutgoingArcs().size()) {
 +                Arc<Token> delArc = node.getOutgoingArcs().get(arcno);
 +                if (deletedNodes.contains(delArc.getHead()))
 +                  node.getOutgoingArcs().remove(arcno);
 +                else {
 +                  arcno++;
 +                  //                    System.err.println("           ARC: " + Vocabulary.word(delArc.getLabel()));
 +                }
 +              }
 +            }
 +
 +            // Insert into the main lattice
 +            this.getLattice().insert(nodeid, nodeid + 1, nodes);
 +          } else {
 +            nodes.get(0).setOutgoingArcs(savedArcs);
 +          }
 +        }
 +      }
 +    }
 +  }
 +
 +  /**
 +   * If the input sentence is too long (not counting the &lt;s&gt; and &lt;/s&gt; tokens), it is truncated to
 +   * the maximum length, specified with the "maxlen" parameter.
 +   * 
 +   * Note that this code assumes the underlying representation is a sentence, and not a lattice. Its
 +   * behavior is undefined for lattices.
 +   * 
 +   * @param length int representing the length to truncate the sentence to
 +   */
 +  protected void adjustForLength(int length) {
 +    int size = this.getLattice().size() - 2; // subtract off the start- and end-of-sentence tokens
 +
 +    if (size > length) {
 +      LOG.warn("sentence {} too long {}, truncating to length {}", id(), size, length);
 +
 +      // Replace the input sentence (and target) -- use the raw string, not source()
 +      String[] tokens = source.split("\\s+");
 +      source = tokens[0];
 +      for (int i = 1; i < length; i++)
 +        source += " " + tokens[i];
 +      sourceLattice = null;
 +      if (target != null) {
 +        target = "";
 +      }
 +    }
 +  }
 +
 +  public boolean isEmpty() {
 +    return source.matches("^\\s*$");
 +  }
 +
 +  public int id() {
 +    return id;
 +  }
 +
 +  /**
 +   * Returns the raw source-side input string.
 +   * @return the raw source-side input string
 +   */
 +  public String rawSource() {
 +    return source;
 +  }
 +  
 +  /**
 +   * Returns the source-side string with annotations --- if any --- stripped off.
 +   * 
 +   * @return  the source-side string with annotations --- if any --- stripped off
 +   */
 +  public String source() {
 +    StringBuilder str = new StringBuilder();
 +    int[] ids = getWordIDs();
 +    for (int i = 1; i < ids.length - 1; i++) {
 +      str.append(Vocabulary.word(ids[i])).append(" ");
 +    }
 +    return str.toString().trim();
 +  }
 +
 +  /**
 +   * Returns a sentence with the start and stop symbols added to the 
 +   * beginning and the end of the sentence respectively
 +   * 
 +   * @return String The input sentence with start and stop symbols
 +   */
 +  public String fullSource() {
 +    if (fullSource == null) {
 +      fullSource = addSentenceMarkers(source());
 +    }
 +    return fullSource;  
 +  }
 +
 +  /**
 +   * If a target side was supplied with the sentence, this will be non-null. This is used when doing
 +   * synchronous parsing or constrained decoding. The input format is:
 +   * 
 +   * Bill quiere ir a casa ||| Bill wants to go home
 +   * 
 +   * If the parameter parse=true is set, parsing will be triggered, otherwise constrained decoding.
 +   * 
 +   * @return target side of sentence translation
 +   */
 +  public String target() {
 +    return target;
 +  }
 +
 +  public String fullTarget() {
 +    if (fullTarget == null) {
 +      fullTarget = addSentenceMarkers(target());
 +    }
 +    return fullTarget; 
 +  }
 +
 +  public String source(int i, int j) {
 +    StringTokenizer st = new StringTokenizer(fullSource());
 +    int index = 0;
 +    StringBuilder substring = new StringBuilder();
 +    while (st.hasMoreTokens()) {
 +      String token = st.nextToken();
 +      if (index >= j)
 +        break;
 +      if (index >= i)
 +        substring.append(token).append(" ");
 +      index++;
 +    }
 +    return substring.toString().trim();
 +  }
 +
 +  public String[] references() {
 +    return references;
 +  }
 +
 +  /**
 +   * Returns the sequence of tokens comprising the sentence. This assumes you've done the checking
 +   * to makes sure the input string (the source side) isn't a PLF waiting to be parsed.
 +   * 
 +   * @return a {@link java.util.List} of {@link org.apache.joshua.decoder.segment_file.Token}'s comprising the sentence
 +   */
 +  public List<Token> getTokens() {
 +    assert isLinearChain();
-     List<Token> tokens = new ArrayList<Token>();
++    List<Token> tokens = new ArrayList<>();
 +    for (Node<Token> node: getLattice().getNodes())
 +      if (node != null && node.getOutgoingArcs().size() > 0) 
 +        tokens.add(node.getOutgoingArcs().get(0).getLabel());
 +    return tokens;
 +  }
 +  
 +  /**
 +   * Returns the sequence of word IDs comprising the input sentence. Assumes this is not a general
 +   * lattice, but a linear chain.
 +   * @return an int[] comprising all word ID's
 +   */
 +  public int[] getWordIDs() {
 +    List<Token> tokens = getTokens();
 +    int[] ids = new int[tokens.size()];
 +    for (int i = 0; i < tokens.size(); i++)
 +      ids[i] = tokens.get(i).getWord();
 +    return ids;
 +  }
 +  
 +  /**
 +   * Returns the sequence of word ids comprising the sentence. Assumes this is a sentence and
 +   * not a lattice.
 +   *  
 +   * @return the sequence of word ids comprising the sentence
 +   */
 +  public Lattice<String> stringLattice() {
 +    assert isLinearChain();
 +    return Lattice.createStringLatticeFromString(source(), config);
 +  }
 +
 +  public List<ConstraintSpan> constraints() {
 +    return constraints;
 +  }
 +
 +  public Lattice<Token> getLattice() {
 +    if (this.sourceLattice == null) {
 +      if (config.lattice_decoding && rawSource().startsWith("(((")) {
 +        if (config.search_algorithm.equals("stack")) {
 +          throw new RuntimeException("* FATAL: lattice decoding currently not supported for stack-based search algorithm.");
 +        }
 +        this.sourceLattice = Lattice.createTokenLatticeFromPLF(rawSource(), config);
 +      } else
 +        this.sourceLattice = Lattice.createTokenLatticeFromString(String.format("%s %s %s", Vocabulary.START_SYM,
 +            rawSource(), Vocabulary.STOP_SYM), config);
 +    }
 +    return this.sourceLattice;
 +  }
 +
 +  @Override
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder(source());
 +    if (target() != null) {
-       sb.append(" ||| " + target());
++      sb.append(" ||| ").append(target());
 +    }
 +    return sb.toString();
 +  }
 +
 +  public boolean hasPath(int begin, int end) {
 +    return getLattice().distance(begin, end) != -1;
 +  }
 +
 +  public Node<Token> getNode(int i) {
 +    return getLattice().getNode(i);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Token.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Token.java
index b84826d,0000000..4cbc7fa
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Token.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/segment_file/Token.java
@@@ -1,158 -1,0 +1,157 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.segment_file;
 +
 +import static org.apache.joshua.util.FormatUtils.escapeSpecialSymbols;
 +
 +import java.util.HashMap;
 +import java.util.regex.Matcher;
 +import java.util.regex.Pattern;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Stores the identity of a word and its annotations in a sentence.
 +
 + * @author "Gaurav Kumar"
 + * @author Matt Post
 + */
 +public class Token {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Token.class);
 +
 +  // The token without the annotations
 +  private String token; 
-   private int tokenID;
++  private final int tokenID;
 +
 +  private HashMap<String,String> annotations = null;
-   private JoshuaConfiguration joshuaConfiguration;
 +
 +  /**
 +   * <p>Constructor : Creates a Token object from a raw word
 +   * Extracts and assigns an annotation when available.
 +   * Any word can be marked with annotations, which are arbitrary semicolon-delimited
 +   * key[=value] pairs (the value is optional) listed in brackets after a word, e.g.,</p>
 +   * <pre>
 +   *    Je[ref=Samuel;PRO] voudrais[FUT;COND]
 +   * </pre>
 +   * 
 +   * <p>This will create a dictionary annotation on the word of the following form for "Je"</p>
 +   * 
 +   * <pre>
 +   *   ref -&gt; Samuel
 +   *   PRO -&gt; PRO
 +   * </pre>
 +   * 
 +   * <p>and the following for "voudrais":</p>
 +   * 
 +   * <pre>
 +   *   FUT  -&gt; FUT
 +   *   COND -&gt; COND
 +   * </pre>
 +   * 
 +   * @param rawWord A word with annotation information (possibly)
 +   * @param config a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   *  
 +   */
 +  public Token(String rawWord, JoshuaConfiguration config) {
++
++    JoshuaConfiguration joshuaConfiguration = config;
 +    
-     this.joshuaConfiguration = config;
-     
-     annotations = new HashMap<String,String>();
++    annotations = new HashMap<>();
 +    
 +    // Matches a word with an annotation
 +    // Check guidelines in constructor description
 +    Pattern pattern = Pattern.compile("(\\S+)\\[(\\S+)\\]");
 +    Matcher tag = pattern.matcher(rawWord);
 +    if (tag.find()) {
 +      // Annotation match found
 +      token = tag.group(1);
 +      String tagStr = tag.group(2);
 +
 +      for (String annotation: tagStr.split(";")) {
 +        int where = annotation.indexOf("=");
 +        if (where != -1) {
 +          annotations.put(annotation.substring(0, where), annotation.substring(where + 1));
 +        } else {
 +          annotations.put(annotation, annotation);
 +        }
 +      }
 +    } else {
 +      // No match found, which implies that this token does not have any annotations 
 +      token = rawWord;
 +    }
 +
 +    // Mask strings that cause problems for the decoder. This has to be done *after* parsing for
 +    // annotations.
 +    token = escapeSpecialSymbols(token);
 +
 +    if (joshuaConfiguration != null && joshuaConfiguration.lowercase) {
 +      if (FormatUtils.ISALLUPPERCASE(token))
 +        annotations.put("lettercase", "all-upper");
 +      else if (Character.isUpperCase(token.charAt(0)))
 +        annotations.put("lettercase",  "upper");
 +      else
 +        annotations.put("lettercase",  "lower");
 +      
 +      LOG.info("TOKEN: {} -> {} ({})", token, token.toLowerCase(), annotations.get("lettercase"));
 +      token = token.toLowerCase(); 
 +    }
 +    
 +    tokenID = Vocabulary.id(token);
 +  }
 +  
 +  /**
 +   * Returns the word ID (vocab ID) for this token
 +   * 
 +   * @return int A word ID
 +   */
 +  public int getWord() {
 +    return tokenID;
 +  }
 +
 +  /**
 +   * Returns the string associated with this token
 +   * @return String A word
 +   */
 +  public String getWordIdentity() {
 +    return token;
 +  }
 +  
 +  public String toString() {
 +    return token;
 +  }
 +
 +  /**
 +   * Returns the annotationID (vocab ID)
 +   * associated with this token
 +   * @param key A type ID
 +   * @return the annotationID (vocab ID)
 +   */
 +  public String getAnnotation(String key) {
 +    if (annotations.containsKey(key)) {
 +      return annotations.get(key);
 +    }
 +    
 +    return null;
 +  }
 +}


[23/50] [abbrv] incubator-joshua git commit: bugfix: resetting global decoder state

Posted by mj...@apache.org.
bugfix: resetting global decoder state

We are getting random failures in LmOovFeatureTest.java, but only when run as a group. I printed the stack trace around the error and noticed it's a call to getting the state index in ComputeNodeResult, with a state index of 1, which shouldn't happen because only one LM is loaded. So it seems that the bug is cause by some earlier test not calling Decoder.resetGlobalState() in cleanup. So I put a call to that in the constructor. This passes the tests but I'm not sure it's correct, and it's definitely not the right way to go about things. The ideal way to solve this is to get rid of global state.


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/d4fdbfd8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/d4fdbfd8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/d4fdbfd8

Branch: refs/heads/7
Commit: d4fdbfd88bab99e244d3ed1fc9cff4ba5e6d124c
Parents: 4812fed
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 21:57:06 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 21:57:06 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/Decoder.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d4fdbfd8/src/main/java/org/apache/joshua/decoder/Decoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/Decoder.java b/src/main/java/org/apache/joshua/decoder/Decoder.java
index d524a27..2d753c1 100644
--- a/src/main/java/org/apache/joshua/decoder/Decoder.java
+++ b/src/main/java/org/apache/joshua/decoder/Decoder.java
@@ -149,6 +149,8 @@ public class Decoder {
     this.grammars = new ArrayList<>();
     this.threadPool = new ArrayBlockingQueue<>(this.joshuaConfiguration.num_parallel_decoders, true);
     this.customPhraseTable = null;
+    
+    resetGlobalState();
   }
 
   /**


[26/50] [abbrv] incubator-joshua git commit: Fix Javadoc on master branch

Posted by mj...@apache.org.
Fix Javadoc on master branch


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/ff410c29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/ff410c29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/ff410c29

Branch: refs/heads/7
Commit: ff410c297a149400db3cb553b11a930ad01dc7ed
Parents: ac465ef
Author: Lewis John McGibbney <le...@gmail.com>
Authored: Mon Aug 22 21:10:05 2016 -0700
Committer: Lewis John McGibbney <le...@gmail.com>
Committed: Mon Aug 22 21:10:05 2016 -0700

----------------------------------------------------------------------
 .../org/apache/joshua/decoder/phrase/Candidate.java  |  7 ++++---
 .../apache/joshua/decoder/phrase/PhraseNodes.java    | 15 +++++----------
 .../java/org/apache/joshua/decoder/phrase/Stack.java |  1 -
 3 files changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/ff410c29/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index bc770f4..883bcfb 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@ -219,10 +219,11 @@ public class Candidate implements Comparable<Candidate> {
   }
   
   /**
-   * Ensures that the cost of applying the edge has been computed. This is tucked away in an
-   * accessor so that we can do it lazily if we wish.
+   * Ensures that the cost of applying the edge has been 
+   * computed. This is tucked away in an accessor so that 
+   * we can do it lazily if we wish.
    * 
-   * @return
+   * @return the computed result.
    */
   public ComputeNodeResult computeResult() {
     if (computedResult == null) {

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/ff410c29/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java b/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
index c20c05a..c690dc3 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
@@ -45,19 +45,14 @@ public class PhraseNodes extends ArrayList<HGNode> {
   }
   
   /**
-   * Score the rules and sort them. Scoring is necessary because rules are only scored if they
-   * are used, in an effort to make reading in rules more efficient. This is starting to create
-   * some trouble and should probably be reworked.
-   * 
-   * @param features a {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
-   * @param weights a populated {@link org.apache.joshua.decoder.ff.FeatureVector}
-   * @param num_options the number of options
+   * Score the rules and sort them. Scoring is necessary 
+   * because rules are only scored if they are used, in an 
+   * effort to make reading in rules more efficient. 
+   * This is starting to create some trouble and should 
+   * probably be reworked.
    */
   public void finish() {
     Collections.sort(this, HGNode.inverseLogPComparator);    
-//    System.err.println("TargetPhrases::finish()");
-//    for (Rule rule: this) 
-//      System.err.println("  " + rule);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/ff410c29/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Stack.java b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
index 47a3396..a16d9fe 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
@@ -57,7 +57,6 @@ public class Stack extends ArrayList<Hypothesis> {
   /**
    * Create a new stack. Stacks are organized one for each number of source words that are covered.
    * 
-   * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
    * @param sentence input for a {@link org.apache.joshua.lattice.Lattice}
    * @param config populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
    */


[25/50] [abbrv] incubator-joshua git commit: Merge remote-tracking branch 'max/JOSHUA-301'

Posted by mj...@apache.org.
Merge remote-tracking branch 'max/JOSHUA-301'


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/ac465efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/ac465efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/ac465efc

Branch: refs/heads/7
Commit: ac465efc649955d2ca952502e62d770684047113
Parents: 7bfe87f d235f9b
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 22:09:19 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 22:09:19 2016 -0500

----------------------------------------------------------------------

----------------------------------------------------------------------



[33/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/DefaultInsideOutside.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/DefaultInsideOutside.java
index c6dae77,0000000..d53674b
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/DefaultInsideOutside.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/DefaultInsideOutside.java
@@@ -1,407 -1,0 +1,405 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.HashMap;
 +
 +
 +/**
 + * to use the functions here, one need to extend the class to provide a way to calculate the
 + * transitionLogP based on feature set
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @version $LastChangedDate$
 + */
 +
 +// TODO: currently assume log semiring, need to generalize to other semiring
 +// already implement both max-product and sum-product algortithms for log-semiring
 +// Note: this class requires the correctness of transitionLogP of each hyperedge, which itself may
 +// require the correctness of bestDerivationLogP at each item
 +
 +public abstract class DefaultInsideOutside {
 +  /**
 +   * Two operations: add and multi add: different hyperedges lead to a specific item multi: prob of
 +   * a derivation is a multi of all constituents
 +   */
 +  int ADD_MODE = 0; // 0: sum; 1: viterbi-min, 2: viterbi-max
-   int LOG_SEMIRING = 1;
++  final int LOG_SEMIRING = 1;
 +  int SEMIRING = LOG_SEMIRING; // default is in log; or real, or logic
 +  double ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY;// log-domain
 +  double ONE_IN_SEMIRING = 0;// log-domain
 +  double scaling_factor; // try to scale the original distribution: smooth or winner-take-all
 +
-   private HashMap<HGNode, Double> tbl_inside_prob = new HashMap<HGNode, Double>();// remember inside
++  private final HashMap<HGNode, Double> tbl_inside_prob = new HashMap<>();// remember inside
 +                                                                                  // prob of each
 +                                                                                  // item:
-   private HashMap<HGNode, Double> tbl_outside_prob = new HashMap<HGNode, Double>();// remember
++  private final HashMap<HGNode, Double> tbl_outside_prob = new HashMap<>();// remember
 +                                                                                   // outside prob
 +                                                                                   // of each item
 +  double normalizationConstant = ONE_IN_SEMIRING;
 +
 +  /**
 +   * for each item, remember how many deductions pointering to me, this is needed for outside
 +   * estimation during outside estimation, an item will recursive call its deductions to do
 +   * outside-estimation only after it itself is done with outside estimation, this is necessary
 +   * because the outside estimation of the items under its deductions require the item's outside
 +   * value
 +   */
-   private HashMap<HGNode, Integer> tbl_num_parent_deductions = new HashMap<HGNode, Integer>();
++  private final HashMap<HGNode, Integer> tbl_num_parent_deductions = new HashMap<>();
 +
 +  private HashMap<HGNode, Integer> tbl_for_sanity_check = null;
 +
 +  // get feature-set specific **log probability** for each hyperedge
 +  protected abstract double getHyperedgeLogProb(HyperEdge dt, HGNode parent_it);
 +
 +  protected double getHyperedgeLogProb(HyperEdge dt, HGNode parent_it, double scaling_factor) {
 +    return getHyperedgeLogProb(dt, parent_it) * scaling_factor;
 +  }
 +
 +  // the results are stored in tbl_inside_prob and tbl_outside_prob
 +  public void runInsideOutside(HyperGraph hg, int add_mode, int semiring, double scaling_factor_) {// add_mode|||
 +                                                                                                   // 0:
 +                                                                                                   // sum;
 +                                                                                                   // 1:
 +                                                                                                   // viterbi-min,
 +                                                                                                   // 2:
 +                                                                                                   // viterbi-max
 +
 +    setup_semiring(semiring, add_mode);
 +    scaling_factor = scaling_factor_;
 +
 +    // System.out.println("outside estimation");
 +    inside_estimation_hg(hg);
 +    // System.out.println("inside estimation");
 +    outside_estimation_hg(hg);
 +    normalizationConstant = tbl_inside_prob.get(hg.goalNode);
 +    System.out.println("normalization constant is " + normalizationConstant);
 +    tbl_num_parent_deductions.clear();
 +    sanityCheckHG(hg);
 +  }
 +
 +  // to save memory, external class should call this method
 +  public void clearState() {
 +    tbl_num_parent_deductions.clear();
 +    tbl_inside_prob.clear();
 +    tbl_outside_prob.clear();
 +  }
 +
 +  // ######### use of inside-outside probs ##########################
 +  // this is the logZ where Z is the sum[ exp( log prob ) ]
 +  public double getLogNormalizationConstant() {
 +    return normalizationConstant;
 +  }
 +
 +  // this is the log of expected/posterior prob (i.e., LogP, where P is the posterior probability),
 +  // without normalization
 +  public double getEdgeUnormalizedPosteriorLogProb(HyperEdge dt, HGNode parent) {
 +    // ### outside of parent
-     double outside = (Double) tbl_outside_prob.get(parent);
++    double outside = tbl_outside_prob.get(parent);
 +
 +    // ### get inside prob of all my ant-items
 +    double inside = ONE_IN_SEMIRING;
 +    if (dt.getTailNodes() != null) {
 +      for (HGNode ant_it : dt.getTailNodes())
-         inside = multi_in_semiring(inside, (Double) tbl_inside_prob.get(ant_it));
++        inside = multi_in_semiring(inside, tbl_inside_prob.get(ant_it));
 +    }
 +
 +    // ### add deduction/rule specific prob
 +    double merit = multi_in_semiring(inside, outside);
 +    merit = multi_in_semiring(merit, getHyperedgeLogProb(dt, parent, this.scaling_factor));
 +
 +    return merit;
 +  }
 +
 +  // normalized probabily in [0,1]
 +  public double getEdgePosteriorProb(HyperEdge dt, HGNode parent) {
 +    if (SEMIRING == LOG_SEMIRING) {
 +      double res =
 +          Math.exp((getEdgeUnormalizedPosteriorLogProb(dt, parent) - getLogNormalizationConstant()));
 +      if (res < 0.0 - 1e-2 || res > 1.0 + 1e-2) {
 +        throw new RuntimeException("res is not within [0,1], must be wrong value: " + res);
 +      }
 +      return res;
 +    } else {
 +      throw new RuntimeException("not implemented");
 +    }
 +  }
 +
 +  // this is the log of expected/posterior prob (i.e., LogP, where P is the posterior probability),
 +  // without normalization
 +  public double getNodeUnnormalizedPosteriorLogProb(HGNode node) {
 +    // ### outside of parent
-     double inside = (Double) tbl_inside_prob.get(node);
-     double outside = (Double) tbl_outside_prob.get(node);
++    double inside = tbl_inside_prob.get(node);
++    double outside = tbl_outside_prob.get(node);
 +    return multi_in_semiring(inside, outside);
 +  }
 +
 +
 +  // normalized probabily in [0,1]
 +  public double getNodePosteriorProb(HGNode node) {
 +    if (SEMIRING == LOG_SEMIRING) {
 +      double res =
 +          Math.exp((getNodeUnnormalizedPosteriorLogProb(node) - getLogNormalizationConstant()));
 +      if (res < 0.0 - 1e-2 || res > 1.0 + 1e-2) {
 +        throw new RuntimeException("res is not within [0,1], must be wrong value: " + res);
 +      }
 +      return res;
 +    } else {
 +      throw new RuntimeException("not implemented");
 +    }
 +  }
 +
 +  /*
 +   * Originally, to see if the sum of the posterior probabilities of all the hyperedges sum to one
 +   * However, this won't work! The sum should be greater than 1.
 +   */
 +  public void sanityCheckHG(HyperGraph hg) {
-     tbl_for_sanity_check = new HashMap<HGNode, Integer>();
++    tbl_for_sanity_check = new HashMap<>();
 +    // System.out.println("num_dts: " + hg.goal_item.l_deductions.size());
 +    sanity_check_item(hg.goalNode);
 +    System.out.println("survied sanity check!!!!");
 +  }
 +
 +  private void sanity_check_item(HGNode it) {
 +    if (tbl_for_sanity_check.containsKey(it)) return;
 +    tbl_for_sanity_check.put(it, 1);
 +    double prob_sum = 0;
 +    // ### recursive call on each deduction
 +    for (HyperEdge dt : it.hyperedges) {
 +      prob_sum += getEdgePosteriorProb(dt, it);
 +      sanity_check_deduction(dt);// deduction-specifc operation
 +    }
 +    double supposed_sum = getNodePosteriorProb(it);
 +    if (Math.abs(prob_sum - supposed_sum) > 1e-3) {
 +      throw new RuntimeException("prob_sum=" + prob_sum + "; supposed_sum=" + supposed_sum
 +          + "; sanity check fail!!!!");
 +    }
 +    // ### item-specific operation
 +  }
 +
 +  private void sanity_check_deduction(HyperEdge dt) {
 +    // ### recursive call on each ant item
 +    if (null != dt.getTailNodes()) {
-       for (HGNode ant_it : dt.getTailNodes()) {
-         sanity_check_item(ant_it);
-       }
++      dt.getTailNodes().forEach(this::sanity_check_item);
 +    }
 +
 +    // ### deduction-specific operation
 +
 +  }
 +
 +  // ################## end use of inside-outside probs
 +
 +
 +
 +  // ############ bottomn-up insdide estimation ##########################
 +  private void inside_estimation_hg(HyperGraph hg) {
 +    tbl_inside_prob.clear();
 +    tbl_num_parent_deductions.clear();
 +    inside_estimation_item(hg.goalNode);
 +  }
 +
 +  private double inside_estimation_item(HGNode it) {
 +    // ### get number of deductions that point to me
-     Integer num_called = (Integer) tbl_num_parent_deductions.get(it);
++    Integer num_called = tbl_num_parent_deductions.get(it);
 +    if (null == num_called) {
 +      tbl_num_parent_deductions.put(it, 1);
 +    } else {
 +      tbl_num_parent_deductions.put(it, num_called + 1);
 +    }
 +
 +    if (tbl_inside_prob.containsKey(it)) {
-       return (Double) tbl_inside_prob.get(it);
++      return tbl_inside_prob.get(it);
 +    }
 +    double inside_prob = ZERO_IN_SEMIRING;
 +
 +    // ### recursive call on each deduction
 +    for (HyperEdge dt : it.hyperedges) {
 +      double v_dt = inside_estimation_deduction(dt, it);// deduction-specifc operation
 +      inside_prob = add_in_semiring(inside_prob, v_dt);
 +    }
 +    // ### item-specific operation, but all the prob should be factored into each deduction
 +
 +    tbl_inside_prob.put(it, inside_prob);
 +    return inside_prob;
 +  }
 +
 +  private double inside_estimation_deduction(HyperEdge dt, HGNode parent_item) {
 +    double inside_prob = ONE_IN_SEMIRING;
 +    // ### recursive call on each ant item
 +    if (dt.getTailNodes() != null) for (HGNode ant_it : dt.getTailNodes()) {
 +      double v_item = inside_estimation_item(ant_it);
 +      inside_prob = multi_in_semiring(inside_prob, v_item);
 +    }
 +
 +    // ### deduction operation
 +    double deduct_prob = getHyperedgeLogProb(dt, parent_item, this.scaling_factor);// feature-set
 +                                                                                   // specific
 +    inside_prob = multi_in_semiring(inside_prob, deduct_prob);
 +    return inside_prob;
 +  }
 +
 +  // ########### end inside estimation
 +
 +  // ############ top-downn outside estimation ##########################
 +
 +  private void outside_estimation_hg(HyperGraph hg) {
 +    tbl_outside_prob.clear();
 +    tbl_outside_prob.put(hg.goalNode, ONE_IN_SEMIRING);// initialize
 +    for (HyperEdge dt : hg.goalNode.hyperedges)
 +      outside_estimation_deduction(dt, hg.goalNode);
 +  }
 +
 +  private void outside_estimation_item(HGNode cur_it, HGNode upper_item, HyperEdge parent_dt,
 +      double parent_deduct_prob) {
-     Integer num_called = (Integer) tbl_num_parent_deductions.get(cur_it);
++    Integer num_called = tbl_num_parent_deductions.get(cur_it);
 +    if (null == num_called || 0 == num_called) {
 +      throw new RuntimeException("un-expected call, must be wrong");
 +    }
 +    tbl_num_parent_deductions.put(cur_it, num_called - 1);
 +
 +    double old_outside_prob = ZERO_IN_SEMIRING;
 +    if (tbl_outside_prob.containsKey(cur_it)) {
-       old_outside_prob = (Double) tbl_outside_prob.get(cur_it);
++      old_outside_prob = tbl_outside_prob.get(cur_it);
 +    }
 +
 +    double additional_outside_prob = ONE_IN_SEMIRING;
 +
 +    // ### add parent deduction prob
 +    additional_outside_prob = multi_in_semiring(additional_outside_prob, parent_deduct_prob);
 +
 +    // ### sibing specifc
 +    if (parent_dt.getTailNodes() != null && parent_dt.getTailNodes().size() > 1)
 +      for (HGNode ant_it : parent_dt.getTailNodes()) {
 +        if (ant_it != cur_it) {
-           double inside_prob_item = (Double) tbl_inside_prob.get(ant_it);// inside prob
++          double inside_prob_item = tbl_inside_prob.get(ant_it);// inside prob
 +          additional_outside_prob = multi_in_semiring(additional_outside_prob, inside_prob_item);
 +        }
 +      }
 +
 +    // ### upper item
-     double outside_prob_item = (Double) tbl_outside_prob.get(upper_item);// outside prob
++    double outside_prob_item = tbl_outside_prob.get(upper_item);// outside prob
 +    additional_outside_prob = multi_in_semiring(additional_outside_prob, outside_prob_item);
 +
 +    // #### add to old prob
 +    additional_outside_prob = add_in_semiring(additional_outside_prob, old_outside_prob);
 +
 +    tbl_outside_prob.put(cur_it, additional_outside_prob);
 +
 +    // ### recursive call on each deduction
 +    if (num_called - 1 <= 0) {// i am done
 +      for (HyperEdge dt : cur_it.hyperedges) {
 +        // TODO: potentially, we can collect the feature expection in each hyperedge here, to avoid
 +        // another pass of the hypergraph to get the counts
 +        outside_estimation_deduction(dt, cur_it);
 +      }
 +    }
 +  }
 +
 +
 +  private void outside_estimation_deduction(HyperEdge dt, HGNode parent_item) {
 +    // we do not need to outside prob if no ant items
 +    if (dt.getTailNodes() != null) {
 +      // ### deduction specific prob
 +      double deduction_prob = getHyperedgeLogProb(dt, parent_item, this.scaling_factor);// feature-set
 +                                                                                        // specific
 +
 +      // ### recursive call on each ant item
 +      for (HGNode ant_it : dt.getTailNodes()) {
 +        outside_estimation_item(ant_it, parent_item, dt, deduction_prob);
 +      }
 +    }
 +  }
 +
 +  // ########### end outside estimation
 +
 +
 +
 +  // ############ common ##########################
 +  // BUG: replace integer pseudo-enum with a real Java enum
 +  // BUG: use a Semiring class instead of all this?
 +  private void setup_semiring(int semiring, int add_mode) {
 +    ADD_MODE = add_mode;
 +    SEMIRING = semiring;
 +    if (SEMIRING == LOG_SEMIRING) {
 +      if (ADD_MODE == 0) { // sum
 +        ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY;
 +        ONE_IN_SEMIRING = 0;
 +      } else if (ADD_MODE == 1) { // viter-min
 +        ZERO_IN_SEMIRING = Double.POSITIVE_INFINITY;
 +        ONE_IN_SEMIRING = 0;
 +      } else if (ADD_MODE == 2) { // viter-max
 +        ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY;
 +        ONE_IN_SEMIRING = 0;
 +      } else {
 +        throw new RuntimeException("invalid add mode");
 +      }
 +    } else {
 +      throw new RuntimeException("un-supported semiring");
 +    }
 +  }
 +
 +  private double multi_in_semiring(double x, double y) {
 +    if (SEMIRING == LOG_SEMIRING) {
 +      return multi_in_log_semiring(x, y);
 +    } else {
 +      throw new RuntimeException("un-supported semiring");
 +    }
 +  }
 +
 +  private double add_in_semiring(double x, double y) {
 +    if (SEMIRING == LOG_SEMIRING) {
 +      return add_in_log_semiring(x, y);
 +    } else {
 +      throw new RuntimeException("un-supported semiring");
 +    }
 +  }
 +
 +  // AND
 +  private double multi_in_log_semiring(double x, double y) { // value is Log prob
 +    return x + y;
 +  }
 +
 +
 +  // OR: return Math.log(Math.exp(x) + Math.exp(y));
 +  // BUG: Replace ADD_MODE pseudo-enum with a real Java enum
 +  private double add_in_log_semiring(double x, double y) { // prevent under-flow
 +    if (ADD_MODE == 0) { // sum
 +      if (x == Double.NEGATIVE_INFINITY) { // if y is also n-infinity, then return n-infinity
 +        return y;
 +      }
 +      if (y == Double.NEGATIVE_INFINITY) {
 +        return x;
 +      }
 +
 +      if (y <= x) {
 +        return x + Math.log(1 + Math.exp(y - x));
 +      } else {
 +        return y + Math.log(1 + Math.exp(x - y));
 +      }
 +    } else if (ADD_MODE == 1) { // viter-min
 +      return (x <= y ? x : y);
 +    } else if (ADD_MODE == 2) { // viter-max
 +      return (x >= y ? x : y);
 +    } else {
 +      throw new RuntimeException("invalid add mode");
 +    }
 +  }
 +  // ############ end common #####################
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ForestWalker.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ForestWalker.java
index e58670a,0000000..34eb5b9
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ForestWalker.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ForestWalker.java
@@@ -1,79 -1,0 +1,79 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.HashSet;
 +import java.util.Set;
 +
 +/**
 + * @author Matt Post <po...@cs.jhu.edu>
 + */
 +
 +/**
 + * This class visits every node in a forest using a depth-first, preorder traversal, applying the
 + * WalkerFunction to each node. It would be easy to add other traversals if the demand arose.
 + */
 +public class ForestWalker {
 +
-   public static enum TRAVERSAL {
++  public enum TRAVERSAL {
 +    PREORDER, POSTORDER
-   };
++  }
 +
-   private Set<HGNode> visitedNodes;
++  private final Set<HGNode> visitedNodes;
 +  private TRAVERSAL traversalType = TRAVERSAL.PREORDER;
 +
 +  public ForestWalker() {
-     visitedNodes = new HashSet<HGNode>();
++    visitedNodes = new HashSet<>();
 +  }
 +
 +  public ForestWalker(TRAVERSAL traversal) {
 +    this.traversalType = traversal;
-     visitedNodes = new HashSet<HGNode>();
++    visitedNodes = new HashSet<>();
 +  }
 +  
 +  public void walk(HGNode node, WalkerFunction walker) {
 +      walk(node, walker, 0);
 +  }
 +
 +  private void walk(HGNode node, WalkerFunction walker, int nodeIndex) {
 +    // short circuit
 +    if (visitedNodes.contains(node))
 +      return;
 +
 +    visitedNodes.add(node);
 +    
 +    if (this.traversalType == TRAVERSAL.PREORDER)
 +      walker.apply(node, 0);
 +
 +    if (node.getHyperEdges() != null) {
 +      for (HyperEdge edge : node.getHyperEdges()) {
 +        if (edge.getTailNodes() != null) {
 +          int tailNodeIndex = 0;
 +          for (HGNode tailNode : edge.getTailNodes()) {
 +            walk(tailNode, walker, tailNodeIndex);
 +            tailNodeIndex++;
 +          }
 +        }
 +      }
 +    }
 +    
 +    if (this.traversalType == TRAVERSAL.POSTORDER)
 +      walker.apply(node, nodeIndex);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/GrammarBuilderWalkerFunction.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/GrammarBuilderWalkerFunction.java
index 286fcb8,0000000..a1132e8
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/GrammarBuilderWalkerFunction.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/GrammarBuilderWalkerFunction.java
@@@ -1,178 -1,0 +1,178 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.io.PrintStream;
 +import java.util.HashSet;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.hash_based.MemoryBasedBatchGrammar;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This walker function builds up a new context-free grammar by visiting each node in a hypergraph.
 + * For a quick overview, see Chris Dyer's 2010 NAACL paper
 + * "Two monlingual parses are better than one (synchronous parse)".
 + * <p>
 + * From a functional-programming point of view, this walker really wants to calculate a fold over
 + * the entire hypergraph: the initial value is an empty grammar, and as we visit each node, we add
 + * more rules to the grammar. After we have traversed the whole hypergraph, the resulting grammar
 + * will contain all rules needed for synchronous parsing.
 + * <p>
 + * These rules look just like the rules already present in the hypergraph, except that each
 + * non-terminal symbol is annotated with the span of its node.
 + */
 +public class GrammarBuilderWalkerFunction implements WalkerFunction {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(GrammarBuilderWalkerFunction.class);
 +
 +  private final MemoryBasedBatchGrammar grammar;
 +  private final PrintStream outStream;
 +  private final int goalSymbol;
 +  private final HashSet<Rule> rules;
 +
 +  public GrammarBuilderWalkerFunction(String goal, JoshuaConfiguration joshuaConfiguration, String owner) {
 +    grammar = new MemoryBasedBatchGrammar(owner, joshuaConfiguration, 1000);
 +    outStream = null;
 +    goalSymbol = Vocabulary.id(goal);
-     rules = new HashSet<Rule>();
++    rules = new HashSet<>();
 +  }
 +
 +  public void apply(HGNode node, int index) {
 +    // System.err.printf("VISITING NODE: %s\n", getLabelWithSpan(node));
 +    for (HyperEdge e : node.hyperedges) {
 +      Rule r = getRuleWithSpans(e, node);
 +      if (r != null && !rules.contains(r)) {
 +        if (outStream != null) outStream.println(r);
 +        grammar.addRule(r);
 +        rules.add(r);
 +      }
 +    }
 +  }
 +
 +  private static int getLabelWithSpan(HGNode node) {
 +    return Vocabulary.id(getLabelWithSpanAsString(node));
 +  }
 +
 +  private static String getLabelWithSpanAsString(HGNode node) {
 +    String label = Vocabulary.word(node.lhs);
 +    String unBracketedCleanLabel = label.substring(1, label.length() - 1);
 +    return String.format("[%d-%s-%d]", node.i, unBracketedCleanLabel, node.j);
 +  }
 +
 +  private boolean nodeHasGoalSymbol(HGNode node) {
 +    return node.lhs == goalSymbol;
 +  }
 +
 +  private Rule getRuleWithSpans(HyperEdge edge, HGNode head) {
 +    Rule edgeRule = edge.getRule();
 +    int headLabel = getLabelWithSpan(head);
 +    // System.err.printf("Head label: %s\n", headLabel);
 +    // if (edge.getAntNodes() != null) {
 +    // for (HGNode n : edge.getAntNodes())
 +    // System.err.printf("> %s\n", getLabelWithSpan(n));
 +    // }
 +    int[] source = getNewSource(nodeHasGoalSymbol(head), edge);
 +    // if this would be unary abstract, getNewSource will be null
 +    if (source == null) return null;
 +    int[] target = getNewTargetFromSource(source);
 +    return new Rule(
 +        headLabel,
 +        source,
 +        target,
 +        edgeRule.getArity(),
 +        new FeatureVector(edgeRule.getFeatureVector()),
 +        edgeRule.getAlignment(),
 +        OwnerMap.UNKNOWN_OWNER_ID);
 +  }
 +
 +  private static int[] getNewSource(boolean isGlue, HyperEdge edge) {
 +    Rule rule = edge.getRule();
 +    int[] english = rule.getTarget();
 +    // if this is a unary abstract rule, just return null
 +    // TODO: except glue rules!
 +    if (english.length == 1 && english[0] < 0 && !isGlue) return null;
 +    int[] result = new int[english.length];
 +    for (int i = 0; i < english.length; i++) {
 +      int curr = english[i];
 +      if (! FormatUtils.isNonterminal(curr)) {
 +        // If it's a terminal symbol, we just copy it into the new rule.
 +        result[i] = curr;
 +      } else {
 +        // If it's a nonterminal, its value is -N, where N is the index
 +        // of the nonterminal on the source side.
 +        //
 +        // That is, if we would call a nonterminal "[X,2]", the value of
 +        // curr at this point is -2. And the tail node that it points at
 +        // is #1 (since getTailNodes() is 0-indexed).
 +        int index = -curr - 1;
 +        result[i] = getLabelWithSpan(edge.getTailNodes().get(index));
 +      }
 +    }
 +    // System.err.printf("source: %s\n", result);
 +    return result;
 +  }
 +
 +  private static int[] getNewTargetFromSource(int[] source) {
 +    int[] result = new int[source.length];
 +    int currNT = -1; // value to stick into NT slots
 +    for (int i = 0; i < source.length; i++) {
 +      result[i] = source[i];
 +      if (FormatUtils.isNonterminal(result[i])) {
 +        result[i] = currNT;
 +        currNT--;
 +      }
 +    }
 +    // System.err.printf("target: %s\n", result);
 +    return result;
 +  }
 +
 +  private static HGNode getGoalSymbolNode(HGNode root) {
 +    if (root.hyperedges == null || root.hyperedges.size() == 0) {
 +      LOG.error("getGoalSymbolNode: root node has no hyperedges");
 +      return null;
 +    }
 +    return root.hyperedges.get(0).getTailNodes().get(0);
 +  }
 +
 +
 +  public static int goalSymbol(HyperGraph hg) {
 +    if (hg.goalNode == null) {
 +      LOG.error("goalSymbol: goalNode of hypergraph is null");
 +      return -1;
 +    }
 +    HGNode symbolNode = getGoalSymbolNode(hg.goalNode);
 +    if (symbolNode == null) return -1;
 +    // System.err.printf("goalSymbol: %s\n", result);
 +    // System.err.printf("symbol node LHS is %d\n", symbolNode.lhs);
 +    // System.err.printf("i = %d, j = %d\n", symbolNode.i, symbolNode.j);
 +    return getLabelWithSpan(symbolNode);
 +  }
 +
 +  public Grammar getGrammar() {
 +    return grammar;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
index 695cad5,0000000..c353a36
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
@@@ -1,331 -1,0 +1,311 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.ArrayList;
 +import java.util.Comparator;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +
 +/**
 + * this class implement Hypergraph node (i.e., HGNode); also known as Item in parsing.
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Juri Ganitkevitch, juri@cs.jhu.edu
 + */
 +
 +// TODO: handle the case that the Hypergraph only maintains the one-best tree
 +
 +public class HGNode {
 +
-   public int i, j;
++  public final int i;
++  public final int j;
 +
 +  // this is the symbol like: NP, VP, and so on
-   public int lhs;
++  public final int lhs;
 +
 +  // each hyperedge is an "and" node
 +  public List<HyperEdge> hyperedges = null;
 +
 +  // used in pruning, compute_item, and transit_to_goal
 +  public HyperEdge bestHyperedge = null;
 +
 +  // the key is the state id; remember the state required by each model, for example, edge-ngrams
 +  // for LM model
-   protected List<DPState> dpStates;
++  protected final List<DPState> dpStates;
 +
 +  private Signature signature = null;
 +//  private int hash = 0;
 +
 +  protected float score = 0.0f;
 +
 +  // ===============================================================
 +  // Constructors
 +  // ===============================================================
 +
 +  public HGNode(int i, int j, int lhs, List<DPState> dpStates, HyperEdge hyperEdge,
 +      float pruningEstimate) {
 +    this.lhs = lhs;
 +    this.i = i;
 +    this.j = j;
 +    this.dpStates = dpStates;
 +    this.score = pruningEstimate;
 +    addHyperedgeInNode(hyperEdge);
 +  }
 +
 +  // used by disk hg
 +  public HGNode(int i, int j, int lhs, List<HyperEdge> hyperedges, HyperEdge bestHyperedge,
 +      List<DPState> states) {
 +    this.i = i;
 +    this.j = j;
 +    this.lhs = lhs;
 +    this.hyperedges = hyperedges;
 +    this.bestHyperedge = bestHyperedge;
 +    this.dpStates = states;
 +  }
 +
 +  // ===============================================================
 +  // Methods
 +  // ===============================================================
 +
 +  public float getScore() {
 +    return this.score;
 +  }
 +  
 +  /**
 +   * Adds the hyperedge to the list of incoming hyperedges (i.e., ways to form this node), creating
 +   * the list if necessary. We then update the cache of the best incoming hyperedge via a call to
 +   * the (obscurely named) semiringPlus().
 +   * @param hyperEdge the {@link org.apache.joshua.decoder.hypergraph.HyperEdge} to add
 +   * to the list of incoming hyperedges
 +   */
 +  public void addHyperedgeInNode(HyperEdge hyperEdge) {
 +    if (hyperEdge != null) {
 +      if (null == hyperedges)
-         hyperedges = new ArrayList<HyperEdge>();
++        hyperedges = new ArrayList<>();
 +      hyperedges.add(hyperEdge);
 +      // Update the cache of this node's best incoming edge.
 +      semiringPlus(hyperEdge);
 +    }
 +  }
 +
 +  /**
 +   * Convenience function to add a list of hyperedges one at a time.
 +   * @param hyperedges a {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HyperEdge}'s
 +   * to add to the current HGNode.
 +   */
 +  public void addHyperedgesInNode(List<HyperEdge> hyperedges) {
-     for (HyperEdge hyperEdge : hyperedges)
-       addHyperedgeInNode(hyperEdge);
++    hyperedges.forEach(this::addHyperedgeInNode);
 +  }
 +
 +  /**
 +   * Updates the cache of the best incoming hyperedge.
 +   * @param hyperEdge an incoming {{@link org.apache.joshua.decoder.hypergraph.HyperEdge}
 +   */
 +  public void semiringPlus(HyperEdge hyperEdge) {
 +    if (null == bestHyperedge || bestHyperedge.getBestDerivationScore() < hyperEdge.getBestDerivationScore()) {
 +      bestHyperedge = hyperEdge;
 +    }
 +  }
 +
 +  public List<DPState> getDPStates() {
 +    return dpStates;
 +  }
 +
 +  public DPState getDPState(int i) {
 +    if (null == this.dpStates) {
 +      return null;
 +    } else {
 +      return this.dpStates.get(i);
 +    }
 +  }
 +
 +  public Signature signature() {
 +    if (signature == null)
 +      signature = new Signature();
 +    return signature;
 +  }
 +  
 +  /*
 +   * Including hashCode() and equals() directly in the class causes problems, because the 
 +   * virtual node table (in KBestExtractor) does not combine HGNodes.
 +   */
 +//  @Override
 +//  public int hashCode() {
 +//    if (hash == 0) {
 +//      hash = 31 * lhs + 2399 * i + 7853 * j;
 +//      if (null != dpStates && dpStates.size() > 0)
 +//        for (DPState dps : dpStates)
 +//          hash = hash * 19 + dps.hashCode();
 +//    }
 +//    return hash;
 +//  }
 +//
 +//  @Override
 +//  public boolean equals(Object other) {
 +//    if (other instanceof HGNode) {
 +//      HGNode that = (HGNode) other;
 +//      if (lhs != that.lhs)
 +//        return false;
 +//      if (i != that.i || j != that.j)
 +//        return false;
 +//      if (bestHyperedge == null && that.bestHyperedge != null)
 +//        return false;
 +//      if (bestHyperedge != null && that.bestHyperedge == null)
 +//        return false;
 +//      if (score != that.score)
 +//        return false;
 +//      if (dpStates == null)
 +//        return (that.dpStates == null);
 +//      if (that.dpStates == null)
 +//        return false;
 +//      if (dpStates.size() != that.dpStates.size())
 +//        return false;
 +//      for (int i = 0; i < dpStates.size(); i++) {
 +//        if (!dpStates.get(i).equals(that.dpStates.get(i)))
 +//          return false;
 +//      }
 +//      return true;
 +//    }
 +//    return false;
 +//  }
 +
 +  /***
 +   * We have different purposes when hashing HGNodes. For dynamic programming, we want to establish
 +   * equivalency based on dynamic programming state, but when doing k-best extraction, we need
 +   * to maintain a separate entry for every object. The Signature class provides a way to hash
 +   * based on the dynamic programming state.
 +   */
 +  public class Signature {
 +    // Cached hash code.
 +    private int hash = 0;
 +
 +    @Override
 +    public int hashCode() {
 +      if (hash == 0) {
 +        hash = 31 * lhs;
 +        if (null != dpStates && dpStates.size() > 0)
 +          for (DPState dps : dpStates)
 +            hash = hash * 19 + dps.hashCode();
 +      }
 +      return hash;
 +    }
 +
 +    @Override
 +    public boolean equals(Object other) {
 +      if (other instanceof Signature) {
 +        HGNode that = ((Signature) other).node();
 +        if (lhs != that.lhs)
 +          return false;
 +        if (i != that.i || j != that.j)
 +          return false;
 +        if (dpStates == null)
 +          return (that.dpStates == null);
 +        if (that.dpStates == null)
 +          return false;
 +        if (dpStates.size() != that.dpStates.size())
 +          return false;
 +        for (int i = 0; i < dpStates.size(); i++) {
 +          if (!dpStates.get(i).equals(that.dpStates.get(i)))
 +            return false;
 +        }
 +        return true;
 +      }
 +      return false;
 +    }
 +
 +    public String toString() {
 +      return String.format("%d", hashCode());
 +    }
 +
 +    public HGNode node() {
 +      return HGNode.this;
 +    }
 +  }
 +
 +  /*
 +   * this will called by the sorting in Cell.ensureSorted()
 +   */
 +  // sort by estTotalLogP: for pruning purpose
 +  public int compareTo(HGNode anotherItem) {
-     throw new RuntimeException("HGNode, compare functiuon should never be called");
++    throw new RuntimeException("HGNode.compareTo(HGNode) is not implemented");
 +    /*
 +     * if (this.estTotalLogP > anotherItem.estTotalLogP) { return -1; } else if (this.estTotalLogP
 +     * == anotherItem.estTotalLogP) { return 0; } else { return 1; }
 +     */
- 
 +  }
 +
 +  /**
 +   * This sorts nodes by span, useful when dumping the hypergraph.
 +   */
 +  public static Comparator<HGNode> spanComparator = new Comparator<HGNode>() {
 +    public int compare(HGNode item1, HGNode item2) {
 +      int span1 = item1.j - item1.i;
 +      int span2 = item2.j - item2.i;
 +      if (span1 < span2)
 +        return -1;
 +      else if (span1 > span2)
 +        return 1;
 +      else if (item1.i < item2.i)
 +        return -1;
 +      else if (item1.i > item2.i)
 +        return 1;
 +      return 0;
 +    }
 +  };
 +
-   public static Comparator<HGNode> inverseLogPComparator = new Comparator<HGNode>() {
-     public int compare(HGNode item1, HGNode item2) {
-       float logp1 = item1.score;
-       float logp2 = item2.score;
-       if (logp1 > logp2) {
-         return -1;
-       } else if (logp1 == logp2) {
-         return 0;
-       } else {
-         return 1;
-       }
-     }
-   };
- 
-   /**
-    * natural order
-    * */
-   public static Comparator<HGNode> logPComparator = new Comparator<HGNode>() {
-     public int compare(HGNode item1, HGNode item2) {
-       float logp1 = item1.score;
-       float logp2 = item2.score;
-       if (logp1 > logp2) {
-         return 1;
-       } else if (logp1 == logp2) {
-         return 0;
-       } else {
-         return -1;
-       }
++  public static final Comparator<HGNode> inverseLogPComparator = (item1, item2) -> {
++    float logp1 = item1.score;
++    float logp2 = item2.score;
++    if (logp1 > logp2) {
++      return -1;
++    } else if (logp1 == logp2) {
++      return 0;
++    } else {
++      return 1;
 +    }
 +  };
 +
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +
 +    sb.append(String.format("%s (%d,%d) score=%.5f", Vocabulary.word(lhs), i, j,
 +        bestHyperedge.getBestDerivationScore()));
 +    if (dpStates != null)
 +      for (DPState state : dpStates)
-         sb.append(" <" + state + ">");
++        sb.append(" <").append(state).append(">");
 +
 +    // if (this.hyperedges != null) {
 +    // sb.append(" hyperedges: " + hyperedges.size());
 +    // for (HyperEdge edge: hyperedges) {
 +    // sb.append("\n\t" + edge.getRule() + " ||| pathcost=" + edge.getSourcePath() + " ref="+
 +    // Integer.toHexString(edge.hashCode()));
 +    // }
 +    // }
 +
 +    // sb.append("\n\ttransition score = " + bestHyperedge.getTransitionLogP(true));
 +    return sb.toString();
 +  }
 +
 +  public List<HyperEdge> getHyperEdges() {
 +    return this.hyperedges;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperEdge.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperEdge.java
index b188650,0000000..a55dac6
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperEdge.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperEdge.java
@@@ -1,101 -1,0 +1,99 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.chart_parser.SourcePath;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +
 +/**
 + * this class implement Hyperedge
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +
 +public class HyperEdge {
 +
 +  /**
 +   * the 1-best logP of all possible derivations: best logP of ant hgnodes + transitionlogP
 +   **/
 +  private float bestDerivationScore = Float.NEGATIVE_INFINITY;
 +
 +  /**
 +   * this remembers the stateless + non_stateless logP assocated with the rule (excluding the
 +   * best-logP from ant nodes)
 +   * */
 +  private float transitionScore;
 +
-   private Rule rule;
++  private final Rule rule;
 +
 +  private SourcePath srcPath = null;
 +
 +  /**
 +   * If antNodes is null, then this edge corresponds to a rule with zero arity. Aslo, the nodes
 +   * appear in the list as per the index of the Foreign side non-terminal
 +   * */
 +  private List<HGNode> tailNodes = null;
 +
 +  public HyperEdge(Rule rule, float bestDerivationScore, float transitionScore,
 +      List<HGNode> tailNodes, SourcePath srcPath) {
 +    this.bestDerivationScore = bestDerivationScore;
 +    this.transitionScore = transitionScore;
 +    this.rule = rule;
 +    this.tailNodes = tailNodes;
 +    this.srcPath = srcPath;
 +  }
 +
 +  public Rule getRule() {
 +    return rule;
 +  }
 +  
 +  public float getBestDerivationScore() {
 +    return bestDerivationScore;
 +  }
 +
 +  public SourcePath getSourcePath() {
 +    return srcPath;
 +  }
 +
 +  public List<HGNode> getTailNodes() {
 +    return tailNodes;
 +  }
 +
 +  public float getTransitionLogP(boolean forceCompute) {
 +    if (forceCompute) {
 +      float res = bestDerivationScore;
 +      if (tailNodes != null) for (HGNode tailNode : tailNodes) {
 +        res += tailNode.bestHyperedge.bestDerivationScore;
 +      }
 +      transitionScore = res;
 +    }
 +    return transitionScore;
 +  }
 +
 +  public void setTransitionLogP(float transitionLogP) {
 +    this.transitionScore = transitionLogP;
 +  }
 +
 +  public String toString() {
-     StringBuilder sb = new StringBuilder();
-     sb.append(this.rule);
-     return sb.toString();
++    return String.valueOf(this.rule);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraph.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraph.java
index 3c4c3bb,0000000..77cd770
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraph.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraph.java
@@@ -1,163 -1,0 +1,161 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.io.IOException;
 +import java.io.PrintWriter;
 +
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.hypergraph.ForestWalker.TRAVERSAL;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * this class implement (1) HyperGraph-related data structures (Item and Hyper-edges)
 + * 
 + * Note: to seed the kbest extraction, each deduction should have the best_cost properly set. We do
 + * not require any list being sorted
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +public class HyperGraph {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(HyperGraph.class);
 +
 +  // pointer to goal HGNode
 +  public HGNode goalNode = null;
 +
 +  public int numNodes = -1;
 +  public int numEdges = -1;
 +  public Sentence sentence = null;
 +
 +  public HyperGraph(HGNode goalNode, int numNodes, int numEdges, Sentence sentence) {
 +    this.goalNode = goalNode;
 +    this.numNodes = numNodes;
 +    this.numEdges = numEdges;
 +    this.sentence = sentence;
 +  }
 +  
 +  public void count() {
 +    new ForestWalker().walk(this.goalNode, new HyperGraphCounter(this));
 +  }
 +  
 +  public int sentID() {
 +    return sentence.id();
 +  }
 +  
 +  public int sentLen() {
 +    return sentence.length();
 +  }
 +  
 +  private class HyperGraphCounter implements WalkerFunction {
 +
 +    private HyperGraph hg = null;
 +    private HashSet<HGNode> nodesVisited = null;
 +    
 +    public HyperGraphCounter(HyperGraph hg) {
 +      this.hg = hg;
 +      this.hg.numNodes = 0;
 +      this.hg.numEdges = 0;
-       this.nodesVisited = new HashSet<HGNode>();
++      this.nodesVisited = new HashSet<>();
 +    }
 +    
 +    @Override
 +    public void apply(HGNode node, int index) {
 +      if (! nodesVisited.contains(node)) {
 +        if (node.bestHyperedge.getRule() != null) {
 +          hg.numNodes++;
 +          if (node.hyperedges != null)
 +            hg.numEdges += node.hyperedges.size();
 +        }
 +      }
 +    }
 +  }
 +
 +  private class HyperGraphDumper implements WalkerFunction {
 +
 +    private int node_number = 1;
 +    private List<FeatureFunction> model = null;
 +    private PrintWriter out = null;
 +    
-     private HashMap<HGNode, Integer> nodeMap;
++    private final HashMap<HGNode, Integer> nodeMap;
 +    
 +    public HyperGraphDumper(PrintWriter out, List<FeatureFunction> model) {
 +      this.out = out;
 +      this.model = model;
-       this.nodeMap = new HashMap<HGNode, Integer>();
++      this.nodeMap = new HashMap<>();
 +    }
 +    
 +    @Override
 +    public void apply(HGNode node, int index) {
 +      if (! nodeMap.containsKey(node)) { // Make sure each node is listed only once
 +        nodeMap.put(node,  this.node_number);
 +
 +        if (node.hyperedges.size() != 0 && node.bestHyperedge.getRule() != null) {
 +          out.println(this.node_number);
-           for (HyperEdge e: node.hyperedges) {
-             if (e.getRule() != null) {
-               for (int id: e.getRule().getTarget()) {
-                 if (id < 0) {
-                   out.print(String.format("[%d] ", nodeMap.get(e.getTailNodes().get(-id-1))));
-                 } else {
-                   out.print(String.format("%s ", Vocabulary.word(id)));
-                 }
++          node.hyperedges.stream().filter(e -> e.getRule() != null).forEach(e -> {
++            for (int id : e.getRule().getTarget()) {
++              if (id < 0) {
++                out.print(String.format("[%d] ", nodeMap.get(e.getTailNodes().get(-id - 1))));
++              } else {
++                out.print(String.format("%s ", Vocabulary.word(id)));
 +              }
- 
-               FeatureVector edgeFeatures = ComputeNodeResult.computeTransitionFeatures(
-                   model, e, node.i, node.j, sentence);
-               out.println(String.format("||| %s", edgeFeatures));
 +            }
-           }
++
++            FeatureVector edgeFeatures = ComputeNodeResult
++                .computeTransitionFeatures(model, e, node.i, node.j, sentence);
++            out.println(String.format("||| %s", edgeFeatures));
++          });
 +        }
 +        
 +        this.node_number++;
 +      }
 +    }
 +  }
 +  
 +  /**
 +   * Dump the hypergraph to the specified file.
 +   * 
 +   * @param fileName local file path
 +   * @param model {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   */
 +  public void dump(String fileName, List<FeatureFunction> model) {
 +    try ( PrintWriter out = new PrintWriter(fileName, "UTF-8") ) {
 +      count();
 +      out.println("# target ||| features");
 +      out.println(String.format("%d %d", numNodes, numEdges));
 +      new ForestWalker(TRAVERSAL.POSTORDER).walk(this.goalNode, new HyperGraphDumper(out, model));
 +    } catch (IOException e) {
 +      LOG.error("Can't dump hypergraph to file '{}'", fileName);
 +      LOG.error(e.getMessage(), e);
 +    }
 +  }
 +
 +  public float bestScore() {
 +    return this.goalNode.bestHyperedge.getBestDerivationScore();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraphPruning.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraphPruning.java
index 51bd9d6,0000000..8f67f1b
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraphPruning.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/HyperGraphPruning.java
@@@ -1,176 -1,0 +1,175 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.HashMap;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +
 +/**
 + * during the pruning process, many Item/Deductions may not be explored at all due to the early-stop
 + * in pruning_deduction
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @version $LastChangedDate$
 + */
 +public class HyperGraphPruning extends TrivialInsideOutside {
 +
-   HashMap<HGNode, Boolean> processedNodesTbl = new HashMap<HGNode, Boolean>();
++  final HashMap<HGNode, Boolean> processedNodesTbl = new HashMap<>();
 +  double bestLogProb;// viterbi unnormalized log prob in the hypergraph
 +
 +  boolean ViterbiPruning = false;// Viterbi or Posterior pruning
 +
 +  boolean fixThresholdPruning = true;
 +  double THRESHOLD_GENERAL = 10;// if the merit is worse than the best_log_prob by this number, then
 +                                // prune
 +  double THRESHOLD_GLUE = 10;// if the merit is worse than the best_log_prob by this number, then
 +                             // prune
 +
 +  int numSurvivedEdges = 0;
 +  int numSurvivedNodes = 0;
 +
 +  int glueGrammarOwner = 0;// TODO
 +
 +
 +  public HyperGraphPruning(boolean fixThreshold, double thresholdGeneral, double thresholdGlue) {
 +    fixThresholdPruning = fixThreshold;
 +    THRESHOLD_GENERAL = thresholdGeneral;
 +    THRESHOLD_GLUE = thresholdGlue;
 +    glueGrammarOwner = Vocabulary.id("glue");// TODO
 +  }
 +
 +  public void clearState() {
 +    processedNodesTbl.clear();
 +    super.clearState();
 +  }
 +
 +
 +  // ######################### pruning here ##############
 +  public void pruningHG(HyperGraph hg) {
 +
 +    runInsideOutside(hg, 2, 1, 1.0);// viterbi-max, log-semiring
 +
 +    if (fixThresholdPruning) {
 +      pruningHGHelper(hg);
 +      super.clearState();
 +    } else {
 +      throw new RuntimeException("wrong call");
 +    }
 +  }
 +
 +  private void pruningHGHelper(HyperGraph hg) {
 +
 +    this.bestLogProb = getLogNormalizationConstant();// set the best_log_prob
 +
 +    numSurvivedEdges = 0;
 +    numSurvivedNodes = 0;
 +    processedNodesTbl.clear();
 +    pruningNode(hg.goalNode);
 +
 +    // clear up
 +    processedNodesTbl.clear();
 +
 +    System.out.println("Item suvived ratio: " + numSurvivedNodes * 1.0 / hg.numNodes + " =  "
 +        + numSurvivedNodes + "/" + hg.numNodes);
 +    System.out.println("Deduct suvived ratio: " + numSurvivedEdges * 1.0 / hg.numEdges + " =  "
 +        + numSurvivedEdges + "/" + hg.numEdges);
 +  }
 +
 +
 +  private void pruningNode(HGNode it) {
 +
 +    if (processedNodesTbl.containsKey(it)) return;
 +
 +    processedNodesTbl.put(it, true);
 +    boolean shouldSurvive = false;
 +
 +    // ### recursive call on each deduction
 +    for (int i = 0; i < it.hyperedges.size(); i++) {
 +      HyperEdge dt = it.hyperedges.get(i);
 +      boolean survived = pruningEdge(dt, it);// deduction-specifc operation
 +      if (survived) {
 +        shouldSurvive = true; // at least one deduction survive
 +      } else {
 +        it.hyperedges.remove(i);
 +        i--;
 +      }
 +    }
 +    // TODO: now we simply remove the pruned deductions, but in general, we may want to update the
 +    // variables mainted in the item (e.g., best_deduction); this depends on the pruning method used
 +
 +    /*
 +     * by defintion: "should_surive==false" should be impossible, since if I got called, then my
 +     * upper-deduction must survive, then i will survive because there must be one way to reach me
 +     * from lower part in order for my upper-deduction survive
 +     */
 +    if (!shouldSurvive) {
 +      throw new RuntimeException("item explored but does not survive");
 +      // TODO: since we always keep the best_deduction, this should never be true
 +    } else {
 +      numSurvivedNodes++;
 +    }
 +  }
 +
 +
 +  // if survive, return true
 +  // best-deduction is always kept
 +  private boolean pruningEdge(HyperEdge dt, HGNode parent) {
 +
 +    /**
 +     * TODO: theoretically, if an item is get called, then its best deduction should always be kept
 +     * even just by the threshold-checling. In reality, due to precision of Double, the
 +     * threshold-checking may not be perfect
 +     */
 +    if (dt != parent.bestHyperedge) { // best deduction should always survive if the Item is get
 +                                      // called
 +      // ### prune?
 +      if (shouldPruneHyperedge(dt, parent)) {
 +        return false; // early stop
 +      }
 +    }
 +
 +    // ### still survive, recursive call all my ant-items
 +    if (null != dt.getTailNodes()) {
-       for (HGNode ant_it : dt.getTailNodes()) {
-         pruningNode(ant_it); // recursive call on each ant item, note: the ant_it will not be pruned
-                              // as I need it
-       }
++      // recursive call on each ant item, note: the ant_it will not be pruned
++      // as I need it
++      dt.getTailNodes().forEach(this::pruningNode);
 +    }
 +
 +    // ### if get to here, then survive; remember: if I survive, then my upper-item must survive
 +    numSurvivedEdges++;
 +    return true; // survive
 +  }
 +
 +  private boolean shouldPruneHyperedge(HyperEdge dt, HGNode parent) {
 +
 +    // ### get merit
 +    double postLogProb = getEdgeUnormalizedPosteriorLogProb(dt, parent);
 +
 +
 +    if (dt.getRule() != null && dt.getRule().getOwner().equals(glueGrammarOwner)
 +        && dt.getRule().getArity() == 2) { // specicial rule: S->S X
 +      // TODO
 +      return (postLogProb - this.bestLogProb < THRESHOLD_GLUE);
 +    } else {
 +      return (postLogProb - this.bestLogProb < THRESHOLD_GENERAL);
 +    }
 +  }
 +
 +}


[40/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/ArraySyntaxTree.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/syntax/ArraySyntaxTree.java
index f374279,0000000..10efdc6
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/ArraySyntaxTree.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/ArraySyntaxTree.java
@@@ -1,411 -1,0 +1,412 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus.syntax;
 +
 +import java.io.Externalizable;
 +import java.io.IOException;
 +import java.io.ObjectInput;
 +import java.io.ObjectOutput;
 +import java.util.ArrayList;
 +import java.util.Collection;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.Map;
 +import java.util.Set;
 +import java.util.Stack;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.util.io.LineReader;
 +
 +public class ArraySyntaxTree implements SyntaxTree, Externalizable {
 +
 +  /**
 +   * Note that index stores the indices of lattice node positions, i.e. the last element of index is
 +   * the terminal node, pointing to lattice.size()
 +   */
 +  private ArrayList<Integer> forwardIndex;
 +  private ArrayList<Integer> forwardLattice;
 +  private ArrayList<Integer> backwardIndex;
 +  private ArrayList<Integer> backwardLattice;
 +
 +  private ArrayList<Integer> terminals;
 +
-   private boolean useBackwardLattice = true;
++  private final boolean useBackwardLattice = true;
 +
 +  private static final int MAX_CONCATENATIONS = 3;
 +  private static final int MAX_LABELS = 100;
 +
 +  public ArraySyntaxTree() {
 +    forwardIndex = null;
 +    forwardLattice = null;
 +    backwardIndex = null;
 +    backwardLattice = null;
 +
 +    terminals = null;
 +  }
 +
 +
 +  public ArraySyntaxTree(String parsed_line) {
 +    initialize();
 +    appendFromPennFormat(parsed_line);
 +  }
 +
 +
 +  /**
 +   * Returns a collection of single-non-terminal labels that exactly cover the specified span in the
 +   * lattice.
 +   */
 +  public Collection<Integer> getConstituentLabels(int from, int to) {
-     Collection<Integer> labels = new HashSet<Integer>();
++    Collection<Integer> labels = new HashSet<>();
 +    int span_length = to - from;
 +    for (int i = forwardIndex.get(from); i < forwardIndex.get(from + 1); i += 2) {
 +      int current_span = forwardLattice.get(i + 1);
 +      if (current_span == span_length)
 +        labels.add(forwardLattice.get(i));
 +      else if (current_span < span_length) break;
 +    }
 +    return labels;
 +  }
 +
 +
 +  public int getOneConstituent(int from, int to) {
 +    int spanLength = to - from;
-     Stack<Integer> stack = new Stack<Integer>();
++    Stack<Integer> stack = new Stack<>();
 +
 +    for (int i = forwardIndex.get(from); i < forwardIndex.get(from + 1); i += 2) {
 +      int currentSpan = forwardLattice.get(i + 1);
 +      if (currentSpan == spanLength) {
 +        return forwardLattice.get(i);
 +      } else if (currentSpan < spanLength) break;
 +    }
 +    if (stack.isEmpty()) return 0;
 +    StringBuilder sb = new StringBuilder();
 +    while (!stack.isEmpty()) {
 +      String w = Vocabulary.word(stack.pop());
 +      if (sb.length() != 0) sb.append(":");
 +      sb.append(w);
 +    }
 +    String label = sb.toString();
 +    return Vocabulary.id(adjustMarkup(label));
 +  }
 +
 +
 +  public int getOneSingleConcatenation(int from, int to) {
 +    for (int midpt = from + 1; midpt < to; midpt++) {
 +      int x = getOneConstituent(from, midpt);
 +      if (x == 0) continue;
 +      int y = getOneConstituent(midpt, to);
 +      if (y == 0) continue;
 +      String label = Vocabulary.word(x) + "+" + Vocabulary.word(y);
 +      return Vocabulary.id(adjustMarkup(label));
 +    }
 +    return 0;
 +  }
 +
 +
 +  public int getOneDoubleConcatenation(int from, int to) {
 +    for (int a = from + 1; a < to - 1; a++) {
 +      for (int b = a + 1; b < to; b++) {
 +        int x = getOneConstituent(from, a);
 +        if (x == 0) continue;
 +        int y = getOneConstituent(a, b);
 +        if (y == 0) continue;
 +        int z = getOneConstituent(b, to);
 +        if (z == 0) continue;
 +        String label = Vocabulary.word(x) + "+" + Vocabulary.word(y) + "+" + Vocabulary.word(z);
 +        return Vocabulary.id(adjustMarkup(label));
 +      }
 +    }
 +    return 0;
 +  }
 +
 +
 +  public int getOneRightSideCCG(int from, int to) {
 +    for (int end = to + 1; end <= forwardLattice.size(); end++) {
 +      int x = getOneConstituent(from, end);
 +      if (x == 0) continue;
 +      int y = getOneConstituent(to, end);
 +      if (y == 0) continue;
 +      String label = Vocabulary.word(x) + "/" + Vocabulary.word(y);
 +      return Vocabulary.id(adjustMarkup(label));
 +    }
 +    return 0;
 +  }
 +
 +
 +  public int getOneLeftSideCCG(int from, int to) {
 +    for (int start = from - 1; start >= 0; start--) {
 +      int x = getOneConstituent(start, to);
 +      if (x == 0) continue;
 +      int y = getOneConstituent(start, from);
 +      if (y == 0) continue;
 +      String label = Vocabulary.word(y) + "\\" + Vocabulary.word(x);
 +      return Vocabulary.id(adjustMarkup(label));
 +    }
 +    return 0;
 +  }
 +
 +
 +  /**
 +   * Returns a collection of concatenated non-terminal labels that exactly cover the specified span
 +   * in the lattice. The number of non-terminals concatenated is limited by MAX_CONCATENATIONS and
 +   * the total number of labels returned is bounded by MAX_LABELS.
 +   */
 +  public Collection<Integer> getConcatenatedLabels(int from, int to) {
-     Collection<Integer> labels = new HashSet<Integer>();
++    Collection<Integer> labels = new HashSet<>();
 +
 +    int span_length = to - from;
-     Stack<Integer> nt_stack = new Stack<Integer>();
-     Stack<Integer> pos_stack = new Stack<Integer>();
-     Stack<Integer> depth_stack = new Stack<Integer>();
++    Stack<Integer> nt_stack = new Stack<>();
++    Stack<Integer> pos_stack = new Stack<>();
++    Stack<Integer> depth_stack = new Stack<>();
 +
 +    // seed stacks (reverse order to save on iterations, longer spans)
 +    for (int i = forwardIndex.get(from + 1) - 2; i >= forwardIndex.get(from); i -= 2) {
 +      int current_span = forwardLattice.get(i + 1);
 +      if (current_span < span_length) {
 +        nt_stack.push(forwardLattice.get(i));
 +        pos_stack.push(from + current_span);
 +        depth_stack.push(1);
 +      } else if (current_span >= span_length) break;
 +    }
 +
 +    while (!nt_stack.isEmpty() && labels.size() < MAX_LABELS) {
 +      int nt = nt_stack.pop();
 +      int pos = pos_stack.pop();
 +      int depth = depth_stack.pop();
 +
 +      // maximum depth reached without filling span
 +      if (depth == MAX_CONCATENATIONS) continue;
 +
 +      int remaining_span = to - pos;
 +      for (int i = forwardIndex.get(pos + 1) - 2; i >= forwardIndex.get(pos); i -= 2) {
 +        int current_span = forwardLattice.get(i + 1);
 +        if (current_span > remaining_span) break;
 +
 +        // create and look up concatenated label
 +        int concatenated_nt =
 +            Vocabulary.id(adjustMarkup(Vocabulary.word(nt) + "+"
 +                + Vocabulary.word(forwardLattice.get(i))));
 +        if (current_span < remaining_span) {
 +          nt_stack.push(concatenated_nt);
 +          pos_stack.push(pos + current_span);
 +          depth_stack.push(depth + 1);
 +        } else if (current_span == remaining_span) {
 +          labels.add(concatenated_nt);
 +        }
 +      }
 +    }
 +
 +    return labels;
 +  }
 +
 +  // TODO: can pre-comupute all that in top-down fashion.
 +  public Collection<Integer> getCcgLabels(int from, int to) {
-     Collection<Integer> labels = new HashSet<Integer>();
++    Collection<Integer> labels = new HashSet<>();
 +
 +    int span_length = to - from;
 +    // TODO: range checks on the to and from
 +
 +    boolean is_prefix = (forwardLattice.get(forwardIndex.get(from) + 1) > span_length);
 +    if (is_prefix) {
-       Map<Integer, Set<Integer>> main_constituents = new HashMap<Integer, Set<Integer>>();
++      Map<Integer, Set<Integer>> main_constituents = new HashMap<>();
 +      // find missing to the right
 +      for (int i = forwardIndex.get(from); i < forwardIndex.get(from + 1); i += 2) {
 +        int current_span = forwardLattice.get(i + 1);
 +        if (current_span <= span_length)
 +          break;
 +        else {
 +          int end_pos = forwardLattice.get(i + 1) + from;
 +          Set<Integer> nts = main_constituents.get(end_pos);
-           if (nts == null) main_constituents.put(end_pos, new HashSet<Integer>());
++          if (nts == null) main_constituents.put(end_pos, new HashSet<>());
 +          main_constituents.get(end_pos).add(forwardLattice.get(i));
 +        }
 +      }
 +      for (int i = forwardIndex.get(to); i < forwardIndex.get(to + 1); i += 2) {
 +        Set<Integer> main_set = main_constituents.get(to + forwardLattice.get(i + 1));
 +        if (main_set != null) {
 +          for (int main : main_set)
 +            labels.add(Vocabulary.id(adjustMarkup(Vocabulary.word(main) + "/"
 +                + Vocabulary.word(forwardLattice.get(i)))));
 +        }
 +      }
 +    }
 +
 +    if (!is_prefix) {
 +      if (useBackwardLattice) {
 +        // check if there is any possible higher-level constituent overlapping
 +        int to_end =
 +            (to == backwardIndex.size() - 1) ? backwardLattice.size() : backwardIndex.get(to + 1);
 +        // check longest span ending in to..
 +        if (backwardLattice.get(to_end - 1) <= span_length) return labels;
 +
-         Map<Integer, Set<Integer>> main_constituents = new HashMap<Integer, Set<Integer>>();
++        Map<Integer, Set<Integer>> main_constituents = new HashMap<>();
 +        // find missing to the left
 +        for (int i = to_end - 2; i >= backwardIndex.get(to); i -= 2) {
 +          int current_span = backwardLattice.get(i + 1);
 +          if (current_span <= span_length)
 +            break;
 +          else {
 +            int start_pos = to - backwardLattice.get(i + 1);
 +            Set<Integer> nts = main_constituents.get(start_pos);
-             if (nts == null) main_constituents.put(start_pos, new HashSet<Integer>());
++            if (nts == null) main_constituents.put(start_pos, new HashSet<>());
 +            main_constituents.get(start_pos).add(backwardLattice.get(i));
 +          }
 +        }
 +        for (int i = backwardIndex.get(from); i < backwardIndex.get(from + 1); i += 2) {
 +          Set<Integer> main_set = main_constituents.get(from - backwardLattice.get(i + 1));
 +          if (main_set != null) {
 +            for (int main : main_set)
 +              labels.add(Vocabulary.id(adjustMarkup(Vocabulary.word(main) + "\\"
 +                  + Vocabulary.word(backwardLattice.get(i)))));
 +          }
 +        }
 +      } else {
 +        // TODO: bothersome no-backwards-arrays method.
 +      }
 +    }
 +    return labels;
 +  }
 +
 +  @Override
 +  public int[] getTerminals() {
 +    return getTerminals(0, terminals.size());
 +  }
 +
 +  @Override
 +  public int[] getTerminals(int from, int to) {
 +    int[] span = new int[to - from];
 +    for (int i = from; i < to; i++)
 +      span[i - from] = terminals.get(i);
 +    return span;
 +  }
 +
 +  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
 +    // TODO Auto-generated method stub
 +  }
 +
 +  public void writeExternal(ObjectOutput out) throws IOException {
 +    // TODO Auto-generated method stub
 +  }
 +
 +  /**
 +   * Reads Penn Treebank format file
 +   * @param file_name the string path of the Penn Treebank file
 +   * @throws IOException if the file does not exist
 +   */
 +  public void readExternalText(String file_name) throws IOException {
 +    LineReader reader = new LineReader(file_name);
 +    initialize();
 +    for (String line : reader) {
 +      if (line.trim().equals("")) continue;
 +      appendFromPennFormat(line);
 +    }
 +  }
 +
 +  public void writeExternalText(String file_name) throws IOException {
 +    // TODO Auto-generated method stub
 +  }
 +
 +  @Override
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    for (int i = 0; i < forwardIndex.size(); i++)
-       sb.append("FI[" + i + "] =\t" + forwardIndex.get(i) + "\n");
++      sb.append("FI[").append(i).append("] =\t").append(forwardIndex.get(i)).append("\n");
 +    sb.append("\n");
 +    for (int i = 0; i < forwardLattice.size(); i += 2)
-       sb.append("F[" + i + "] =\t" + Vocabulary.word(forwardLattice.get(i)) + " , "
-           + forwardLattice.get(i + 1) + "\n");
++      sb.append("F[").append(i).append("] =\t").append(Vocabulary.word(forwardLattice.get(i)))
++          .append(" , ").append(forwardLattice.get(i + 1)).append("\n");
 +
 +    sb.append("\n");
 +    for (int i = 0; i < terminals.size(); i += 1)
-       sb.append("T[" + i + "] =\t" + Vocabulary.word(terminals.get(i)) + " , 1 \n");
++      sb.append("T[").append(i).append("] =\t").append(Vocabulary.word(terminals.get(i)))
++          .append(" , 1 \n");
 +
 +    if (this.useBackwardLattice) {
 +      sb.append("\n");
 +      for (int i = 0; i < backwardIndex.size(); i++)
-         sb.append("BI[" + i + "] =\t" + backwardIndex.get(i) + "\n");
++        sb.append("BI[").append(i).append("] =\t").append(backwardIndex.get(i)).append("\n");
 +      sb.append("\n");
 +      for (int i = 0; i < backwardLattice.size(); i += 2)
-         sb.append("B[" + i + "] =\t" + Vocabulary.word(backwardLattice.get(i)) + " , "
-             + backwardLattice.get(i + 1) + "\n");
++        sb.append("B[").append(i).append("] =\t").append(Vocabulary.word(backwardLattice.get(i)))
++            .append(" , ").append(backwardLattice.get(i + 1)).append("\n");
 +    }
 +    return sb.toString();
 +  }
 +
 +
 +  private void initialize() {
-     forwardIndex = new ArrayList<Integer>();
++    forwardIndex = new ArrayList<>();
 +    forwardIndex.add(0);
-     forwardLattice = new ArrayList<Integer>();
++    forwardLattice = new ArrayList<>();
 +    if (this.useBackwardLattice) {
-       backwardIndex = new ArrayList<Integer>();
++      backwardIndex = new ArrayList<>();
 +      backwardIndex.add(0);
-       backwardLattice = new ArrayList<Integer>();
++      backwardLattice = new ArrayList<>();
 +    }
 +
-     terminals = new ArrayList<Integer>();
++    terminals = new ArrayList<>();
 +  }
 +
 +
 +  // TODO: could make this way more efficient
 +  private void appendFromPennFormat(String line) {
 +    String[] tokens = line.replaceAll("\\(", " ( ").replaceAll("\\)", " ) ").trim().split("\\s+");
 +
 +    boolean next_nt = false;
 +    int current_id = 0;
-     Stack<Integer> stack = new Stack<Integer>();
++    Stack<Integer> stack = new Stack<>();
 +
 +    for (String token : tokens) {
 +      if ("(".equals(token)) {
 +        next_nt = true;
 +        continue;
 +      }
 +      if (")".equals(token)) {
 +        int closing_pos = stack.pop();
 +        forwardLattice.set(closing_pos, forwardIndex.size() - forwardLattice.get(closing_pos));
 +        if (this.useBackwardLattice) {
 +          backwardLattice.add(forwardLattice.get(closing_pos - 1));
 +          backwardLattice.add(forwardLattice.get(closing_pos));
 +        }
 +        continue;
 +      }
 +      if (next_nt) {
 +        // get NT id
 +        current_id = Vocabulary.id(adjustMarkup(token));
 +        // add into lattice
 +        forwardLattice.add(current_id);
 +        // push NT span field onto stack (added hereafter, we're just saving the "- 1")
 +        stack.push(forwardLattice.size());
 +        // add NT span field
 +        forwardLattice.add(forwardIndex.size());
 +      } else {
 +        current_id = Vocabulary.id(token);
 +        terminals.add(current_id);
 +
 +        forwardIndex.add(forwardLattice.size());
 +        if (this.useBackwardLattice) backwardIndex.add(backwardLattice.size());
 +      }
 +      next_nt = false;
 +    }
 +  }
 +
 +  private String adjustMarkup(String nt) {
 +    return "[" + nt.replaceAll("[\\[\\]]", "") + "]";
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/SyntaxTree.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/syntax/SyntaxTree.java
index 6bb4c0b,0000000..f96cd2c
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/SyntaxTree.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/syntax/SyntaxTree.java
@@@ -1,34 -1,0 +1,34 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus.syntax;
 +
 +import java.util.Collection;
 +
 +public interface SyntaxTree {
 +
-   public Collection<Integer> getConstituentLabels(int from, int to);
++  Collection<Integer> getConstituentLabels(int from, int to);
 +
-   public Collection<Integer> getConcatenatedLabels(int from, int to);
++  Collection<Integer> getConcatenatedLabels(int from, int to);
 +
-   public Collection<Integer> getCcgLabels(int from, int to);
++  Collection<Integer> getCcgLabels(int from, int to);
 +
-   public int[] getTerminals();
++  int[] getTerminals();
 +
-   public int[] getTerminals(int from, int to);
++  int[] getTerminals(int from, int to);
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ArgsParser.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ArgsParser.java
index 5af6d11,0000000..26ed674
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ArgsParser.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ArgsParser.java
@@@ -1,118 -1,0 +1,116 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.io.IOException;
 +import java.nio.charset.Charset;
 +import java.nio.file.Files;
 +import java.nio.file.Paths;
 +
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * @author orluke
 + * 
 + */
 +public class ArgsParser {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(ArgsParser.class);
 +
 +  private String configFile = null;
 +
 +  /**
 +   * Parse the arguments passed from the command line when the JoshuaDecoder application was
 +   * executed from the command line.
 +   * 
 +   * @param args string array of input arguments
 +   * @param config the {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   * @throws IOException if there is an error wit the input arguments
 +   */
 +  public ArgsParser(String[] args, JoshuaConfiguration config) throws IOException {
 +
 +    /*
 +     * Look for a verbose flag, -v.
 +     * 
 +     * Look for an argument to the "-config" flag to find the config file, if any. 
 +     */
 +    if (args.length >= 1) {
 +      // Search for a verbose flag
 +      for (int i = 0; i < args.length; i++) {
 +        if (args[i].equals("-v")) {
 +          Decoder.VERBOSE = Integer.parseInt(args[i + 1].trim());
 +          config.setVerbosity(Decoder.VERBOSE);
 +        }
 +      
 +        if (args[i].equals("-version")) {
 +          LineReader reader = new LineReader(String.format("%s/VERSION", System.getenv("JOSHUA")));
 +          reader.readLine();
 +          String version = reader.readLine().split("\\s+")[2];
 +          System.out.println(String.format("The Apache Joshua machine translator, version %s", version));
 +          System.out.println("joshua.incubator.apache.org");
 +          System.exit(0);
 +
 +        } else if (args[i].equals("-license")) {
 +          try {
-             for (String line: Files.readAllLines(Paths.get(String.format("%s/../LICENSE", 
-                 JoshuaConfiguration.class.getProtectionDomain().getCodeSource().getLocation().getPath())), 
-                 Charset.defaultCharset())) {
-               System.out.println(line);
-             }
++            Files.readAllLines(Paths.get(String.format("%s/../LICENSE",
++                JoshuaConfiguration.class.getProtectionDomain().getCodeSource().getLocation()
++                    .getPath())), Charset.defaultCharset()).forEach(System.out::println);
 +          } catch (IOException e) {
 +            throw new RuntimeException("FATAL: missing license file!", e);
 +          }
 +          System.exit(0);
 +        }
 +      }
 +
 +      // Search for the configuration file from the end (so as to take the last one)
 +      for (int i = args.length-1; i >= 0; i--) {
 +        if (args[i].equals("-c") || args[i].equals("-config")) {
 +
 +          setConfigFile(args[i + 1].trim());
 +          try {
 +            LOG.info("Parameters read from configuration file: {}", getConfigFile());
 +            config.readConfigFile(getConfigFile());
 +          } catch (IOException e) {
 +            throw new RuntimeException(e);
 +          }
 +          break;
 +        }
 +      }
 +
 +      // Now process all the command-line args
 +      config.processCommandLineOptions(args);
 +    }
 +  }
 +
 +  /**
 +   * @return the configFile
 +   */
 +  public String getConfigFile() {
 +    return configFile;
 +  }
 +
 +  /**
 +   * @param configFile the configFile to set
 +   */
 +  public void setConfigFile(String configFile) {
 +    this.configFile = configFile;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/BLEU.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/BLEU.java
index a6e02b2,0000000..6eb45ae
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/BLEU.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/BLEU.java
@@@ -1,562 -1,0 +1,562 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Map.Entry;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.state_maintenance.NgramDPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.util.Ngram;
 +import org.apache.joshua.util.Regex;
 +
 +/**
 + * this class implements: (1) sentence-level bleu, with smoothing
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +public class BLEU {
 +  // do_ngram_clip: consider global n-gram clip
 +
 +  public static float computeSentenceBleu(String[] refSents, String hypSent) {
 +    return computeSentenceBleu(refSents, hypSent, true, 4, false);
 +  }
 +
 +  // ====================multiple references
 +  /**
 +   * 
 +   * @param refSents todo
 +   * @param hypSent todo
 +   * @param doNgramClip Should usually be true
 +   * @param bleuOrder Should usually be 4
 +   * @param useShortestRef Probably use false
 +   * @return todo
 +   */
 +  public static float computeSentenceBleu(String[] refSents, String hypSent, boolean doNgramClip,
 +      int bleuOrder, boolean useShortestRef) {
 +    // === ref tbl
 +    HashMap<String, Integer> maxRefCountTbl = constructMaxRefCountTable(refSents, bleuOrder);
 +
 +    // == ref len
 +    int[] refLens = new int[refSents.length];
 +    for (int i = 0; i < refSents.length; i++) {
 +      String[] refWords = Regex.spaces.split(refSents[i]);
 +      refLens[i] = refWords.length;
 +    }
 +
 +    float effectiveRefLen = computeEffectiveLen(refLens, useShortestRef);
 +
 +    // === hyp tbl
 +    String[] hypWrds = Regex.spaces.split(hypSent);
-     HashMap<String, Integer> hypNgramTbl = new HashMap<String, Integer>();
++    HashMap<String, Integer> hypNgramTbl = new HashMap<>();
 +    Ngram.getNgrams(hypNgramTbl, 1, bleuOrder, hypWrds);
 +    return computeSentenceBleu(effectiveRefLen, maxRefCountTbl, hypWrds.length, hypNgramTbl,
 +        doNgramClip, bleuOrder);
 +  }
 +
 +  public static float computeEffectiveLen(int[] refLens, boolean useShortestRef) {
 +    if (useShortestRef) {
 +      int res = Integer.MAX_VALUE;
-       for (int i = 0; i < refLens.length; i++)
-         if (refLens[i] < res)
-           res = refLens[i];
++      for (int refLen : refLens)
++        if (refLen < res)
++          res = refLen;
 +      return res;
 +    } else {// default is average length
 +      float res = 0;
-       for (int i = 0; i < refLens.length; i++)
-         res += refLens[i];
++      for (int refLen : refLens)
++        res += refLen;
 +      return res * 1.0f / refLens.length;
 +    }
 +  }
 +
 +  /**
 +   * words in the ngrams are using integer symbol ID
 +   * @param refSents todo
 +   * @param bleuOrder todo
 +   * @return todo
 +   * */
 +  public static HashMap<String, Integer> constructMaxRefCountTable(String[] refSents, int bleuOrder) {
 +
-     List<HashMap<String, Integer>> listRefNgramTbl = new ArrayList<HashMap<String, Integer>>();
-     for (int i = 0; i < refSents.length; i++) {
++    List<HashMap<String, Integer>> listRefNgramTbl = new ArrayList<>();
++    for (String refSent : refSents) {
 +      // if(refSents[i]==null){System.out.println("null ref sent"); System.exit(1);}
 +      // String[] refWords = refSents[i].split("\\s+");
-       String[] refWords = Regex.spaces.split(refSents[i]);
++      String[] refWords = Regex.spaces.split(refSent);
 +
-       HashMap<String, Integer> refNgramTbl = new HashMap<String, Integer>();
++      HashMap<String, Integer> refNgramTbl = new HashMap<>();
 +      Ngram.getNgrams(refNgramTbl, 1, bleuOrder, refWords);
 +      listRefNgramTbl.add(refNgramTbl);
 +    }
 +
 +    return computeMaxRefCountTbl(listRefNgramTbl);
 +  }
 +
 +  /**
 +   * compute max_ref_count for each ngram in the reference sentences
 +   * @param listRefNgramTbl todo
 +   * @return todo
 +   * */
 +  public static HashMap<String, Integer> computeMaxRefCountTbl(
 +      List<HashMap<String, Integer>> listRefNgramTbl) {
 +
-     HashMap<String, Integer> merged = new HashMap<String, Integer>();
++    HashMap<String, Integer> merged = new HashMap<>();
 +
 +    // == get merged key set
 +    for (HashMap<String, Integer> tbl : listRefNgramTbl) {
 +      for (String ngram : tbl.keySet()) {
 +        merged.put(ngram, 0);
 +      }
 +    }
 +
 +    // == get max ref count
 +    for (String ngram : merged.keySet()) {
 +      int max = 0;
 +      for (HashMap<String, Integer> tbl : listRefNgramTbl) {
 +        Integer val = tbl.get(ngram);
 +        if (val != null && val > max)
 +          max = val;
 +      }
 +
 +      merged.put(ngram, max);
 +    }
 +    return merged;
 +  }
 +
 +  public static float computeSentenceBleu(float effectiveRefLen,
 +      HashMap<String, Integer> maxRefCountTbl, int hypLen, HashMap<String, Integer> hypNgramTbl,
 +      boolean doNgramClip, int bleuOrder) {
 +
 +    float resBleu = 0.0f;
 +
 +    int[] numNgramMatch = new int[bleuOrder];
 +    for (Map.Entry<String, Integer> entry : hypNgramTbl.entrySet()) {// each ngram in hyp
 +      String ngram = entry.getKey();
 +      if (maxRefCountTbl.containsKey(ngram)) {
 +        int hypNgramCount = entry.getValue();
 +
 +        int effectiveNumMatch = hypNgramCount;
 +
 +        if (doNgramClip) {// min{hypNgramCount, maxRefCount}
 +          int maxRefCount = maxRefCountTbl.get(ngram);
 +          effectiveNumMatch = (int) Support.findMin(hypNgramCount, maxRefCount); // ngram clip;
 +        }
 +
 +        numNgramMatch[Regex.spaces.split(ngram).length - 1] += effectiveNumMatch;
 +      }
 +    }
 +
 +    resBleu = computeBleu(hypLen, effectiveRefLen, numNgramMatch, bleuOrder);
 +    // System.out.println("hyp_len: " + hyp_sent.length + "; ref_len:" + ref_sent.length +
 +    // "; bleu: " + res_bleu +" num_ngram_matches: " + num_ngram_match[0] + " " +num_ngram_match[1]+
 +    // " " + num_ngram_match[2] + " " +num_ngram_match[3]);
 +    // System.out.println("Blue is " + res_bleu);
 +    return resBleu;
 +  }
 +
 +  // ==============================multiple references end
 +
 +  public static float computeSentenceBleu(String refSent, String hypSent, boolean doNgramClip,
 +      int bleuOrder) {
 +    String[] refWrds = Regex.spaces.split(refSent);
 +    String[] hypWrds = Regex.spaces.split(hypSent);
-     HashMap<String, Integer> refNgramTbl = new HashMap<String, Integer>();
++    HashMap<String, Integer> refNgramTbl = new HashMap<>();
 +    Ngram.getNgrams(refNgramTbl, 1, bleuOrder, refWrds);
-     HashMap<String, Integer> hypNgramTbl = new HashMap<String, Integer>();
++    HashMap<String, Integer> hypNgramTbl = new HashMap<>();
 +    Ngram.getNgrams(hypNgramTbl, 1, bleuOrder, hypWrds);
 +    return computeSentenceBleu(refWrds.length, refNgramTbl, hypWrds.length, hypNgramTbl,
 +        doNgramClip, bleuOrder);
 +  }
 +
 +  public static float computeSentenceBleu(int refLen, HashMap<String, Integer> refNgramTbl,
 +      int hypLen, HashMap<String, Integer> hypNgramTbl, boolean doNgramClip, int bleuOrder) {
 +    float resBleu = 0;
 +
 +    int[] numNgramMatch = new int[bleuOrder];
 +    for (Map.Entry<String, Integer> entry : hypNgramTbl.entrySet()) {
 +      String ngram = entry.getKey();
 +      if (refNgramTbl.containsKey(ngram)) {
 +        if (doNgramClip) {
 +          numNgramMatch[Regex.spaces.split(ngram).length - 1] += Support.findMin(
 +              refNgramTbl.get(ngram), entry.getValue()); // ngram clip
 +        } else {
 +          numNgramMatch[Regex.spaces.split(ngram).length - 1] += entry.getValue();// without ngram count clipping
 +        }
 +      }
 +    }
 +    resBleu = computeBleu(hypLen, refLen, numNgramMatch, bleuOrder);
 +    // System.out.println("hyp_len: " + hyp_sent.length + "; ref_len:" + ref_sent.length +
 +    // "; bleu: " + res_bleu +" num_ngram_matches: " + num_ngram_match[0] + " " +num_ngram_match[1]+
 +    // " " + num_ngram_match[2] + " " +num_ngram_match[3]);
 +    // System.out.println("Blue is " + res_bleu);
 +    return resBleu;
 +  }
 +
 +  // sentence-bleu: BLEU= bp * prec; where prec = exp (sum 1/4 * log(prec[order]))
 +  public static float computeBleu(int hypLen, float refLen, int[] numNgramMatch, int bleuOrder) {
 +    if (hypLen <= 0 || refLen <= 0) {
 +      throw new RuntimeException("error: ref or hyp is zero len");
 +    }
 +    float res = 0;
 +    float wt = 1.0f / bleuOrder;
 +    float prec = 0;
 +    float smooth_factor = 1.0f;
 +    for (int t = 0; t < bleuOrder && t < hypLen; t++) {
 +      if (numNgramMatch[t] > 0) {
 +        prec += wt * Math.log(numNgramMatch[t] * 1.0 / (hypLen - t));
 +      } else {
 +        smooth_factor *= 0.5;// TODO
 +        prec += wt * Math.log(smooth_factor / (hypLen - t));
 +      }
 +    }
 +    float bp = (hypLen >= refLen) ? 1.0f : (float) Math.exp(1 - refLen / hypLen);
 +    res = bp * (float) Math.exp(prec);
 +    // System.out.println("hyp_len: " + hyp_len + "; ref_len:" + ref_len + "prec: " + Math.exp(prec)
 +    // + "; bp: " + bp + "; bleu: " + res);
 +    return res;
 +  }
 +
 +  public static HashMap<String, Integer> constructNgramTable(String sentence, int bleuOrder) {
-     HashMap<String, Integer> ngramTable = new HashMap<String, Integer>();
++    HashMap<String, Integer> ngramTable = new HashMap<>();
 +    String[] refWrds = Regex.spaces.split(sentence);
 +    Ngram.getNgrams(ngramTable, 1, bleuOrder, refWrds);
 +    return ngramTable;
 +  }
 +
 +  // ================================ Google linear corpus gain
 +  // ============================================
 +  public static float computeLinearCorpusGain(float[] linearCorpusGainThetas, String[] refSents,
 +      String hypSent) {
 +    int bleuOrder = 4;
 +    int hypLength = Regex.spaces.split(hypSent).length;
 +    HashMap<String, Integer> refereceNgramTable = BLEU.constructMaxRefCountTable(refSents,
 +        bleuOrder);
 +    HashMap<String, Integer> hypNgramTable = BLEU.constructNgramTable(hypSent, bleuOrder);
 +    return computeLinearCorpusGain(linearCorpusGainThetas, hypLength, hypNgramTable,
 +        refereceNgramTable);
 +  }
 +
 +  /**
 +   * speed consideration: assume hypNgramTable has a smaller size than referenceNgramTable does
 +   * @param linearCorpusGainThetas todo
 +   * @param hypLength todo
 +   * @param hypNgramTable todo
 +   * @param referenceNgramTable todo
 +   * @return todo
 +   */
 +  public static float computeLinearCorpusGain(float[] linearCorpusGainThetas, int hypLength,
 +      Map<String, Integer> hypNgramTable, Map<String, Integer> referenceNgramTable) {
 +    float res = 0;
 +    res += linearCorpusGainThetas[0] * hypLength;
 +    for (Entry<String, Integer> entry : hypNgramTable.entrySet()) {
 +      String ngram = entry.getKey();
 +      if (referenceNgramTable.containsKey(ngram)) {// delta function
 +        int ngramOrder = Regex.spaces.split(ngram).length;
 +        res += entry.getValue() * linearCorpusGainThetas[ngramOrder];
 +      }
 +    }
 +    return res;
 +  }
 +
 +  /* Convenience function */
 +  public static int[] computeNgramMatches(String[] refSents, String hypSent) {
 +    int bleuOrder = 4;
 +    int hypLength = Regex.spaces.split(hypSent).length;
 +    HashMap<String, Integer> refereceNgramTable = BLEU.constructMaxRefCountTable(refSents,
 +        bleuOrder);
 +    HashMap<String, Integer> hypNgramTable = BLEU.constructNgramTable(hypSent, bleuOrder);
 +    return computeNgramMatches(hypLength, hypNgramTable, refereceNgramTable, bleuOrder);
 +  }
 +
 +  public static int[] computeNgramMatches(int hypLength, Map<String, Integer> hypNgramTable,
 +      Map<String, Integer> referenceNgramTable, int highestOrder) {
 +    int[] res = new int[highestOrder + 1];
 +    res[0] = hypLength;
 +    for (Entry<String, Integer> entry : hypNgramTable.entrySet()) {
 +      String ngram = entry.getKey();
 +      if (referenceNgramTable.containsKey(ngram)) {// delta function
 +        int ngramOrder = Regex.spaces.split(ngram).length;
 +        res[ngramOrder] += entry.getValue();
 +      }
 +    }
 +
 +    /*
 +    System.err.print("NGRAMS:");
 +    for (String ngram: hypNgramTable.keySet())
 +      System.err.print(" | " + ngram);
 +    System.err.println();
 +    System.err.print("REF:");
 +    for (String ngram: referenceNgramTable.keySet())
 +      System.err.print(" | " + ngram);
 +    System.err.println();
 +    System.err.print("COUNTS:");
 +    for (int i = 1; i <= 4; i++)
 +      System.err.print(" " + res[i]);
 +    System.err.println();
 +    */
 +
 +    return res;
 +  }
 +
 +  static public float[] computeLinearCorpusThetas(int numUnigramTokens, float unigramPrecision,
 +      float decayRatio) {
 +    float[] res = new float[5];
 +    res[0] = -1.0f / numUnigramTokens;
 +    for (int i = 1; i < 5; i++)
 +      res[i] = (1.0f / (4.0f * numUnigramTokens * unigramPrecision * (float) Math.pow(decayRatio,
 +          i - 1)));
 +
 +    float firstWeight = res[0];
 +    for (int i = 0; i < 5; i++)
 +      res[i] /= Math.abs(firstWeight);// normalize by first one
 +
 +    System.out.print("Normalized Thetas are: ");
 +    for (int i = 0; i < 5; i++)
 +      System.out.print(res[i] + " ");
 +    System.out.print("\n");
 +
 +    return res;
 +  }
 +
 +  public static final int maxOrder = 4;
 +
 +  /**
 +   * Computes BLEU statistics incurred by a rule. This is (a) all ngram (n &lt;= 4) for terminal rules
 +   * and (b) all ngrams overlying boundary points between terminals in the rule and ngram state from
 +   * tail nodes.
 +   * 
 +   * There are four cases to handle:
 +   * <ul>
 +   * <li>only words
 +   * <li>a number of words followed by a nonterminal (left context of tail tail node)
 +   * <li>a nonterminal (right context of tail node) followed by one or more words
 +   * <li>two nonterminals (right context of tail node 1, left context of tail node 2)
 +   * </ul>
 +   * 
 +   * Of these, all but the first have a boundary point to consider.
 +   * 
 +   * @param edge todo
 +   * @param spanPct todo
 +   * @param references the reference to compute statistics against
 +   * @return todo
 +   */
 +  public static Stats compute(HyperEdge edge, float spanPct, References references) {
 +    Stats stats = new Stats();
 +    // TODO: this should not be the span width, but the real ref scaled to the span percentage
 +    stats.reflen = (int) (spanPct * references.reflen);
 +
 +    Rule rule = edge.getRule();
 +    if (rule != null) {
 +      int[] symbols = rule.getTarget();
 +
 +//      System.err.println(String.format("compute(%s)", rule));
 +      
-       ArrayList<Integer> currentNgram = new ArrayList<Integer>();
++      ArrayList<Integer> currentNgram = new ArrayList<>();
 +      int boundary = -1;
 +      int tailIndex = -1;
-       for (int i = 0; i < symbols.length; i++) {
-         if (symbols[i] < 0) {
++      for (int symbol : symbols) {
++        if (symbol < 0) {
 +          tailIndex++;
 +
 +          NgramDPState ngramState = null;
 +          try {
 +            ngramState = (NgramDPState) edge.getTailNodes().get(tailIndex).getDPState(0);
 +          } catch (ClassCastException e) {
-             throw new RuntimeException(String.format(
-                 "* FATAL: first state needs to be NgramDPState (found %s)", edge.getTailNodes()
-                     .get(tailIndex).getDPState(0).getClass()));
++            throw new RuntimeException(String
++                .format("* FATAL: first state needs to be NgramDPState (found %s)",
++                    edge.getTailNodes().get(tailIndex).getDPState(0).getClass()));
 +          }
-           
++
 +          // Compute ngrams overlapping with left context of tail node
 +          if (currentNgram.size() > 0) {
 +            boundary = currentNgram.size();
 +            for (int id : ngramState.getLeftLMStateWords())
 +              currentNgram.add(id);
 +
 +            // Compute the BLEU statistics
-             BLEU.Stats partStats = computeOverDivide(currentNgram, references, boundary);
++            Stats partStats = computeOverDivide(currentNgram, references, boundary);
 +            stats.add(partStats);
-             
- //            System.err.println("    " + Vocabulary.getWords(ngramState.getLeftLMStateWords()));
++
++            //            System.err.println("    " + Vocabulary.getWords(ngramState.getLeftLMStateWords()));
 +
 +            currentNgram.clear();
 +          }
-           
- //          System.err.println("    " + Vocabulary.getWords(ngramState.getRightLMStateWords()));
++
++          //          System.err.println("    " + Vocabulary.getWords(ngramState.getRightLMStateWords()));
 +
 +          // Accumulate ngrams from right context of tail node
 +          for (int id : ngramState.getRightLMStateWords())
 +            currentNgram.add(id);
 +
 +          boundary = currentNgram.size();
 +
 +        } else { // terminal symbol
-           currentNgram.add(symbols[i]);
++          currentNgram.add(symbol);
 +          stats.len++;
 +
- //          System.err.println("    " + Vocabulary.word(symbols[i]));
-           
++          //          System.err.println("    " + Vocabulary.word(symbols[i]));
++
 +          if (boundary != -1) {
-             BLEU.Stats partStats = computeOverDivide(currentNgram, references, boundary);
++            Stats partStats = computeOverDivide(currentNgram, references, boundary);
 +            stats.add(partStats);
 +
 +            // Shift off the context from the nonterminal's righthand side
 +            for (int j = 0; j < boundary; j++)
 +              currentNgram.remove(0);
 +            boundary = -1;
 +          }
 +        }
 +
 +        /*
 +         * At the end, we might have (a) nothing, (b) a sequence of words from a nonterminal's
 +         * righthand side, (c) a sequence of words from the rule, or (d) a sequence of words from a
 +         * nonterminal's righthand context and from the rule
 +         */
 +        if (currentNgram.size() > 0 && currentNgram.size() != boundary) { // skip cases (a) and (b)
-           BLEU.Stats partStats = computeOverDivide(currentNgram, references, boundary);
++          Stats partStats = computeOverDivide(currentNgram, references, boundary);
 +          stats.add(partStats);
 +        }
 +      }
 +    }
 +    return stats;
 +  }
 +
 +  /**
 +   * When computing BLEU statistics over a rule, we need to avoid adding in ngrams that are
 +   * exclusively contained inside tail nodes. This function accumulates all the eligible ngrams from
 +   * a string respective of an optional boundary point, and then calls computeNgramMatches().
 +   * 
 +   * @param ngram the current set of ngrams
 +   * @param references contains the set of ngrams to compare against
 +   * @param boundary the boundary over which all ngrams must fall (-1 means ignore boundary)
 +   * @return
 +   */
 +  private static Stats computeOverDivide(ArrayList<Integer> ngram, References references,
 +      int boundary) {
 +    
 +//    System.err.print(String.format("      BOUNDARY(%s, %d)", Vocabulary.getWords(ngram), boundary));
 +
-     HashMap<String, Integer> boundaryNgrams = new HashMap<String, Integer>();
++    HashMap<String, Integer> boundaryNgrams = new HashMap<>();
 +    for (int width = 1; width <= Math.min(maxOrder, ngram.size()); width++) {
 +      for (int i = 0; i < ngram.size() - width + 1; i++) {
 +        int j = i + width;
 +
 +        final List<Integer> piece = ngram.subList(i, j);
 +        if (boundary == -1 || (boundary > i && boundary < j)) {
 +          String ngramStr = Vocabulary.getWords(piece);
 +          if (!boundaryNgrams.containsKey(ngramStr))
 +            boundaryNgrams.put(ngramStr, 1);
 +          else
 +            boundaryNgrams.put(ngramStr, boundaryNgrams.get(ngramStr));
 +        }
 +      }
 +    }
 +    
 +    /*
 +    System.err.print(" FOUND");
 +    for (String phr: boundaryNgrams.keySet())
 +      System.err.print(" | " + phr);
 +    System.err.println();
 +    */
 +
 +    BLEU.Stats result = new BLEU.Stats();
 +    int[] stats = BLEU.computeNgramMatches(0, boundaryNgrams, references.ngramCounts, maxOrder);
 +    System.arraycopy(stats, 1, result.counts, 0, maxOrder);
 +
 +    return result;
 +  }
 +
 +  public static class References {
 +    HashMap<String, Integer> ngramCounts;
 +    float reflen;
 +
 +    public References(String reference) {
 +      String[] refs = new String[1];
 +      refs[0] = reference;
 +      fill(refs);
 +    }
 +
 +    public References(String[] references) {
 +      fill(references);
 +    }
 +
 +    private void fill(String[] references) {
-       ngramCounts = new HashMap<String, Integer>();
++      ngramCounts = new HashMap<>();
 +      reflen = 0.0f;
-       for (int i = 0; i < references.length; i++) {
-         String[] ref = references[i].split(" ");
++      for (String reference : references) {
++        String[] ref = reference.split(" ");
 +        Ngram.getNgrams(ngramCounts, 1, maxOrder, ref);
 +        reflen += ref.length;
 +      }
 +      reflen /= references.length;
 +    }
 +  }
 +
 +  public static float score(Stats stats) {
 +    float score = 0f;
 +    float wt = 1.0f / maxOrder;
 +    float prec = 0;
 +    float smooth_factor = 1.0f;
 +    for (int t = 0; t < maxOrder && t < stats.len; t++) {
 +      if (stats.counts[t] > 0) {
 +        prec += wt * Math.log(stats.counts[t] * 1.0 / (stats.len - t));
 +      } else {
 +        smooth_factor *= 0.5;// TODO
 +        prec += wt * Math.log(smooth_factor / (stats.len - t));
 +      }
 +    }
 +    float bp = (stats.len >= stats.reflen) ? 1.0f : (float) Math.exp(1 - stats.reflen / stats.len);
 +    score = bp * (float) Math.exp(prec);
 +    
 +//    System.err.println(String.format("BLEU(%d %d %d %d / BP=%f) = %f", stats.counts[0], stats.counts[1], stats.counts[2], stats.counts[3], bp, score));
 +    return score;
 +  }
 +
 +  /**
 +   * Accumulated sufficient statistics for computing BLEU.
 +   */
 +  public static class Stats {
-     public int[] counts;
++    public final int[] counts;
 +    public float len;
 +    public float reflen;
 +
 +    public Stats() {
 +      counts = new int[4];
 +      len = 0.0f;
 +      reflen = 0.0f;
 +    }
 +
 +    public Stats(int[] counts, float len, float reflen) {
 +      this.counts = counts;
 +      this.len = len;
 +      this.reflen = reflen;
 +    }
 +
 +    public void add(Stats otherStats) {
 +      for (int i = 0; i < counts.length; i++)
 +        counts[i] += otherStats.counts[i];
 +      
 +      len += otherStats.len;
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
index 5b0ae0f,0000000..76ba021
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
@@@ -1,766 -1,0 +1,768 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +import static org.apache.joshua.decoder.ff.tm.OwnerMap.getOwner;
 +import static org.apache.joshua.util.Constants.spaceSeparator;
 +
 +import java.io.BufferedWriter;
 +import java.io.File;
 +import java.io.FileNotFoundException;
 +import java.io.IOException;
 +import java.lang.reflect.Constructor;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.List;
 +import java.util.Map.Entry;
 +import java.util.Set;
 +import java.util.concurrent.ArrayBlockingQueue;
 +import java.util.concurrent.BlockingQueue;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureMap;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.PhraseModel;
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.lm.LanguageModelFF;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.format.HieroFormatReader;
 +import org.apache.joshua.decoder.ff.tm.hash_based.MemoryBasedBatchGrammar;
 +import org.apache.joshua.decoder.ff.tm.packed.PackedGrammar;
 +import org.apache.joshua.decoder.io.TranslationRequestStream;
 +import org.apache.joshua.decoder.phrase.PhraseTable;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.FileUtility;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.Regex;
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import com.google.common.base.Strings;
 +
 +/**
 + * This class handles decoder initialization and the complication introduced by multithreading.
 + *
 + * After initialization, the main entry point to the Decoder object is
 + * decodeAll(TranslationRequest), which returns a set of Translation objects wrapped in an iterable
 + * Translations object. It is important that we support multithreading both (a) across the sentences
 + * within a request and (b) across requests, in a round-robin fashion. This is done by maintaining a
 + * fixed sized concurrent thread pool. When a new request comes in, a RequestParallelizer thread is
 + * launched. This object iterates over the request's sentences, obtaining a thread from the
 + * thread pool, and using that thread to decode the sentence. If a decoding thread is not available,
 + * it will block until one is in a fair (FIFO) manner. RequestParallelizer thereby permits intra-request
 + * parallelization by separating out reading the input stream from processing the translated sentences,
 + * but also ensures that round-robin parallelization occurs, since RequestParallelizer uses the
 + * thread pool before translating each request.
 + *
 + * A decoding thread is handled by DecoderThread and launched from DecoderThreadRunner. The purpose
 + * of the runner is to record where to place the translated sentence when it is done (i.e., which
 + * Translations object). Translations itself is an iterator whose next() call blocks until the next
 + * translation is available.
 + *
 + * @author Matt Post post@cs.jhu.edu
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author wren ng thornton wren@users.sourceforge.net
 + * @author Lane Schwartz dowobeha@users.sourceforge.net
 + */
 +public class Decoder {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Decoder.class);
 +
 +  private final JoshuaConfiguration joshuaConfiguration;
 +
 +  public JoshuaConfiguration getJoshuaConfiguration() {
 +    return joshuaConfiguration;
 +  }
 +
 +  /*
 +   * Many of these objects themselves are global objects. We pass them in when constructing other
 +   * objects, so that they all share pointers to the same object. This is good because it reduces
 +   * overhead, but it can be problematic because of unseen dependencies (for example, in the
 +   * Vocabulary shared by language model, translation grammar, etc).
 +   */
 +  private final List<Grammar> grammars = new ArrayList<Grammar>();
 +  private final ArrayList<FeatureFunction> featureFunctions = new ArrayList<>();
 +  private Grammar customPhraseTable = null;
 +
 +  /* The feature weights. */
 +  public static FeatureVector weights;
 +
 +  public static int VERBOSE = 1;
 +
 +  private BlockingQueue<DecoderThread> threadPool = null;
 +
 +  // ===============================================================
 +  // Constructors
 +  // ===============================================================
 +
 +  /**
 +   * Constructor method that creates a new decoder using the specified configuration file.
 +   *
 +   * @param joshuaConfiguration a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   * @param configFile name of configuration file.
 +   */
 +  public Decoder(JoshuaConfiguration joshuaConfiguration, String configFile) {
 +    this(joshuaConfiguration);
 +    this.initialize(configFile);
 +  }
 +
 +  /**
 +   * Factory method that creates a new decoder using the specified configuration file.
 +   *
 +   * @param configFile Name of configuration file.
 +   * @return a configured {@link org.apache.joshua.decoder.Decoder}
 +   */
 +  public static Decoder createDecoder(String configFile) {
 +    JoshuaConfiguration joshuaConfiguration = new JoshuaConfiguration();
 +    return new Decoder(joshuaConfiguration, configFile);
 +  }
 +
 +  /**
 +   * Constructs an uninitialized decoder for use in testing.
 +   * <p>
 +   * This method is private because it should only ever be called by the
 +   * {@link #getUninitalizedDecoder()} method to provide an uninitialized decoder for use in
 +   * testing.
 +   */
 +  private Decoder(JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    this.threadPool = new ArrayBlockingQueue<DecoderThread>(
 +        this.joshuaConfiguration.num_parallel_decoders, true);
++    this.customPhraseTable = null;
++    
++    resetGlobalState();
 +  }
 +
 +  /**
 +   * Gets an uninitialized decoder for use in testing.
 +   * <p>
 +   * This method is called by unit tests or any outside packages (e.g., MERT) relying on the
 +   * decoder.
 +   * @param joshuaConfiguration a {@link org.apache.joshua.decoder.JoshuaConfiguration} object
 +   * @return an uninitialized decoder for use in testing
 +   */
 +  static public Decoder getUninitalizedDecoder(JoshuaConfiguration joshuaConfiguration) {
 +    return new Decoder(joshuaConfiguration);
 +  }
 +
 +  // ===============================================================
 +  // Public Methods
 +  // ===============================================================
 +
 +  /**
 +   * This class is responsible for getting sentences from the TranslationRequest and procuring a
 +   * DecoderThreadRunner to translate it. Each call to decodeAll(TranslationRequest) launches a
 +   * thread that will read the request's sentences, obtain a DecoderThread to translate them, and
 +   * then place the Translation in the appropriate place.
 +   *
 +   * @author Matt Post <po...@cs.jhu.edu>
 +   *
 +   */
 +  private class RequestParallelizer extends Thread {
 +    /* Source of sentences to translate. */
 +    private final TranslationRequestStream request;
 +
 +    /* Where to put translated sentences. */
 +    private final Translations response;
 +
 +    RequestParallelizer(TranslationRequestStream request, Translations response) {
 +      this.request = request;
 +      this.response = response;
 +    }
 +
 +    @Override
 +    public void run() {
 +      /*
 +       * Repeatedly get an input sentence, wait for a DecoderThread, and then start a new thread to
 +       * translate the sentence. We start a new thread (via DecoderRunnerThread) as opposed to
 +       * blocking, so that the RequestHandler can go on to the next sentence in this request, which
 +       * allows parallelization across the sentences of the request.
 +       */
 +      for (;;) {
 +        Sentence sentence = request.next();
 +
 +        if (sentence == null) {
 +          response.finish();
 +          break;
 +        }
 +
 +        // This will block until a DecoderThread becomes available.
 +        DecoderThread thread = Decoder.this.getThread();
 +        new DecoderThreadRunner(thread, sentence, response).start();
 +      }
 +    }
 +
 +  }
 +
 +  /**
 +   * Retrieve a thread from the thread pool, blocking until one is available. The blocking occurs in
 +   * a fair fashion (i.e,. FIFO across requests).
 +   *
 +   * @return a thread that can be used for decoding.
 +   */
 +  public DecoderThread getThread() {
 +    try {
 +      return threadPool.take();
 +    } catch (InterruptedException e) {
 +      // TODO Auto-generated catch block
 +      e.printStackTrace();
 +    }
 +    return null;
 +  }
 +
 +  /**
 +   * This class handles running a DecoderThread (which takes care of the actual translation of an
 +   * input Sentence, returning a Translation object when its done). This is done in a thread so as
 +   * not to tie up the RequestHandler that launched it, freeing it to go on to the next sentence in
 +   * the TranslationRequest, in turn permitting parallelization across the sentences of a request.
 +   *
 +   * When the decoder thread is finshed, the Translation object is placed in the correct place in
 +   * the corresponding Translations object that was returned to the caller of
 +   * Decoder.decodeAll(TranslationRequest).
 +   *
 +   * @author Matt Post <po...@cs.jhu.edu>
 +   */
 +  private class DecoderThreadRunner extends Thread {
 +
 +    private final DecoderThread decoderThread;
 +    private final Sentence sentence;
 +    private final Translations translations;
 +
 +    DecoderThreadRunner(DecoderThread thread, Sentence sentence, Translations translations) {
 +      this.decoderThread = thread;
 +      this.sentence = sentence;
 +      this.translations = translations;
 +    }
 +
 +    @Override
 +    public void run() {
 +      /*
 +       * Process any found metadata.
 +       */
 +      
 +      /*
 +       * Use the thread to translate the sentence. Then record the translation with the
 +       * corresponding Translations object, and return the thread to the pool.
 +       */
 +      try {
 +        Translation translation = decoderThread.translate(this.sentence);
 +        translations.record(translation);
 +
 +        /*
 +         * This is crucial! It's what makes the thread available for the next sentence to be
 +         * translated.
 +         */
 +        threadPool.put(decoderThread);
 +      } catch (Exception e) {
 +        throw new RuntimeException(String.format(
 +            "Input %d: FATAL UNCAUGHT EXCEPTION: %s", sentence.id(), e.getMessage()), e);
 +        //        translations.record(new Translation(sentence, null, featureFunctions, joshuaConfiguration));
 +      }
 +    }
 +  }
 +
 +  /**
 +   * This function is the main entry point into the decoder. It translates all the sentences in a
 +   * (possibly boundless) set of input sentences. Each request launches its own thread to read the
 +   * sentences of the request.
 +   *
 +   * @param request the populated {@link org.apache.joshua.decoder.io.TranslationRequestStream}
 +   * @throws IOException if there is an error with the input stream or writing the output
 +   * @return an iterable, asynchronously-filled list of Translations
 +   */
 +  public Translations decodeAll(TranslationRequestStream request) throws IOException {
 +    Translations translations = new Translations(request);
 +
 +    /* Start a thread to handle requests on the input stream */
 +    new RequestParallelizer(request, translations).start();
 +
 +    return translations;
 +  }
 +
 +
 +  /**
 +   * We can also just decode a single sentence.
 +   *
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return the sentence {@link org.apache.joshua.decoder.Translation}
 +   */
 +  public Translation decode(Sentence sentence) {
 +    // Get a thread.
 +
 +    try {
 +      DecoderThread thread = threadPool.take();
 +      Translation translation = thread.translate(sentence);
 +      threadPool.put(thread);
 +
 +      return translation;
 +
 +    } catch (InterruptedException e) {
 +      e.printStackTrace();
 +    }
 +
 +    return null;
 +  }
 +
 +  /**
 +   * Clean shutdown of Decoder, resetting all
 +   * static variables, such that any other instance of Decoder
 +   * afterwards gets a fresh start.
 +   */
 +  public void cleanUp() {
 +    // shut down DecoderThreads
 +    for (DecoderThread thread : threadPool) {
 +      try {
 +        thread.join();
 +      } catch (InterruptedException e) {
 +        e.printStackTrace();
 +      }
 +    }
 +    resetGlobalState();
 +  }
 +
 +  public static void resetGlobalState() {
 +    // clear/reset static variables
 +    OwnerMap.clear();
 +    FeatureMap.clear();
 +    Vocabulary.clear();
 +    Vocabulary.unregisterLanguageModels();
 +    LanguageModelFF.resetLmIndex();
 +    StatefulFF.resetGlobalStateIndex();
 +  }
 +
 +  public static void writeConfigFile(double[] newWeights, String template, String outputFile,
 +      String newDiscriminativeModel) {
 +    try {
 +      int columnID = 0;
 +
 +      BufferedWriter writer = FileUtility.getWriteFileStream(outputFile);
 +      LineReader reader = new LineReader(template);
 +      try {
 +        for (String line : reader) {
 +          line = line.trim();
-           if (Regex.commentOrEmptyLine.matches(line) || line.indexOf("=") != -1) {
++          if (Regex.commentOrEmptyLine.matches(line) || line.contains("=")) {
 +            // comment, empty line, or parameter lines: just copy
 +            writer.write(line);
 +            writer.newLine();
 +
 +          } else { // models: replace the weight
 +            String[] fds = Regex.spaces.split(line);
 +            StringBuffer newSent = new StringBuffer();
 +            if (!Regex.floatingNumber.matches(fds[fds.length - 1])) {
 +              throw new IllegalArgumentException("last field is not a number; the field is: "
 +                  + fds[fds.length - 1]);
 +            }
 +
 +            if (newDiscriminativeModel != null && "discriminative".equals(fds[0])) {
 +              newSent.append(fds[0]).append(' ');
 +              newSent.append(newDiscriminativeModel).append(' ');// change the
 +              // file name
 +              for (int i = 2; i < fds.length - 1; i++) {
 +                newSent.append(fds[i]).append(' ');
 +              }
 +            } else {// regular
 +              for (int i = 0; i < fds.length - 1; i++) {
 +                newSent.append(fds[i]).append(' ');
 +              }
 +            }
 +            if (newWeights != null)
 +              newSent.append(newWeights[columnID++]);// change the weight
 +            else
 +              newSent.append(fds[fds.length - 1]);// do not change
 +
 +            writer.write(newSent.toString());
 +            writer.newLine();
 +          }
 +        }
 +      } finally {
 +        reader.close();
 +        writer.close();
 +      }
 +
 +      if (newWeights != null && columnID != newWeights.length) {
 +        throw new IllegalArgumentException("number of models does not match number of weights");
 +      }
 +
 +    } catch (IOException e) {
 +      e.printStackTrace();
 +    }
 +  }
 +
 +  // ===============================================================
 +  // Initialization Methods
 +  // ===============================================================
 +
 +  /**
 +   * Initialize all parts of the JoshuaDecoder.
 +   *
 +   * @param configFile File containing configuration options
 +   * @return An initialized decoder
 +   */
 +  public Decoder initialize(String configFile) {
 +    try {
 +
 +      long pre_load_time = System.currentTimeMillis();
 +
 +      /* Weights can be listed in a separate file (denoted by parameter "weights-file") or directly
 +       * in the Joshua config file. Config file values take precedent.
 +       */
 +      this.readWeights(joshuaConfiguration.weights_file);
 +      
 +      
 +      /* Add command-line-passed weights to the weights array for processing below */
 +      if (!Strings.isNullOrEmpty(joshuaConfiguration.weight_overwrite)) {
 +        String[] tokens = joshuaConfiguration.weight_overwrite.split("\\s+");
 +        for (int i = 0; i < tokens.length; i += 2) {
 +          String feature = tokens[i];
 +          float value = Float.parseFloat(tokens[i+1]);
 +
 +          if (joshuaConfiguration.moses)
 +            feature = demoses(feature);
 +
 +          joshuaConfiguration.weights.add(String.format("%s %s", feature, tokens[i+1]));
 +          LOG.info("COMMAND LINE WEIGHT: {} -> {}", feature, value);
 +        }
 +      }
 +
 +      /* Read the weights found in the config file */
 +      for (String pairStr: joshuaConfiguration.weights) {
 +        String pair[] = pairStr.split("\\s+");
 +
 +        /* Sanity check for old-style unsupported feature invocations. */
 +        if (pair.length != 2) {
-           StringBuilder errMsg = new StringBuilder();
-           errMsg.append("FATAL: Invalid feature weight line found in config file.\n");
-           errMsg.append(String.format("The line was '%s'\n", pairStr));
-           errMsg.append("You might be using an old version of the config file that is no longer supported\n");
-           errMsg.append("Check joshua.apache.org or email dev@joshua.apache.org for help\n");
-           errMsg.append("Code = " + 17);
-           throw new RuntimeException(errMsg.toString());
++          String errMsg = "FATAL: Invalid feature weight line found in config file.\n" +
++              String.format("The line was '%s'\n", pairStr) +
++              "You might be using an old version of the config file that is no longer supported\n" +
++              "Check joshua.apache.org or email dev@joshua.apache.org for help\n" +
++              "Code = " + 17;
++          throw new RuntimeException(errMsg);
 +        }
 +
 +        weights.add(hashFeature(pair[0]), Float.parseFloat(pair[1]));
 +      }
 +
 +      LOG.info("Read {} weights", weights.size());
 +
 +      // Do this before loading the grammars and the LM.
 +      this.featureFunctions.clear();
 +
 +      // Initialize and load grammars. This must happen first, since the vocab gets defined by
 +      // the packed grammar (if any)
 +      this.initializeTranslationGrammars();
 +      LOG.info("Grammar loading took: {} seconds.",
 +          (System.currentTimeMillis() - pre_load_time) / 1000);
 +
 +      // Initialize the features: requires that LM model has been initialized.
 +      this.initializeFeatureFunctions();
 +
 +      // This is mostly for compatibility with the Moses tuning script
 +      if (joshuaConfiguration.show_weights_and_quit) {
 +        for (Entry<Integer, Float> entry : weights.entrySet()) {
 +          System.out.println(String.format("%s=%.5f", FeatureMap.getFeature(entry.getKey()), entry.getValue()));
 +        }
 +        // TODO (fhieber): this functionality should not be in main Decoder class and simply exit.
 +        System.exit(0);
 +      }
 +
 +      // Sort the TM grammars (needed to do cube pruning)
 +      if (joshuaConfiguration.amortized_sorting) {
 +        LOG.info("Grammar sorting happening lazily on-demand.");
 +      } else {
 +        long pre_sort_time = System.currentTimeMillis();
 +        for (Grammar grammar : this.grammars) {
 +          grammar.sortGrammar(this.featureFunctions);
 +        }
 +        LOG.info("Grammar sorting took {} seconds.",
 +            (System.currentTimeMillis() - pre_sort_time) / 1000);
 +      }
 +
 +      // Create the threads
 +      for (int i = 0; i < joshuaConfiguration.num_parallel_decoders; i++) {
 +        this.threadPool.put(new DecoderThread(this.grammars, Decoder.weights,
 +            this.featureFunctions, joshuaConfiguration));
 +      }
 +    } catch (IOException | InterruptedException e) {
 +      LOG.warn(e.getMessage(), e);
 +    }
 +
 +    return this;
 +  }
 +
 +  /**
 +   * Initializes translation grammars Retained for backward compatibility
 +   *
 +   * @param ownersSeen Records which PhraseModelFF's have been instantiated (one is needed for each
 +   *          owner)
 +   * @throws IOException
 +   */
 +  private void initializeTranslationGrammars() throws IOException {
 +
 +    if (joshuaConfiguration.tms.size() > 0) {
 +
 +      // collect packedGrammars to check if they use a shared vocabulary
 +      final List<PackedGrammar> packed_grammars = new ArrayList<>();
 +
 +      // tm = {thrax/hiero,packed,samt,moses} OWNER LIMIT FILE
 +      for (String tmLine : joshuaConfiguration.tms) {
 +
 +        String type = tmLine.substring(0,  tmLine.indexOf(' '));
 +        String[] args = tmLine.substring(tmLine.indexOf(' ')).trim().split("\\s+");
 +        HashMap<String, String> parsedArgs = FeatureFunction.parseArgs(args);
 +
 +        String owner = parsedArgs.get("owner");
 +        int span_limit = Integer.parseInt(parsedArgs.get("maxspan"));
 +        String path = parsedArgs.get("path");
 +
 +        Grammar grammar = null;
 +        if (! type.equals("moses") && ! type.equals("phrase")) {
 +          if (new File(path).isDirectory()) {
 +            try {
 +              PackedGrammar packed_grammar = new PackedGrammar(path, span_limit, owner, type, joshuaConfiguration);
 +              packed_grammars.add(packed_grammar);
 +              grammar = packed_grammar;
 +            } catch (FileNotFoundException e) {
 +              String msg = String.format("Couldn't load packed grammar from '%s'", path)
 +                  + "Perhaps it doesn't exist, or it may be an old packed file format.";
 +              throw new RuntimeException(msg);
 +            }
 +          } else {
 +            // thrax, hiero, samt
 +            grammar = new MemoryBasedBatchGrammar(type, path, owner,
 +                joshuaConfiguration.default_non_terminal, span_limit, joshuaConfiguration);
 +          }
 +
 +        } else {
 +
 +          joshuaConfiguration.search_algorithm = "stack";
 +          grammar = new PhraseTable(path, owner, type, joshuaConfiguration);
 +        }
 +
 +        this.grammars.add(grammar);
 +      }
 +
 +      checkSharedVocabularyChecksumsForPackedGrammars(packed_grammars);
 +
 +    } else {
 +      LOG.warn("no grammars supplied!  Supplying dummy glue grammar.");
 +      MemoryBasedBatchGrammar glueGrammar = new MemoryBasedBatchGrammar("glue", joshuaConfiguration, -1);
 +      glueGrammar.addGlueRules(featureFunctions);
 +      this.grammars.add(glueGrammar);
 +    }
 +    
 +    /* Add the grammar for custom entries */
 +    if (joshuaConfiguration.search_algorithm.equals("stack"))
 +      this.customPhraseTable = new PhraseTable("custom", joshuaConfiguration);
 +    else
 +      this.customPhraseTable = new MemoryBasedBatchGrammar("custom", joshuaConfiguration, 20);
 +    this.grammars.add(this.customPhraseTable);
 +    
 +    /* Create an epsilon-deleting grammar */
 +    if (joshuaConfiguration.lattice_decoding) {
 +      LOG.info("Creating an epsilon-deleting grammar");
 +      MemoryBasedBatchGrammar latticeGrammar = new MemoryBasedBatchGrammar("lattice", joshuaConfiguration, -1);
 +      HieroFormatReader reader = new HieroFormatReader(OwnerMap.register("lattice"));
 +
 +      String goalNT = FormatUtils.cleanNonTerminal(joshuaConfiguration.goal_symbol);
 +      String defaultNT = FormatUtils.cleanNonTerminal(joshuaConfiguration.default_non_terminal);
 +
 +      //FIXME: too many arguments
 +      String ruleString = String.format("[%s] ||| [%s,1] <eps> ||| [%s,1] ||| ", goalNT, goalNT, defaultNT,
 +          goalNT, defaultNT);
 +
 +      Rule rule = reader.parseLine(ruleString);
 +      latticeGrammar.addRule(rule);
 +      rule.estimateRuleCost(featureFunctions);
 +
 +      this.grammars.add(latticeGrammar);
 +    }
 +
 +    /* Now create a feature function for each owner */
-     final Set<OwnerId> ownersSeen = new HashSet<OwnerId>();
++    final Set<OwnerId> ownersSeen = new HashSet<>();
 +
 +    for (Grammar grammar: this.grammars) {
 +      OwnerId owner = grammar.getOwner();
 +      if (! ownersSeen.contains(owner)) {
 +        this.featureFunctions.add(
 +            new PhraseModel(
 +                weights, new String[] { "tm", "-owner", getOwner(owner) }, joshuaConfiguration, grammar));
 +        ownersSeen.add(owner);
 +      }
 +    }
 +
 +    LOG.info("Memory used {} MB",
 +        ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1000000.0));
 +  }
 +
 +  /**
 +   * Checks if multiple packedGrammars have the same vocabulary by comparing their vocabulary file checksums.
 +   */
 +  private static void checkSharedVocabularyChecksumsForPackedGrammars(final List<PackedGrammar> packed_grammars) {
 +    String previous_checksum = "";
 +    for (PackedGrammar grammar : packed_grammars) {
 +      final String checksum = grammar.computeVocabularyChecksum();
 +      if (previous_checksum.isEmpty()) {
 +        previous_checksum = checksum;
 +      } else {
 +        if (!checksum.equals(previous_checksum)) {
 +          throw new RuntimeException(
 +              "Trying to load multiple packed grammars with different vocabularies!" +
 +                  "Have you packed them jointly?");
 +        }
 +        previous_checksum = checksum;
 +      }
 +    }
 +  }
 +
 +  /*
 +   * This function reads the weights for the model. Feature names and their weights are listed one
 +   * per line in the following format:
 +   * 
 +   * FEATURE_NAME WEIGHT
 +   */
 +  private void readWeights(String fileName) {
 +    Decoder.weights = new FeatureVector(5);
 +
 +    if (fileName.equals(""))
 +      return;
 +
 +    try {
 +      LineReader lineReader = new LineReader(fileName);
 +
 +      for (String line : lineReader) {
 +        line = line.replaceAll(spaceSeparator, " ");
 +
 +        if (line.equals("") || line.startsWith("#") || line.startsWith("//")
 +            || line.indexOf(' ') == -1)
 +          continue;
 +
 +        String tokens[] = line.split(spaceSeparator);
 +        String feature = tokens[0];
 +        Float value = Float.parseFloat(tokens[1]);
 +
 +        // Kludge for compatibility with Moses tuners
 +        if (joshuaConfiguration.moses) {
 +          feature = demoses(feature);
 +        }
 +
 +        weights.add(hashFeature(feature), value);
 +      }
 +    } catch (IOException ioe) {
 +      throw new RuntimeException(ioe);
 +    }
 +    LOG.info("Read {} weights from file '{}'", weights.size(), fileName);
 +  }
 +
 +  private String demoses(String feature) {
 +    if (feature.endsWith("="))
 +      feature = feature.replace("=", "");
 +    if (feature.equals("OOV_Penalty"))
 +      feature = "OOVPenalty";
 +    else if (feature.startsWith("tm-") || feature.startsWith("lm-"))
 +      feature = feature.replace("-",  "_");
 +    return feature;
 +  }
 +
 +  /**
 +   * Feature functions are instantiated with a line of the form
 +   *
 +   * <pre>
 +   *   FEATURE OPTIONS
 +   * </pre>
 +   *
 +   * Weights for features are listed separately.
 +   *
 +   * @throws IOException
 +   *
 +   */
 +  private void initializeFeatureFunctions() throws IOException {
 +
 +    for (String featureLine : joshuaConfiguration.features) {
 +      // line starts with NAME, followed by args
 +      // 1. create new class named NAME, pass it config, weights, and the args
 +
 +      String fields[] = featureLine.split("\\s+");
 +      String featureName = fields[0];
 +      
 +      try {
 +        
 +        Class<?> clas = getFeatureFunctionClass(featureName);
 +        Constructor<?> constructor = clas.getConstructor(FeatureVector.class,
 +            String[].class, JoshuaConfiguration.class);
 +        FeatureFunction feature = (FeatureFunction) constructor.newInstance(weights, fields, joshuaConfiguration);
 +        this.featureFunctions.add(feature);
 +        
 +      } catch (Exception e) {
 +        throw new RuntimeException(String.format("Unable to instantiate feature function '%s'!", featureLine), e); 
 +      }
 +    }
 +
 +    for (FeatureFunction feature : featureFunctions) {
 +      LOG.info("FEATURE: {}", feature.logString());
 +    }
 +  }
 +
 +  /**
 +   * Searches a list of predefined paths for classes, and returns the first one found. Meant for
 +   * instantiating feature functions.
 +   *
 +   * @param name
 +   * @return the class, found in one of the search paths
 +   * @throws ClassNotFoundException
 +   */
 +  private Class<?> getFeatureFunctionClass(String featureName) {
 +    Class<?> clas = null;
 +
 +    String[] packages = { "org.apache.joshua.decoder.ff", "org.apache.joshua.decoder.ff.lm", "org.apache.joshua.decoder.ff.phrase" };
 +    for (String path : packages) {
 +      try {
 +        clas = Class.forName(String.format("%s.%s", path, featureName));
 +        break;
 +      } catch (ClassNotFoundException e) {
 +        try {
 +          clas = Class.forName(String.format("%s.%sFF", path, featureName));
 +          break;
 +        } catch (ClassNotFoundException e2) {
 +          // do nothing
 +        }
 +      }
 +    }
 +    return clas;
 +  }
 +  
 +  /**
 +   * Adds a rule to the custom grammar.  
 +   * 
 +   * @param rule the rule to add
 +   */
 +  public void addCustomRule(Rule rule) {
 +    customPhraseTable.addRule(rule);
 +    rule.estimateRuleCost(featureFunctions);
 +  }
 +
 +  public Grammar getCustomPhraseTable() {
 +    return customPhraseTable;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/DecoderThread.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/DecoderThread.java
index d095e8d,0000000..b570d5f
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/DecoderThread.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/DecoderThread.java
@@@ -1,201 -1,0 +1,201 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.chart_parser.Chart;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.SourceDependentFF;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.hypergraph.ForestWalker;
 +import org.apache.joshua.decoder.hypergraph.GrammarBuilderWalkerFunction;
 +import org.apache.joshua.decoder.hypergraph.HyperGraph;
 +import org.apache.joshua.decoder.phrase.Stacks;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class handles decoding of individual Sentence objects (which can represent plain sentences
 + * or lattices). A single sentence can be decoded by a call to translate() and, if an InputHandler
 + * is used, many sentences can be decoded in a thread-safe manner via a single call to
 + * translateAll(), which continually queries the InputHandler for sentences until they have all been
 + * consumed and translated.
 + * 
 + * The DecoderFactory class is responsible for launching the threads.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +
 +public class DecoderThread extends Thread {
 +  private static final Logger LOG = LoggerFactory.getLogger(DecoderThread.class);
 +
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  /*
 +   * these variables may be the same across all threads (e.g., just copy from DecoderFactory), or
 +   * differ from thread to thread
 +   */
 +  private final List<Grammar> allGrammars;
 +  private final List<FeatureFunction> featureFunctions;
 +
 +
 +  // ===============================================================
 +  // Constructor
 +  // ===============================================================
 +  public DecoderThread(List<Grammar> grammars, FeatureVector weights,
 +      List<FeatureFunction> featureFunctions, JoshuaConfiguration joshuaConfiguration) throws IOException {
 +
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    this.allGrammars = grammars;
 +
-     this.featureFunctions = new ArrayList<FeatureFunction>();
++    this.featureFunctions = new ArrayList<>();
 +    for (FeatureFunction ff : featureFunctions) {
 +      if (ff instanceof SourceDependentFF) {
 +        this.featureFunctions.add(((SourceDependentFF) ff).clone());
 +      } else {
 +        this.featureFunctions.add(ff);
 +      }
 +    }
 +  }
 +
 +  // ===============================================================
 +  // Methods
 +  // ===============================================================
 +
 +  @Override
 +  public void run() {
 +    // Nothing to do but wait.
 +  }
 +
 +  /**
 +   * Translate a sentence.
 +   * 
 +   * @param sentence The sentence to be translated.
 +   * @return the sentence {@link org.apache.joshua.decoder.Translation}
 +   */
 +  public Translation translate(Sentence sentence) {
 +
 +    LOG.info("Input {}: {}", sentence.id(), sentence.fullSource());
 +
 +    if (sentence.target() != null)
 +      LOG.info("Input {}: Constraining to target sentence '{}'",
 +          sentence.id(), sentence.target());
 +
 +    // skip blank sentences
 +    if (sentence.isEmpty()) {
 +      LOG.info("Translation {}: Translation took 0 seconds", sentence.id());
 +      return new Translation(sentence, null, featureFunctions, joshuaConfiguration);
 +    }
 +
 +    long startTime = System.currentTimeMillis();
 +
 +    int numGrammars = allGrammars.size();
 +    Grammar[] grammars = new Grammar[numGrammars];
 +
 +    for (int i = 0; i < allGrammars.size(); i++)
 +      grammars[i] = allGrammars.get(i);
 +
 +    if (joshuaConfiguration.segment_oovs)
 +      sentence.segmentOOVs(grammars);
 +
 +    /**
 +     * Joshua supports (as of September 2014) both phrase-based and hierarchical decoding. Here
 +     * we build the appropriate chart. The output of both systems is a hypergraph, which is then
 +     * used for further processing (e.g., k-best extraction).
 +     */
 +    HyperGraph hypergraph = null;
 +    try {
 +
 +      if (joshuaConfiguration.search_algorithm.equals("stack")) {
 +        Stacks stacks = new Stacks(sentence, this.featureFunctions, grammars, joshuaConfiguration);
 +
 +        hypergraph = stacks.search();
 +      } else {
 +        /* Seeding: the chart only sees the grammars, not the factories */
 +        Chart chart = new Chart(sentence, this.featureFunctions, grammars,
 +            joshuaConfiguration.goal_symbol, joshuaConfiguration);
 +
 +        hypergraph = (joshuaConfiguration.use_dot_chart) 
 +            ? chart.expand() 
 +                : chart.expandSansDotChart();
 +      }
 +
 +    } catch (java.lang.OutOfMemoryError e) {
 +      LOG.error("Input {}: out of memory", sentence.id());
 +      hypergraph = null;
 +    }
 +
 +    float seconds = (System.currentTimeMillis() - startTime) / 1000.0f;
 +    LOG.info("Input {}: Translation took {} seconds", sentence.id(), seconds);
 +    LOG.info("Input {}: Memory used is {} MB", sentence.id(), (Runtime
 +        .getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1000000.0);
 +
 +    /* Return the translation unless we're doing synchronous parsing. */
 +    if (!joshuaConfiguration.parse || hypergraph == null) {
 +      return new Translation(sentence, hypergraph, featureFunctions, joshuaConfiguration);
 +    }
 +
 +    /*****************************************************************************************/
 +
 +    /*
 +     * Synchronous parsing.
 +     * 
 +     * Step 1. Traverse the hypergraph to create a grammar for the second-pass parse.
 +     */
 +    Grammar newGrammar = getGrammarFromHyperGraph(joshuaConfiguration.goal_symbol, hypergraph);
 +    newGrammar.sortGrammar(this.featureFunctions);
 +    long sortTime = System.currentTimeMillis();
 +    LOG.info("Sentence {}: New grammar has {} rules.", sentence.id(),
 +        newGrammar.getNumRules());
 +
 +    /* Step 2. Create a new chart and parse with the instantiated grammar. */
 +    Grammar[] newGrammarArray = new Grammar[] { newGrammar };
 +    Sentence targetSentence = new Sentence(sentence.target(), sentence.id(), joshuaConfiguration);
 +    Chart chart = new Chart(targetSentence, featureFunctions, newGrammarArray, "GOAL",joshuaConfiguration);
 +    int goalSymbol = GrammarBuilderWalkerFunction.goalSymbol(hypergraph);
 +    String goalSymbolString = Vocabulary.word(goalSymbol);
 +    LOG.info("Sentence {}: goal symbol is {} ({}).", sentence.id(),
 +        goalSymbolString, goalSymbol);
 +    chart.setGoalSymbolID(goalSymbol);
 +
 +    /* Parsing */
 +    HyperGraph englishParse = chart.expand();
 +    long secondParseTime = System.currentTimeMillis();
 +    LOG.info("Sentence {}: Finished second chart expansion ({} seconds).",
 +        sentence.id(), (secondParseTime - sortTime) / 1000);
 +    LOG.info("Sentence {} total time: {} seconds.\n", sentence.id(),
 +        (secondParseTime - startTime) / 1000);
 +    LOG.info("Memory used after sentence {} is {} MB", sentence.id(), (Runtime
 +        .getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1000000.0);
 +    return new Translation(sentence, englishParse, featureFunctions, joshuaConfiguration); // or do something else
 +  }
 +
 +  private Grammar getGrammarFromHyperGraph(String goal, HyperGraph hg) {
 +    GrammarBuilderWalkerFunction f = new GrammarBuilderWalkerFunction(goal, joshuaConfiguration, "pt");
 +    ForestWalker walker = new ForestWalker();
 +    walker.walk(hg.goalNode, f);
 +    return f.getGrammar();
 +  }
 +}



[22/50] [abbrv] incubator-joshua git commit: missed one

Posted by mj...@apache.org.
missed one


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/4812fede
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/4812fede
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/4812fede

Branch: refs/heads/7
Commit: 4812fedee89d3a6dac4e8333a1d62242f3b5ac9c
Parents: 20e6bf4
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 21:36:09 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 21:36:09 2016 -0500

----------------------------------------------------------------------
 src/test/java/org/apache/joshua/system/KenLmTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/4812fede/src/test/java/org/apache/joshua/system/KenLmTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/system/KenLmTest.java b/src/test/java/org/apache/joshua/system/KenLmTest.java
index 40514cd..74baef3 100644
--- a/src/test/java/org/apache/joshua/system/KenLmTest.java
+++ b/src/test/java/org/apache/joshua/system/KenLmTest.java
@@ -40,7 +40,7 @@ import static org.testng.AssertJUnit.assertFalse;
 
 public class KenLmTest {
 
-  private static final String LANGUAGE_MODEL_PATH = "resources/kenlm/oilers.kenlm";
+  private static final String LANGUAGE_MODEL_PATH = "src/test/resources/kenlm/oilers.kenlm";
   private KenLM kenLm;
 
   @Test


[49/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/output.gold
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/output.gold b/joshua-core/src/test/resources/kbest_extraction/output.gold
new file mode 100644
index 0000000..e75bb9e
--- /dev/null
+++ b/joshua-core/src/test/resources/kbest_extraction/output.gold
@@ -0,0 +1,3126 @@
+0 ||| A A A A A ||| lm_0=-28.045 tm_pt_0=-172.000 tm_glue_0=5.000 ||| -195.045
+0 ||| B A A A A ||| lm_0=-28.045 tm_pt_0=-173.000 tm_glue_0=5.000 ||| -196.045
+0 ||| C A A A A ||| lm_0=-28.045 tm_pt_0=-175.000 tm_glue_0=5.000 ||| -198.045
+0 ||| A B A A A ||| lm_0=-28.045 tm_pt_0=-176.000 tm_glue_0=5.000 ||| -199.045
+0 ||| B B A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
+0 ||| D A A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
+0 ||| A A A A B ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A A A B A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A A B A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A C A A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| B A A A B ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B A A B A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B A B A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B C A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| C B A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| A A A C A ||| lm_0=-28.045 tm_pt_0=-180.000 tm_glue_0=5.000 ||| -203.045
+0 ||| C A A A B ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C A A B A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| B A A C A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C A B A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| E A A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C C A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| D B A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| A A A A C ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B A B A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B A A B ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A A C A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B B A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A D A A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| B A A A C ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B A C A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| C A A C A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B D A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D C A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| A A B A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A B B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A A B B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A B A C A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C A A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C A B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C B A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A D A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| C A A A C ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A A B B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A B A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A B B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| D A A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C A C A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B B A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| E B A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C D A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A D A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| A B A A C ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A A C B ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A B C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A B C A A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A C A C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A A D A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| C A A B B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D A A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A B A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A A C B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B B A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D A C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A A D A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D D A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B C A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A D A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A B B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C B A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E C A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B B C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A B C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| A B A B B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B B B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A A B C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D A B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A C A A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A C B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A C A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A C C A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A B A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B D A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A A A D ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A E A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B B A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A E A A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D A A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D B A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| B D A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C B A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A C A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| E A A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A A D A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A A B C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B C A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D B A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A A A D ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A C B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B D A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A A C B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A E A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A B A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C C A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B C C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A B C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B E A A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C B C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B D B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| A C B A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A D A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A B B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A A C C ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B A C B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C A B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B B C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A A E A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C B B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A D B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B A D A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A D A C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A C C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C D A A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| B C A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A B B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A A B C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A C A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A B A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A D A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E A A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D B A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A A A D ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C C A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A A C C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A D B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A C C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D C A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A C B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A A E A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C C C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B D A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A E A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E D A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D B C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C E A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E A C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| A B C A B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B B A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A D A A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A C A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B A B C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A B C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C A C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B A A D ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A A D B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B C B A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C A D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A D C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C B C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A B D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B E A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A D C A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| B B C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A B C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A C A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B D A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A B D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A A D B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A D B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D C C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A D A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B D C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A B B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C D A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A A C C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A D C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A A E A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D C A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D E A A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A C C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E B A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| A D B A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A C B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C A B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B B B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B A C C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B D A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A E A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C C A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E A A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D A B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A B B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B D B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A D A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C B A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B C C A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A A B D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C C B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A B A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D D A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C A A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D B B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E A B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C E A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A E B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E B A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B A E A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| B B B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E A A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A E A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A C B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A B C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A A D B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A B B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E C A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A E B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E B A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A B D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A D A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A D C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C D C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A C A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D D A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C D A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A B A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E B C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A A B D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E A B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E B A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| A B B C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A C D ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B A D B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A D C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C D A B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C A C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A E B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C B B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A D B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A C C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D A C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A B E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A A E ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B C A C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D B C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A B C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A E A C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B D C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C C C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C D B A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A C D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D A D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B B D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A E C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C A E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| E A A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A C C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A D B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A B C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A C D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A B A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A A B D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E C A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A D C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A D A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A C B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A C D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A E B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A E C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A E A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A B E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D D A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A B B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A A E ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B E A C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A E B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E E A A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D D C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E C C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| A E A A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B B A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A B D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B B B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A E A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D B A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A C B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C B C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B D A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D A B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C C A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B E A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A D C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C A D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B C B B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A C A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D C A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B A B D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D C B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D A A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B E B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C D C A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A E C A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C B D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D E A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A D D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| D C B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A B D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A D B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A E B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A D C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E A A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A C C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A B C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A E A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B E A A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A C B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A D C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A C A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A A E ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A C D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A D D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E A B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A B E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A E C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B E C A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E B A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E D A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C E A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A C D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| A C A B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D B B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D D A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B C C B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E B B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C C B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A B B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D C C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B D B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A E B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C E B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C E A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E B A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D D B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A E B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B E C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A D A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E D A A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A A E ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A C E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C B B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B B E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C D A C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D A E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A D C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B C D A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A A E C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A C D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E A B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C B A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A D B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B B C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D A C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A C C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| B B B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A E B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A D C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A B D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A B B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E A B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E B A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D E A C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A C A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A D A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A C C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E D C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C E C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A D B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E D A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E B B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A C E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A C B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A D D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C E A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A A E C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E D A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A E A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| A C D B B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C C C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A C D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D A D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E A C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B D C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B B D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A E D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A E C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C E C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A A D D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D D C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A D E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C C D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B C A D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D B D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D B C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E A D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C B E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D C A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B D D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A A B E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E B C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C B C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A D C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B E A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B C B C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| C C E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A D C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A A E C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A C C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E A A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D E A A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A E B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A D B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A A B E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A C D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A D E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A C E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A E C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A D A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E A B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E A C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E B C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D E C A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E A D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A A D D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E B A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A E D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A B B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| A C E A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B D B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E B A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A E B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D D A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B C C C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E C A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A D D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D E A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D B B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C D C B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B E B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D E B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D C B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B C E A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B A E C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E C B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A A C E ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E E A A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A C B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C D D A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D B A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E A A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C C B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A E A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B B B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D A B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B D A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C C A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E A B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C B D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| E C B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A E C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E C A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E B A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A C D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A D D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E B A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A E A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A C B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E A A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E A B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A E B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E A B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A A D D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E C B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E B B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A A C E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A A B E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E D A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E E A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A D C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A E D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E E A C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A D E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| A B E C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C B B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C D B C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D C C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C C C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D D B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C E B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E A C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B D C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A B E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C D A D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A E C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E B B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E D A B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B D E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C A E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B A B E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D E C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D B C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C C E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A D B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A E E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D B E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B A D D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A A E D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B E D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B C D B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E C C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E A E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D C D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E D B A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| B A C A E ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E E A A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E B C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C C D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B C D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C C E A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B C D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B C C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E A D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E C A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C E C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E C B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D E A C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E A B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D B D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D D A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D A E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E D C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B C E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D B B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D E A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C A E B C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D B A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B D C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D D B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B E D A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B A C E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D A B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B D A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B E B B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B A E C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D D A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B C C C ||| lm_0=-28.045 tm_pt_0=-207.00

<TRUNCATED>


[24/50] [abbrv] incubator-joshua git commit: Merge branch 'JOSHUA-299'

Posted by mj...@apache.org.
Merge branch 'JOSHUA-299'


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/7bfe87f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/7bfe87f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/7bfe87f8

Branch: refs/heads/7
Commit: 7bfe87f8c6d02eb57d8b223fdb7d4bffffbc635d
Parents: 2041a3f d4fdbfd
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 22:06:38 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 22:06:38 2016 -0500

----------------------------------------------------------------------
 resources/berkeley_lm/lm                        |   16 -
 resources/berkeley_lm/lm.berkeleylm             |  Bin 4294 -> 0 bytes
 resources/berkeley_lm/lm.berkeleylm.gz          |  Bin 1786 -> 0 bytes
 resources/berkeley_lm/lm.gz                     |  Bin 162 -> 0 bytes
 resources/grammar.glue                          |    4 -
 resources/kbest_extraction/glue-grammar         |    3 -
 resources/kbest_extraction/grammar              |   25 -
 resources/kbest_extraction/joshua.config        |   27 -
 resources/kbest_extraction/lm.gz                |  Bin 2466496 -> 0 bytes
 resources/kbest_extraction/output.gold          | 3126 ------------------
 resources/kbest_extraction/output.scores.gold   | 3126 ------------------
 resources/kenlm/oilers.kenlm                    |  Bin 49011 -> 0 bytes
 resources/lm_oov/joshua.config                  |   17 -
 resources/phrase_decoder/config                 |   29 -
 resources/phrase_decoder/constrained.config     |   28 -
 .../phrase_decoder/constrained.output.gold      |    5 -
 resources/phrase_decoder/lm.1.gz                |  Bin 2235 -> 0 bytes
 resources/phrase_decoder/output.gold            |    1 -
 resources/phrase_decoder/rules.1.gz             |  Bin 2998042 -> 0 bytes
 resources/wa_grammar                            |    3 -
 resources/wa_grammar.packed/config              |    2 -
 resources/wa_grammar.packed/encoding            |  Bin 154 -> 0 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 45 -> 0 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 47 -> 0 bytes
 resources/wa_grammar.packed/slice_00000.source  |  Bin 204 -> 0 bytes
 resources/wa_grammar.packed/slice_00000.target  |  Bin 128 -> 0 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 32 -> 0 bytes
 resources/wa_grammar.packed/vocabulary          |  Bin 238 -> 0 bytes
 .../java/org/apache/joshua/decoder/Decoder.java |    2 +
 .../LMBerkeleySentenceProbablityTest.java       |    4 +-
 .../lm/berkeley_lm/LMGrammarBerkeleyTest.java   |   10 +-
 .../class_lm/ClassBasedLanguageModelTest.java   |    4 +-
 .../kbest_extraction/KBestExtractionTest.java   |    4 +-
 .../phrase/decode/PhraseDecodingTest.java       |    2 +-
 .../org/apache/joshua/system/KenLmTest.java     |    2 +-
 .../apache/joshua/system/LmOovFeatureTest.java  |    2 +-
 .../system/MultithreadedTranslationTests.java   |    4 +-
 .../joshua/system/StructuredOutputTest.java     |    4 +-
 .../system/StructuredTranslationTest.java       |    4 +-
 src/test/resources/berkeley_lm/lm               |   16 +
 src/test/resources/berkeley_lm/lm.berkeleylm    |  Bin 0 -> 4294 bytes
 src/test/resources/berkeley_lm/lm.berkeleylm.gz |  Bin 0 -> 1786 bytes
 src/test/resources/berkeley_lm/lm.gz            |  Bin 0 -> 162 bytes
 src/test/resources/grammar.glue                 |    4 +
 .../resources/kbest_extraction/glue-grammar     |    3 +
 src/test/resources/kbest_extraction/grammar     |   25 +
 .../resources/kbest_extraction/joshua.config    |   27 +
 src/test/resources/kbest_extraction/lm.gz       |  Bin 0 -> 2466496 bytes
 src/test/resources/kbest_extraction/output.gold | 3126 ++++++++++++++++++
 .../kbest_extraction/output.scores.gold         | 3126 ++++++++++++++++++
 src/test/resources/kenlm/oilers.kenlm           |  Bin 0 -> 49011 bytes
 src/test/resources/lm_oov/joshua.config         |   17 +
 src/test/resources/phrase_decoder/config        |   29 +
 .../resources/phrase_decoder/constrained.config |   28 +
 .../phrase_decoder/constrained.output.gold      |    5 +
 src/test/resources/phrase_decoder/lm.1.gz       |  Bin 0 -> 2235 bytes
 src/test/resources/phrase_decoder/output.gold   |    1 +
 src/test/resources/phrase_decoder/rules.1.gz    |  Bin 0 -> 2998042 bytes
 src/test/resources/wa_grammar                   |    3 +
 src/test/resources/wa_grammar.packed/config     |    2 +
 src/test/resources/wa_grammar.packed/encoding   |  Bin 0 -> 154 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 0 -> 45 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 0 -> 47 bytes
 .../wa_grammar.packed/slice_00000.source        |  Bin 0 -> 204 bytes
 .../wa_grammar.packed/slice_00000.target        |  Bin 0 -> 128 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 0 -> 32 bytes
 src/test/resources/wa_grammar.packed/vocabulary |  Bin 0 -> 238 bytes
 67 files changed, 6434 insertions(+), 6432 deletions(-)
----------------------------------------------------------------------



[04/50] [abbrv] incubator-joshua git commit: removed nonterminals from OOV rules

Posted by mj...@apache.org.
removed nonterminals from OOV rules


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/49dbf8cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/49dbf8cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/49dbf8cb

Branch: refs/heads/7
Commit: 49dbf8cbaf2f1e0c648f8eb705ab3887aa06b039
Parents: 36cde50
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sat Aug 20 08:31:18 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sat Aug 20 08:31:18 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/49dbf8cb/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java b/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
index 6b237a9..fc67da6 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
@@ -126,7 +126,7 @@ public class PhraseTable implements Grammar {
         : sourceWord;   
 
     int nt_i = Vocabulary.id("[X]");
-    Rule oovRule = new Rule(nt_i, new int[] { nt_i, sourceWord }, new int[] { -1, targetWord }, "", 1);
+    Rule oovRule = new Rule(nt_i, new int[] { sourceWord }, new int[] { targetWord }, "", 0, "0-0");
     addRule(oovRule);
     oovRule.estimateRuleCost(featureFunctions);
         


[05/50] [abbrv] incubator-joshua git commit: minor cleanup of assignment logic

Posted by mj...@apache.org.
minor cleanup of assignment logic


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/e3b60ca9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/e3b60ca9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/e3b60ca9

Branch: refs/heads/7
Commit: e3b60ca9a7fea7d25a8533b630a1a66d29349a6f
Parents: 49dbf8c
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 06:53:26 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 06:53:26 2016 -0500

----------------------------------------------------------------------
 .../decoder/chart_parser/ComputeNodeResult.java | 31 +++++++++-----------
 1 file changed, 14 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/e3b60ca9/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java b/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
index 9833734..d92665d 100644
--- a/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
+++ b/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
@@ -51,9 +51,9 @@ public class ComputeNodeResult {
   // transitionCost + the Viterbi costs of the tail nodes.
   private float viterbiCost;
 
-  // viterbiCost + a future estimate (outside cost estimate).
-  private float pruningCostEstimate;
-
+  // The future or outside cost (estimated)
+  private float futureCostEstimate;
+  
   // The StateComputer objects themselves serve as keys.
   private List<DPState> dpStates;
 
@@ -76,7 +76,7 @@ public class ComputeNodeResult {
 
     // The total Viterbi cost of this edge. This is the Viterbi cost of the tail nodes, plus
     // whatever costs we incur applying this rule to create a new hyperedge.
-    float viterbiCost = 0.0f;
+    this.viterbiCost = 0.0f;
     
     if (LOG.isDebugEnabled()) {
       LOG.debug("ComputeNodeResult():");
@@ -102,10 +102,10 @@ public class ComputeNodeResult {
     List<DPState> allDPStates = new ArrayList<DPState>();
 
     // The transition cost is the new cost incurred by applying this rule
-    float transitionCost = 0.0f;
+    this.transitionCost = 0.0f;
 
     // The future cost estimate is a heuristic estimate of the outside cost of this edge.
-    float futureCostEstimate = 0.0f;
+    this.futureCostEstimate = 0.0f;
 
     /*
      * We now iterate over all the feature functions, computing their cost and their expected future
@@ -132,10 +132,7 @@ public class ComputeNodeResult {
     viterbiCost += transitionCost;
     if (LOG.isDebugEnabled())
       LOG.debug("-> COST = {}", transitionCost);
-    // Set the final results.
-    this.pruningCostEstimate = viterbiCost + futureCostEstimate;
-    this.viterbiCost = viterbiCost;
-    this.transitionCost = transitionCost;
+
     this.dpStates = allDPStates;
   }
 
@@ -189,12 +186,17 @@ public class ComputeNodeResult {
     return featureDelta;
   }
 
+  public float getFutureEstimate() {
+    return this.futureCostEstimate;
+  }
+  
   public float getPruningEstimate() {
-    return this.pruningCostEstimate;
+    return getViterbiCost() + getFutureEstimate();
   }
 
   /**
-   *  The complete cost of the Viterbi derivation at this point
+   *  The complete cost of the Viterbi derivation at this point.
+   *  
    *  @return float representing cost
    */
   public float getViterbiCost() {
@@ -217,9 +219,4 @@ public class ComputeNodeResult {
   public List<DPState> getDPStates() {
     return this.dpStates;
   }
-
-  public void printInfo() {
-    System.out.println("scores: " + transitionCost + "; " + viterbiCost + "; "
-        + pruningCostEstimate);
-  }
 }


[07/50] [abbrv] incubator-joshua git commit: added debug-joshua which sets debugging and uses classes instead of the jar

Posted by mj...@apache.org.
added debug-joshua which sets debugging and uses classes instead of the jar

This means you can run the command-line version while in Eclipse without having to rebuild the jar file (which is time-consuming).


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/0e49bc53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/0e49bc53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/0e49bc53

Branch: refs/heads/7
Commit: 0e49bc537b05549930802bf6c187b849c4c67adb
Parents: 293db94
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 06:55:55 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 07:01:05 2016 -0500

----------------------------------------------------------------------
 bin/debug-joshua | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 bin/decoder      |  1 -
 2 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0e49bc53/bin/debug-joshua
----------------------------------------------------------------------
diff --git a/bin/debug-joshua b/bin/debug-joshua
new file mode 100755
index 0000000..0fd76f4
--- /dev/null
+++ b/bin/debug-joshua
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Joshua decoder invocation script.
+# 
+# This script takes care of passing arguments to Java and to the
+# Joshua decoder.  Usage:
+#
+# ./decoder [-m memory] [Joshua arguments]
+#
+# The default amount of memory is 4gb.
+
+NUM_ARGS=0
+E_OPTERROR=1
+
+## memory usage; default is 4 GB
+mem=4g
+
+if [[ $1 == "-m" ]]; then
+    mem=$2
+    shift
+    shift
+fi
+
+set -u
+
+JOSHUA=$(dirname $0)/..
+JAR_PATH=$(ls -t $JOSHUA/target/joshua-*-jar-with-dependencies.jar | head -n1)
+exec java -Xmx${mem} \
+	-Dfile.encoding=utf8 \
+	-Djava.library.path=$JOSHUA/lib \
+	-cp $JOSHUA/target/classes:$JAR_PATH \
+	org.apache.joshua.decoder.JoshuaDecoder -v 2 "$@"

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0e49bc53/bin/decoder
----------------------------------------------------------------------
diff --git a/bin/decoder b/bin/decoder
deleted file mode 120000
index a3f23fe..0000000
--- a/bin/decoder
+++ /dev/null
@@ -1 +0,0 @@
-joshua-decoder
\ No newline at end of file


[14/50] [abbrv] incubator-joshua git commit: Merge branch 'JOSHUA-284'

Posted by mj...@apache.org.
Merge branch 'JOSHUA-284'


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/2041a3f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/2041a3f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/2041a3f9

Branch: refs/heads/7
Commit: 2041a3f9798036e69cd05432dcbe8604b80d00fd
Parents: 2b570d2 bf12adc
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 16:47:13 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 16:47:13 2016 -0500

----------------------------------------------------------------------
 .gitignore                                      |   3 +
 CHANGELOG                                       |   7 +
 bin/debug-joshua                                |  48 +++++
 bin/decoder                                     |   1 -
 scripts/support/phrase2hiero.py                 |  22 +--
 scripts/training/pipeline.pl                    |   8 +-
 .../decoder/chart_parser/ComputeNodeResult.java |  39 ++--
 .../joshua/decoder/ff/phrase/Distortion.java    |  29 ++-
 .../org/apache/joshua/decoder/ff/tm/Rule.java   |   4 +-
 .../decoder/ff/tm/format/MosesFormatReader.java |  13 +-
 .../joshua/decoder/hypergraph/HGNode.java       |  18 +-
 .../apache/joshua/decoder/phrase/Candidate.java | 184 +++++++++++++------
 .../decoder/phrase/CandidateComparator.java     |  28 ---
 .../apache/joshua/decoder/phrase/Future.java    |  19 +-
 .../joshua/decoder/phrase/Hypothesis.java       |  44 +++--
 .../joshua/decoder/phrase/PhraseChart.java      |  60 ++++--
 .../joshua/decoder/phrase/PhraseNodes.java      |  63 +++++++
 .../joshua/decoder/phrase/PhraseTable.java      |   8 +-
 .../org/apache/joshua/decoder/phrase/Stack.java |  35 ++--
 .../apache/joshua/decoder/phrase/Stacks.java    |  24 ++-
 .../joshua/decoder/phrase/TargetPhrases.java    |  80 --------
 .../org/apache/joshua/tools/GrammarPacker.java  |   8 +-
 .../phrase/decode/PhraseDecodingTest.java       |  35 +++-
 .../decoder/phrase/decode/rules.packed/config   |   4 +-
 .../decode/rules.packed/slice_00000.features    | Bin 4128858 -> 4128858 bytes
 .../decode/rules.packed/slice_00000.source      | Bin 1982244 -> 1982228 bytes
 .../decode/rules.packed/slice_00000.target      | Bin 2652936 -> 1463856 bytes
 .../rules.packed/slice_00000.target.lookup      | Bin 32 -> 28 bytes
 .../phrase/decode/rules.packed/vocabulary       | Bin 169236 -> 169225 bytes
 29 files changed, 448 insertions(+), 336 deletions(-)
----------------------------------------------------------------------



[38/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Chart.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Chart.java
index 355a6f1,0000000..5c123f9
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Chart.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Chart.java
@@@ -1,746 -1,0 +1,743 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.HashSet;
 +import java.util.List;
 +import java.util.PriorityQueue;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.DotChart.DotNode;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.SourceDependentFF;
 +import org.apache.joshua.decoder.ff.tm.AbstractGrammar;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.hash_based.MemoryBasedBatchGrammar;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperGraph;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.lattice.Arc;
 +import org.apache.joshua.lattice.Lattice;
 +import org.apache.joshua.lattice.Node;
 +import org.apache.joshua.util.ChartSpan;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Chart class this class implements chart-parsing: (1) seeding the chart (2)
 + * cky main loop over bins, (3) identify applicable rules in each bin
 + * 
 + * Note: the combination operation will be done in Cell
 + * 
 + * Signatures of class: Cell: i, j SuperNode (used for CKY check): i,j, lhs
 + * HGNode ("or" node): i,j, lhs, edge ngrams HyperEdge ("and" node)
 + * 
 + * index of sentences: start from zero index of cell: cell (i,j) represent span
 + * of words indexed [i,j-1] where i is in [0,n-1] and j is in [1,n]
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +
 +public class Chart {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Chart.class);
 +  private final JoshuaConfiguration config;
 +  // ===========================================================
 +  // Statistics
 +  // ===========================================================
 +
 +  /**
 +   * how many items have been pruned away because its cost is greater than the
 +   * cutoff in calling chart.add_deduction_in_chart()
 +   */
 +  int nMerged = 0;
 +  int nAdded = 0;
 +  int nDotitemAdded = 0; // note: there is no pruning in dot-item
 +
 +  public Sentence getSentence() {
 +    return this.sentence;
 +  }
 +  
 +  // ===============================================================
 +  // Private instance fields (maybe could be protected instead)
 +  // ===============================================================
-   private ChartSpan<Cell> cells; // note that in some cell, it might be null
-   private int sourceLength;
-   private List<FeatureFunction> featureFunctions;
-   private Grammar[] grammars;
-   private DotChart[] dotcharts; // each grammar should have a dotchart associated with it
++  private final ChartSpan<Cell> cells; // note that in some cell, it might be null
++  private final int sourceLength;
++  private final List<FeatureFunction> featureFunctions;
++  private final Grammar[] grammars;
++  private final DotChart[] dotcharts; // each grammar should have a dotchart associated with it
 +  private Cell goalBin;
 +  private int goalSymbolID = -1;
-   private Lattice<Token> inputLattice;
++  private final Lattice<Token> inputLattice;
 +
 +  private Sentence sentence = null;
 +//  private SyntaxTree parseTree;
 +  private StateConstraint stateConstraint;
 +
 +
 +  // ===============================================================
 +  // Constructors
 +  // ===============================================================
 +
 +  /*
 +   * TODO: Once the Segment interface is adjusted to provide a Lattice<String>
 +   * for the sentence() method, we should just accept a Segment instead of the
 +   * sentence, segmentID, and constraintSpans parameters. We have the symbol
 +   * table already, so we can do the integerization here instead of in
 +   * DecoderThread. GrammarFactory.getGrammarForSentence will want the
 +   * integerized sentence as well, but then we'll need to adjust that interface
 +   * to deal with (non-trivial) lattices too. Of course, we get passed the
 +   * grammars too so we could move all of that into here.
 +   */
 +
 +  public Chart(Sentence sentence, List<FeatureFunction> featureFunctions, Grammar[] grammars,
 +      String goalSymbol, JoshuaConfiguration config) {
 +    this.config = config;
 +    this.inputLattice = sentence.getLattice();
 +    this.sourceLength = inputLattice.size() - 1;
 +    this.featureFunctions = featureFunctions;
 +
 +    this.sentence = sentence;
 +
 +    // TODO: OOV handling no longer handles parse tree input (removed after
 +    // commit 748eb69714b26dd67cba8e7c25a294347603bede)
 +//    this.parseTree = null;
 +//    if (sentence instanceof ParsedSentence)
 +//      this.parseTree = ((ParsedSentence) sentence).syntaxTree();
 +//
-     this.cells = new ChartSpan<Cell>(sourceLength, null);
++    this.cells = new ChartSpan<>(sourceLength, null);
 +
 +    this.goalSymbolID = Vocabulary.id(goalSymbol);
 +    this.goalBin = new Cell(this, this.goalSymbolID);
 +
 +    /* Create the grammars, leaving space for the OOV grammar. */
 +    this.grammars = new Grammar[grammars.length + 1];
-     for (int i = 0; i < grammars.length; i++)
-       this.grammars[i + 1] = grammars[i];
++    System.arraycopy(grammars, 0, this.grammars, 1, grammars.length);
 +
 +    MemoryBasedBatchGrammar oovGrammar = new MemoryBasedBatchGrammar("oov", this.config, 20);
 +    AbstractGrammar.addOOVRules(oovGrammar, sentence.getLattice(), featureFunctions,
 +        this.config.true_oovs_only);
 +    this.grammars[0] = oovGrammar;
 +
 +    // each grammar will have a dot chart
 +    this.dotcharts = new DotChart[this.grammars.length];
 +    for (int i = 0; i < this.grammars.length; i++)
 +      this.dotcharts[i] = new DotChart(this.inputLattice, this.grammars[i], this);
 +
 +    // Begin to do initialization work
 +
 +    stateConstraint = null;
 +    if (sentence.target() != null)
 +      // stateConstraint = new StateConstraint(sentence.target());
 +      stateConstraint = new StateConstraint(Vocabulary.START_SYM + " " + sentence.target() + " "
 +          + Vocabulary.STOP_SYM);
 +
 +    /* Find the SourceDependent feature and give it access to the sentence. */
-     for (FeatureFunction ff : this.featureFunctions)
-       if (ff instanceof SourceDependentFF)
-         ((SourceDependentFF) ff).setSource(sentence);
++    this.featureFunctions.stream().filter(ff -> ff instanceof SourceDependentFF)
++        .forEach(ff -> ((SourceDependentFF) ff).setSource(sentence));
 +
 +    LOG.debug("Finished seeding chart.");
 +  }
 +
 +  /**
 +   * Manually set the goal symbol ID. The constructor expects a String
 +   * representing the goal symbol, but there may be time (say, for example, in
 +   * the second pass of a synchronous parse) where we want to set the goal
 +   * symbol to a particular ID (regardless of String representation).
 +   * <p>
 +   * This method should be called before expanding the chart, as chart expansion
 +   * depends on the goal symbol ID.
 +   * 
 +   * @param i the id of the goal symbol to use
 +   */
 +  public void setGoalSymbolID(int i) {
 +    this.goalSymbolID = i;
 +    this.goalBin = new Cell(this, i);
-     return;
 +  }
 +
 +  // ===============================================================
 +  // The primary method for filling in the chart
 +  // ===============================================================
 +
 +  /**
 +   * Construct the hypergraph with the help from DotChart using cube pruning.
 +   * Cube pruning occurs at the span level, with all completed rules from the
 +   * dot chart competing against each other; that is, rules with different
 +   * source sides *and* rules sharing a source side but with different target
 +   * sides are all in competition with each other.
 +   * 
 +   * Terminal rules are added to the chart directly.
 +   * 
 +   * Rules with nonterminals are added to the list of candidates. The candidates
 +   * list is seeded with the list of all rules and, for each nonterminal in the
 +   * rule, the 1-best tail node for that nonterminal and subspan. If the maximum
 +   * arity of a rule is R, then the dimension of the hypercube is R + 1, since
 +   * the first dimension is used to record the rule.
 +   */
 +  private void completeSpan(int i, int j) {
 +
 +    /* STEP 1: create the heap, and seed it with all of the candidate states */
-     PriorityQueue<CubePruneState> candidates = new PriorityQueue<CubePruneState>();
++    PriorityQueue<CubePruneState> candidates = new PriorityQueue<>();
 +
 +    /*
 +     * Look at all the grammars, seeding the chart with completed rules from the
 +     * DotChart
 +     */
 +    for (int g = 0; g < grammars.length; g++) {
 +      if (!grammars[g].hasRuleForSpan(i, j, inputLattice.distance(i, j))
 +          || null == dotcharts[g].getDotCell(i, j))
 +        continue;
 +
 +      // for each rule with applicable rules
 +      for (DotNode dotNode : dotcharts[g].getDotCell(i, j).getDotNodes()) {
 +        RuleCollection ruleCollection = dotNode.getRuleCollection();
 +        if (ruleCollection == null)
 +          continue;
 +
 +        List<Rule> rules = ruleCollection.getSortedRules(this.featureFunctions);
 +        SourcePath sourcePath = dotNode.getSourcePath();
 +
 +        if (null == rules || rules.size() == 0)
 +          continue;
 +
 +        if (ruleCollection.getArity() == 0) {
 +          /*
 +           * The total number of arity-0 items (pre-terminal rules) that we add
 +           * is controlled by num_translation_options in the configuration.
 +           * 
 +           * We limit the translation options per DotNode; that is, per LHS.
 +           */
 +          int numTranslationsAdded = 0;
 +
 +          /* Terminal productions are added directly to the chart */
 +          for (Rule rule : rules) {
 +
 +            if (config.num_translation_options > 0
 +                && numTranslationsAdded >= config.num_translation_options) {
 +              break;
 +            }
 +
 +            ComputeNodeResult result = new ComputeNodeResult(this.featureFunctions, rule, null, i,
 +                j, sourcePath, this.sentence);
 +
 +            if (stateConstraint == null || stateConstraint.isLegal(result.getDPStates())) {
 +              getCell(i, j).addHyperEdgeInCell(result, rule, i, j, null, sourcePath, true);
 +              numTranslationsAdded++;
 +            }
 +          }
 +        } else {
 +          /* Productions with rank > 0 are subject to cube pruning */
 +
 +          Rule bestRule = rules.get(0);
 +
-           List<HGNode> currentTailNodes = new ArrayList<HGNode>();
++          List<HGNode> currentTailNodes = new ArrayList<>();
 +          List<SuperNode> superNodes = dotNode.getAntSuperNodes();
 +          for (SuperNode si : superNodes) {
 +            currentTailNodes.add(si.nodes.get(0));
 +          }
 +
 +          /*
 +           * `ranks` records the current position in the cube. the 0th index is
 +           * the rule, and the remaining indices 1..N correspond to the tail
 +           * nodes (= nonterminals in the rule). These tail nodes are
 +           * represented by SuperNodes, which group together items with the same
 +           * nonterminal but different DP state (e.g., language model state)
 +           */
 +          int[] ranks = new int[1 + superNodes.size()];
 +          Arrays.fill(ranks, 1);
 +
 +          ComputeNodeResult result = new ComputeNodeResult(featureFunctions, bestRule,
 +              currentTailNodes, i, j, sourcePath, sentence);
 +          CubePruneState bestState = new CubePruneState(result, ranks, rules, currentTailNodes,
 +              dotNode);
 +          candidates.add(bestState);
 +        }
 +      }
 +    }
 +
 +    applyCubePruning(i, j, candidates);
 +  }
 +
 +  /**
 +   * Applies cube pruning over a span.
 +   * 
 +   * @param i
 +   * @param j
 +   * @param stateConstraint
 +   * @param candidates
 +   */
 +  private void applyCubePruning(int i, int j, PriorityQueue<CubePruneState> candidates) {
 +
 +    // System.err.println(String.format("CUBEPRUNE: %d-%d with %d candidates",
 +    // i, j, candidates.size()));
 +    // for (CubePruneState cand: candidates) {
 +    // System.err.println(String.format("  CAND " + cand));
 +    // }
 +
 +    /*
 +     * There are multiple ways to reach each point in the cube, so short-circuit
 +     * that.
 +     */
-     HashSet<CubePruneState> visitedStates = new HashSet<CubePruneState>();
++    HashSet<CubePruneState> visitedStates = new HashSet<>();
 +
 +    int popLimit = config.pop_limit;
 +    int popCount = 0;
 +    while (candidates.size() > 0 && ((++popCount <= popLimit) || popLimit == 0)) {
 +      CubePruneState state = candidates.poll();
 +
 +      DotNode dotNode = state.getDotNode();
 +      List<Rule> rules = state.rules;
 +      SourcePath sourcePath = dotNode.getSourcePath();
 +      List<SuperNode> superNodes = dotNode.getAntSuperNodes();
 +
 +      /*
 +       * Add the hypothesis to the chart. This can only happen if (a) we're not
 +       * doing constrained decoding or (b) we are and the state is legal.
 +       */
 +      if (stateConstraint == null || stateConstraint.isLegal(state.getDPStates())) {
 +        getCell(i, j).addHyperEdgeInCell(state.computeNodeResult, state.getRule(), i, j,
 +            state.antNodes, sourcePath, true);
 +      }
 +
 +      /*
 +       * Expand the hypothesis by walking down a step along each dimension of
 +       * the cube, in turn. k = 0 means we extend the rule being used; k > 0
 +       * expands the corresponding tail node.
 +       */
 +
 +      for (int k = 0; k < state.ranks.length; k++) {
 +
 +        /* Copy the current ranks, then extend the one we're looking at. */
 +        int[] nextRanks = new int[state.ranks.length];
 +        System.arraycopy(state.ranks, 0, nextRanks, 0, state.ranks.length);
 +        nextRanks[k]++;
 +
 +        /*
 +         * We might have reached the end of something (list of rules or tail
 +         * nodes)
 +         */
 +        if (k == 0
 +            && (nextRanks[k] > rules.size() || (config.num_translation_options > 0 && nextRanks[k] > config.num_translation_options)))
 +          continue;
 +        else if ((k != 0 && nextRanks[k] > superNodes.get(k - 1).nodes.size()))
 +          continue;
 +
 +        /* Use the updated ranks to assign the next rule and tail node. */
 +        Rule nextRule = rules.get(nextRanks[0] - 1);
 +        // HGNode[] nextAntNodes = new HGNode[state.antNodes.size()];
-         List<HGNode> nextAntNodes = new ArrayList<HGNode>(state.antNodes.size());
++        List<HGNode> nextAntNodes = new ArrayList<>(state.antNodes.size());
 +        for (int x = 0; x < state.ranks.length - 1; x++)
 +          nextAntNodes.add(superNodes.get(x).nodes.get(nextRanks[x + 1] - 1));
 +
 +        /* Create the next state. */
 +        CubePruneState nextState = new CubePruneState(new ComputeNodeResult(featureFunctions,
 +            nextRule, nextAntNodes, i, j, sourcePath, this.sentence), nextRanks, rules,
 +            nextAntNodes, dotNode);
 +
 +        /* Skip states that have been explored before. */
 +        if (visitedStates.contains(nextState))
 +          continue;
 +
 +        visitedStates.add(nextState);
 +        candidates.add(nextState);
 +      }
 +    }
 +  }
 +
 +  /* Create a priority queue of candidates for each span under consideration */
 +  private PriorityQueue<CubePruneState>[] allCandidates;
 +
 +  private ArrayList<SuperNode> nodeStack;
 +
 +  /**
 +   * Translates the sentence using the CKY+ variation proposed in
 +   * "A CYK+ Variant for SCFG Decoding Without A Dot Chart" (Sennrich, SSST
 +   * 2014).
 +   */
 +  private int i = -1;
 +
 +  public HyperGraph expandSansDotChart() {
 +    for (i = sourceLength - 1; i >= 0; i--) {
 +      allCandidates = new PriorityQueue[sourceLength - i + 2];
 +      for (int id = 0; id < allCandidates.length; id++)
-         allCandidates[id] = new PriorityQueue<CubePruneState>();
++        allCandidates[id] = new PriorityQueue<>();
 +
-       nodeStack = new ArrayList<SuperNode>();
++      nodeStack = new ArrayList<>();
 +
 +      for (int j = i + 1; j <= sourceLength; j++) {
 +        if (!sentence.hasPath(i, j))
 +          continue;
 +
-         for (int g = 0; g < this.grammars.length; g++) {
++        for (Grammar grammar : this.grammars) {
 +          // System.err.println(String.format("\n*** I=%d J=%d GRAMMAR=%d", i, j, g));
 +
 +          if (j == i + 1) {
 +            /* Handle terminals */
 +            Node<Token> node = sentence.getNode(i);
 +            for (Arc<Token> arc : node.getOutgoingArcs()) {
 +              int word = arc.getLabel().getWord();
 +              // disallow lattice decoding for now
 +              assert arc.getHead().id() == j;
-               Trie trie = this.grammars[g].getTrieRoot().match(word);
++              Trie trie = grammar.getTrieRoot().match(word);
 +              if (trie != null && trie.hasRules())
 +                addToChart(trie, j, false);
 +            }
 +          } else {
 +            /* Recurse for non-terminal case */
-             consume(this.grammars[g].getTrieRoot(), i, j - 1);
++            consume(grammar.getTrieRoot(), i, j - 1);
 +          }
 +        }
 +
 +        // Now that we've accumulated all the candidates, apply cube pruning
 +        applyCubePruning(i, j, allCandidates[j - i]);
 +
 +        // Add unary nodes
 +        addUnaryNodes(this.grammars, i, j);
 +      }
 +    }
 +
 +    // transition_final: setup a goal item, which may have many deductions
 +    if (null == this.cells.get(0, sourceLength)
 +        || !this.goalBin.transitToGoal(this.cells.get(0, sourceLength), this.featureFunctions,
 +            this.sourceLength)) {
 +      LOG.warn("Input {}: Parse failure (either no derivations exist or pruning is too aggressive",
 +          sentence.id());
 +      return null;
 +    }
 +
 +    return new HyperGraph(this.goalBin.getSortedNodes().get(0), -1, -1, this.sentence);
 +  }
 +
 +  /**
 +   * Recursively consumes the trie, following input nodes, finding applicable
 +   * rules and adding them to bins for each span for later cube pruning.
 +   * 
 +   * @param dotNode data structure containing information about what's been
 +   *          already matched
 +   * @param l extension point we're looking at
 +   * 
 +   */
 +  private void consume(Trie trie, int j, int l) {
 +    /*
 +     * 1. If the trie node has any rules, we can add them to the collection
 +     * 
 +     * 2. Next, look at all the outgoing nonterminal arcs of the trie node. If
 +     * any of them match an existing chart item, then we know we can extend
 +     * (i,j) to (i,l). We then recurse for all m from l+1 to n (the end of the
 +     * sentence)
 +     * 
 +     * 3. We also try to match terminals if (j + 1 == l)
 +     */
 +
 +    // System.err.println(String.format("CONSUME %s / %d %d %d", dotNode,
 +    // dotNode.begin(), dotNode.end(), l));
 +
 +    // Try to match terminals
 +    if (inputLattice.distance(j, l) == 1) {
 +      // Get the current sentence node, and explore all outgoing arcs, since we
 +      // might be decoding
 +      // a lattice. For sentence decoding, this is trivial: there is only one
 +      // outgoing arc.
 +      Node<Token> inputNode = sentence.getNode(j);
 +      for (Arc<Token> arc : inputNode.getOutgoingArcs()) {
 +        int word = arc.getLabel().getWord();
 +        Trie nextTrie;
 +        if ((nextTrie = trie.match(word)) != null) {
 +          // add to chart item over (i, l)
 +          addToChart(nextTrie, arc.getHead().id(), i == j);
 +        }
 +      }
 +    }
 +
 +    // Now try to match nonterminals
 +    Cell cell = cells.get(j, l);
 +    if (cell != null) {
 +      for (int id : cell.getKeySet()) { // for each supernode (lhs), see if you
 +                                        // can match a trie
 +        Trie nextTrie = trie.match(id);
 +        if (nextTrie != null) {
 +          SuperNode superNode = cell.getSuperNode(id);
 +          nodeStack.add(superNode);
 +          addToChart(nextTrie, superNode.end(), i == j);
 +          nodeStack.remove(nodeStack.size() - 1);
 +        }
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Adds all rules at a trie node to the chart, unless its a unary rule. A
 +   * unary rule is the first outgoing arc of a grammar's root trie. For
 +   * terminals, these are added during the seeding stage; for nonterminals,
 +   * these confuse cube pruning and can result in infinite loops, and are
 +   * handled separately (see addUnaryNodes());
 +   * 
 +   * @param trie the grammar node
 +   * @param isUnary whether the rules at this dotnode are unary
 +   */
 +  private void addToChart(Trie trie, int j, boolean isUnary) {
 +
 +    // System.err.println(String.format("ADD TO CHART %s unary=%s", dotNode,
 +    // isUnary));
 +
 +    if (!isUnary && trie.hasRules()) {
-       DotNode dotNode = new DotNode(i, j, trie, new ArrayList<SuperNode>(nodeStack), null);
++      DotNode dotNode = new DotNode(i, j, trie, new ArrayList<>(nodeStack), null);
 +
 +      addToCandidates(dotNode);
 +    }
 +
 +    for (int l = j + 1; l <= sentence.length(); l++)
 +      consume(trie, j, l);
 +  }
 +
 +  /**
 +   * Record the completed rule with backpointers for later cube-pruning.
 +   * 
 +   * @param width
 +   * @param rules
 +   * @param tailNodes
 +   */
 +  private void addToCandidates(DotNode dotNode) {
 +    // System.err.println(String.format("ADD TO CANDIDATES %s AT INDEX %d",
 +    // dotNode, dotNode.end() - dotNode.begin()));
 +
 +    // TODO: one entry per rule, or per rule instantiation (rule together with
 +    // unique matching of input)?
 +    List<Rule> rules = dotNode.getRuleCollection().getSortedRules(featureFunctions);
 +    Rule bestRule = rules.get(0);
 +    List<SuperNode> superNodes = dotNode.getAntSuperNodes();
 +
-     List<HGNode> tailNodes = new ArrayList<HGNode>();
++    List<HGNode> tailNodes = new ArrayList<>();
 +    for (SuperNode superNode : superNodes)
 +      tailNodes.add(superNode.nodes.get(0));
 +
 +    int[] ranks = new int[1 + superNodes.size()];
 +    Arrays.fill(ranks, 1);
 +
 +    ComputeNodeResult result = new ComputeNodeResult(featureFunctions, bestRule, tailNodes,
 +        dotNode.begin(), dotNode.end(), dotNode.getSourcePath(), sentence);
 +    CubePruneState seedState = new CubePruneState(result, ranks, rules, tailNodes, dotNode);
 +
 +    allCandidates[dotNode.end() - dotNode.begin()].add(seedState);
 +  }
 +
 +  /**
 +   * This function performs the main work of decoding.
 +   * 
 +   * @return the hypergraph containing the translated sentence.
 +   */
 +  public HyperGraph expand() {
 +
 +    for (int width = 1; width <= sourceLength; width++) {
 +      for (int i = 0; i <= sourceLength - width; i++) {
 +        int j = i + width;
 +        if (LOG.isDebugEnabled())
 +          LOG.debug("Processing span ({}, {})", i, j);
 +
 +        /* Skips spans for which no path exists (possible in lattices). */
 +        if (inputLattice.distance(i, j) == Float.POSITIVE_INFINITY) {
 +          continue;
 +        }
 +
 +        /*
 +         * 1. Expand the dot through all rules. This is a matter of (a) look for
 +         * rules over (i,j-1) that need the terminal at (j-1,j) and looking at
 +         * all split points k to expand nonterminals.
 +         */
 +        if (LOG.isDebugEnabled())
 +          LOG.debug("Expanding cell");
 +        for (int k = 0; k < this.grammars.length; k++) {
 +          /**
 +           * Each dotChart can act individually (without consulting other
 +           * dotCharts) because it either consumes the source input or the
 +           * complete nonTerminals, which are both grammar-independent.
 +           **/
 +          this.dotcharts[k].expandDotCell(i, j);
 +        }
 +
 +        /*
 +         * 2. The regular CKY part: add completed items onto the chart via cube
 +         * pruning.
 +         */
 +        if (LOG.isDebugEnabled())
 +          LOG.debug("Adding complete items into chart");
 +        completeSpan(i, j);
 +
 +        /* 3. Process unary rules. */
 +        if (LOG.isDebugEnabled())
 +          LOG.debug("Adding unary items into chart");
 +        addUnaryNodes(this.grammars, i, j);
 +
 +        // (4)=== in dot_cell(i,j), add dot-nodes that start from the /complete/
 +        // superIterms in
 +        // chart_cell(i,j)
 +        if (LOG.isDebugEnabled())
 +          LOG.debug("Initializing new dot-items that start from complete items in this cell");
 +        for (int k = 0; k < this.grammars.length; k++) {
 +          if (this.grammars[k].hasRuleForSpan(i, j, inputLattice.distance(i, j))) {
 +            this.dotcharts[k].startDotItems(i, j);
 +          }
 +        }
 +
 +        /*
 +         * 5. Sort the nodes in the cell.
 +         * 
 +         * Sort the nodes in this span, to make them usable for future
 +         * applications of cube pruning.
 +         */
 +        if (null != this.cells.get(i, j)) {
 +          this.cells.get(i, j).getSortedNodes();
 +        }
 +      }
 +    }
 +
 +    logStatistics();
 +
 +    // transition_final: setup a goal item, which may have many deductions
 +    if (null == this.cells.get(0, sourceLength)
 +        || !this.goalBin.transitToGoal(this.cells.get(0, sourceLength), this.featureFunctions,
 +            this.sourceLength)) {
 +      LOG.warn("Input {}: Parse failure (either no derivations exist or pruning is too aggressive",
 +          sentence.id());
 +      return null;
 +    }
 +
 +    if (LOG.isDebugEnabled())
 +      LOG.debug("Finished expand");
 +    return new HyperGraph(this.goalBin.getSortedNodes().get(0), -1, -1, this.sentence);
 +  }
 +
 +  /**
 +   * Get the requested cell, creating the entry if it doesn't already exist.
 +   * 
 +   * @param i span start
 +   * @param j span end
 +   * @return the cell item
 +   */
 +  public Cell getCell(int i, int j) {
 +    assert i >= 0;
 +    assert i <= sentence.length();
 +    assert i <= j;
 +    if (cells.get(i, j) == null)
 +      cells.set(i, j, new Cell(this, goalSymbolID));
 +
 +    return cells.get(i, j);
 +  }
 +
 +  // ===============================================================
 +  // Private methods
 +  // ===============================================================
 +
 +  private void logStatistics() {
 +    if (LOG.isDebugEnabled())
 +      LOG.debug("Input {}: Chart: added {} merged {} dot-items added: {}",
 +          this.sentence.id(), this.nAdded, this.nMerged, this.nDotitemAdded);
 +  }
 +
 +  /**
 +   * Handles expansion of unary rules. Rules are expanded in an agenda-based
 +   * manner to avoid constructing infinite unary chains. Assumes a triangle
 +   * inequality of unary rule expansion (e.g., A -> B will always be cheaper
 +   * than A -> C -> B), which is not a true assumption.
 +   * 
 +   * @param grammars A list of the grammars for the sentence
 +   * @param i
 +   * @param j
 +   * @return the number of nodes added
 +   */
 +  private int addUnaryNodes(Grammar[] grammars, int i, int j) {
 +
 +    Cell chartBin = this.cells.get(i, j);
 +    if (null == chartBin) {
 +      return 0;
 +    }
 +    int qtyAdditionsToQueue = 0;
-     ArrayList<HGNode> queue = new ArrayList<HGNode>(chartBin.getSortedNodes());
-     HashSet<Integer> seen_lhs = new HashSet<Integer>();
++    ArrayList<HGNode> queue = new ArrayList<>(chartBin.getSortedNodes());
++    HashSet<Integer> seen_lhs = new HashSet<>();
 +
 +    if (LOG.isDebugEnabled())
 +      LOG.debug("Adding unary to [{}, {}]", i, j);
 +
 +    while (queue.size() > 0) {
 +      HGNode node = queue.remove(0);
 +      seen_lhs.add(node.lhs);
 +
 +      for (Grammar gr : grammars) {
 +        if (!gr.hasRuleForSpan(i, j, inputLattice.distance(i, j)))
 +          continue;
 +
 +        /*
 +         * Match against the node's LHS, and then make sure the rule collection
 +         * has unary rules
 +         */
 +        Trie childNode = gr.getTrieRoot().match(node.lhs);
 +        if (childNode != null && childNode.getRuleCollection() != null
 +            && childNode.getRuleCollection().getArity() == 1) {
 +
-           ArrayList<HGNode> antecedents = new ArrayList<HGNode>();
++          ArrayList<HGNode> antecedents = new ArrayList<>();
 +          antecedents.add(node);
 +
 +          List<Rule> rules = childNode.getRuleCollection().getSortedRules(this.featureFunctions);
 +          for (Rule rule : rules) { // for each unary rules
 +
 +            ComputeNodeResult states = new ComputeNodeResult(this.featureFunctions, rule,
 +                antecedents, i, j, new SourcePath(), this.sentence);
 +            HGNode resNode = chartBin.addHyperEdgeInCell(states, rule, i, j, antecedents,
 +                new SourcePath(), true);
 +
 +            if (LOG.isDebugEnabled())
 +              LOG.debug("{}", rule);
 +            if (null != resNode && !seen_lhs.contains(resNode.lhs)) {
 +              queue.add(resNode);
 +              qtyAdditionsToQueue++;
 +            }
 +          }
 +        }
 +      }
 +    }
 +    return qtyAdditionsToQueue;
 +  }
 +
 +  /***
 +   * Add a terminal production (X -&gt; english phrase) to the hypergraph.
 +   * 
 +   * @param i the start index
 +   * @param j stop index
 +   * @param rule the terminal rule applied
 +   * @param srcPath the source path cost
 +   */
 +  public void addAxiom(int i, int j, Rule rule, SourcePath srcPath) {
 +    if (null == this.cells.get(i, j)) {
 +      this.cells.set(i, j, new Cell(this, this.goalSymbolID));
 +    }
 +
 +    this.cells.get(i, j).addHyperEdgeInCell(
 +        new ComputeNodeResult(this.featureFunctions, rule, null, i, j, srcPath, sentence), rule, i,
 +        j, null, srcPath, false);
 +
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
index 1fb1031,0000000..0e7cd6d
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/ComputeNodeResult.java
@@@ -1,226 -1,0 +1,223 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class computes the cost of applying a rule.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +
 +public class ComputeNodeResult {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(ComputeNodeResult.class);
 +
 +  // The cost incurred by the rule itself (and all associated feature functions)
 +  private float transitionCost;
 +
 +  // transitionCost + the Viterbi costs of the tail nodes.
 +  private float viterbiCost;
 +
-   // viterbiCost + a future estimate (outside cost estimate).
-   private float pruningCostEstimate;
- 
++  // The future or outside cost (estimated)
++  private float futureCostEstimate;
++  
 +  // The StateComputer objects themselves serve as keys.
-   private List<DPState> dpStates;
++  private final List<DPState> dpStates;
 +
 +  /**
 +   * Computes the new state(s) that are produced when applying the given rule to the list of tail
 +   * nodes. Also computes a range of costs of doing so (the transition cost, the total (Viterbi)
 +   * cost, and a score that includes a future cost estimate).
 +   * 
 +   * Old version that doesn't use the derivation state.
 +   * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param rule {@link org.apache.joshua.decoder.ff.tm.Rule} to use when computing th node result
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode}'s
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source lattice
 +   * @param sentence the lattice input
 +   */
 +  public ComputeNodeResult(List<FeatureFunction> featureFunctions, Rule rule, List<HGNode> tailNodes,
 +      int i, int j, SourcePath sourcePath, Sentence sentence) {
 +
 +    // The total Viterbi cost of this edge. This is the Viterbi cost of the tail nodes, plus
 +    // whatever costs we incur applying this rule to create a new hyperedge.
-     float viterbiCost = 0.0f;
++    this.viterbiCost = 0.0f;
 +    
 +    if (LOG.isDebugEnabled()) {
 +      LOG.debug("ComputeNodeResult():");
 +      LOG.debug("-> RULE {}", rule);
 +    }
 +
 +    /*
 +     * Here we sum the accumulated cost of each of the tail nodes. The total cost of the new
 +     * hyperedge (the inside or Viterbi cost) is the sum of these nodes plus the cost of the
 +     * transition. Note that this could and should all be generalized to whatever semiring is being
 +     * used.
 +     */
 +    if (null != tailNodes) {
 +      for (HGNode item : tailNodes) {
 +        if (LOG.isDebugEnabled()) {
 +          LOG.debug("-> item.bestedge: {}", item);
 +          LOG.debug("-> TAIL NODE {}", item);
 +        }
 +        viterbiCost += item.bestHyperedge.getBestDerivationScore();
 +      }
 +    }
 +
-     List<DPState> allDPStates = new ArrayList<DPState>();
++    List<DPState> allDPStates = new ArrayList<>();
 +
 +    // The transition cost is the new cost incurred by applying this rule
-     float transitionCost = 0.0f;
++    this.transitionCost = 0.0f;
 +
 +    // The future cost estimate is a heuristic estimate of the outside cost of this edge.
-     float futureCostEstimate = 0.0f;
++    this.futureCostEstimate = 0.0f;
 +
 +    /*
 +     * We now iterate over all the feature functions, computing their cost and their expected future
 +     * cost.
 +     */
 +    for (FeatureFunction feature : featureFunctions) {
 +      FeatureFunction.ScoreAccumulator acc = feature.new ScoreAccumulator(); 
 +
 +      DPState newState = feature.compute(rule, tailNodes, i, j, sourcePath, sentence, acc);
-       transitionCost += acc.getScore();
++      this.transitionCost += acc.getScore();
 +
 +
 +      if (LOG.isDebugEnabled()) {
 +        LOG.debug("FEATURE {} = {} * {} = {}", feature.getName(),
 +            acc.getScore() / Decoder.weights.getOrDefault(hashFeature(feature.getName())),
 +            Decoder.weights.getOrDefault(hashFeature(feature.getName())), acc.getScore());
 +      }
 +
 +      if (feature.isStateful()) {
 +        futureCostEstimate += feature.estimateFutureCost(rule, newState, sentence);
 +        allDPStates.add(((StatefulFF)feature).getStateIndex(), newState);
 +      }
 +    }
-     viterbiCost += transitionCost;
++    this.viterbiCost += transitionCost;
 +    if (LOG.isDebugEnabled())
 +      LOG.debug("-> COST = {}", transitionCost);
-     // Set the final results.
-     this.pruningCostEstimate = viterbiCost + futureCostEstimate;
-     this.viterbiCost = viterbiCost;
-     this.transitionCost = transitionCost;
++
 +    this.dpStates = allDPStates;
 +  }
 +
 +  /**
 +   * This is called from {@link org.apache.joshua.decoder.chart_parser.Cell} 
 +   * when making the final transition to the goal state.
 +   * This is done to allow feature functions to correct for partial estimates, since
 +   * they now have the knowledge that the whole sentence is complete. Basically, this
 +   * is only used by LanguageModelFF, which does not score partial n-grams, and therefore
 +   * needs to correct for this when a short sentence ends. KenLMFF corrects for this by
 +   * always scoring partial hypotheses, and subtracting off the partial score when longer
 +   * context is available. This would be good to do for the LanguageModelFF feature function,
 +   * too: it makes search better (more accurate at the beginning, for example), and would
 +   * also do away with the need for the computeFinal* class of functions (and hooks in
 +   * the feature function interface).
 +   * 
 +   * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param tailNodes {@link java.util.List} of {@link org.apache.joshua.decoder.hypergraph.HGNode}'s
 +   * @param i todo
 +   * @param j todo
 +   * @param sourcePath information about a path taken through the source lattice
 +   * @param sentence the lattice input
 +   * @return the final cost for the Node
 +   */
 +  public static float computeFinalCost(List<FeatureFunction> featureFunctions,
 +      List<HGNode> tailNodes, int i, int j, SourcePath sourcePath, Sentence sentence) {
 +
 +    float cost = 0;
 +    for (FeatureFunction ff : featureFunctions) {
 +      cost += ff.computeFinalCost(tailNodes.get(0), i, j, sourcePath, sentence);
 +    }
 +    return cost;
 +  }
 +
 +  public static FeatureVector computeTransitionFeatures(List<FeatureFunction> featureFunctions,
 +      HyperEdge edge, int i, int j, Sentence sentence) {
 +
 +    // Initialize the set of features with those that were present with the rule in the grammar.
 +    FeatureVector featureDelta = new FeatureVector(featureFunctions.size());
 +
 +    // === compute feature logPs
 +    for (FeatureFunction ff : featureFunctions) {
 +      // A null rule signifies the final transition.
 +      if (edge.getRule() == null)
 +        featureDelta.addInPlace(ff.computeFinalFeatures(edge.getTailNodes().get(0), i, j, edge.getSourcePath(), sentence));
 +      else {
 +        featureDelta.addInPlace(ff.computeFeatures(edge.getRule(), edge.getTailNodes(), i, j, edge.getSourcePath(), sentence));
 +      }
 +    }
 +
 +    return featureDelta;
 +  }
 +
++  public float getFutureEstimate() {
++    return this.futureCostEstimate;
++  }
++  
 +  public float getPruningEstimate() {
-     return this.pruningCostEstimate;
++    return getViterbiCost() + getFutureEstimate();
 +  }
 +
 +  /**
-    *  The complete cost of the Viterbi derivation at this point
++   *  The complete cost of the Viterbi derivation at this point.
++   *  
 +   *  @return float representing cost
 +   */
 +  public float getViterbiCost() {
 +    return this.viterbiCost;
 +  }
 +
 +  public float getBaseCost() {
 +    return getViterbiCost() - getTransitionCost();
 +  }
 +
 +  /**
 +   * The cost incurred by this edge alone
 +   * 
 +   * @return float representing cost
 +   */
 +  public float getTransitionCost() {
 +    return this.transitionCost;
 +  }
 +
 +  public List<DPState> getDPStates() {
 +    return this.dpStates;
 +  }
- 
-   public void printInfo() {
-     System.out.println("scores: " + transitionCost + "; " + viterbiCost + "; "
-         + pruningCostEstimate);
-   }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/CubePruneState.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/CubePruneState.java
index d57a6a2,0000000..1f06d30
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/CubePruneState.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/CubePruneState.java
@@@ -1,114 -1,0 +1,112 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import java.util.Arrays;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.chart_parser.DotChart.DotNode;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +
 +// ===============================================================
 +// CubePruneState class
 +// ===============================================================
 +public class CubePruneState implements Comparable<CubePruneState> {
-   int[] ranks;
-   ComputeNodeResult computeNodeResult;
-   List<HGNode> antNodes;
-   List<Rule> rules;
++  final int[] ranks;
++  final ComputeNodeResult computeNodeResult;
++  final List<HGNode> antNodes;
++  final List<Rule> rules;
 +  private DotNode dotNode;
 +
 +  public CubePruneState(ComputeNodeResult score, int[] ranks, List<Rule> rules, List<HGNode> antecedents, DotNode dotNode) {
 +    this.computeNodeResult = score;
 +    this.ranks = ranks;
 +    this.rules = rules;
 +    this.antNodes = antecedents;
 +    this.dotNode = dotNode;
 +  }
 +
 +  /**
 +   * This returns the list of DP states associated with the result.
 +   * 
 +   * @return
 +   */
 +  List<DPState> getDPStates() {
 +    return this.computeNodeResult.getDPStates();
 +  }
 +  
 +  Rule getRule() {
 +    return this.rules.get(this.ranks[0]-1);
 +  }
 +
 +  public String toString() {
-     StringBuilder sb = new StringBuilder();
-     sb.append("STATE ||| rule=" + getRule() + " inside cost = " + computeNodeResult.getViterbiCost()
-         + " estimate = " + computeNodeResult.getPruningEstimate());
-     return sb.toString();
++    String sb = "STATE ||| rule=" + getRule() + " inside cost = " +
++        computeNodeResult.getViterbiCost() + " estimate = " +
++        computeNodeResult.getPruningEstimate();
++    return sb;
 +  }
 +
 +  public void setDotNode(DotNode node) {
 +    this.dotNode = node;
 +  }
 +
 +  public DotNode getDotNode() {
 +    return this.dotNode;
 +  }
 +
 +  public boolean equals(Object obj) {
 +    if (obj == null)
 +      return false;
 +    if (!this.getClass().equals(obj.getClass()))
 +      return false;
 +    CubePruneState state = (CubePruneState) obj;
 +    if (state.ranks.length != ranks.length)
 +      return false;
 +    for (int i = 0; i < ranks.length; i++)
 +      if (state.ranks[i] != ranks[i])
 +        return false;
-     if (getDotNode() != state.getDotNode())
-       return false;
++    return getDotNode() == state.getDotNode();
 +
-     return true;
 +  }
 +
 +  public int hashCode() {
 +    int hash = (dotNode != null) ? dotNode.hashCode() : 0;
 +    hash += Arrays.hashCode(ranks);
 +
 +    return hash;
 +  }
 +
 +  /**
 +   * Compares states by ExpectedTotalLogP, allowing states to be sorted according to their inverse
 +   * order (high-prob first).
 +   */
 +  public int compareTo(CubePruneState another) {
 +    if (this.computeNodeResult.getPruningEstimate() < another.computeNodeResult
 +        .getPruningEstimate()) {
 +      return 1;
 +    } else if (this.computeNodeResult.getPruningEstimate() == another.computeNodeResult
 +        .getPruningEstimate()) {
 +      return 0;
 +    } else {
 +      return -1;
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/DotChart.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/DotChart.java
index 71c4f03,0000000..8b5c81a
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/DotChart.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/DotChart.java
@@@ -1,476 -1,0 +1,474 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.lattice.Arc;
 +import org.apache.joshua.lattice.Lattice;
 +import org.apache.joshua.lattice.Node;
 +import org.apache.joshua.util.ChartSpan;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * The DotChart handles Earley-style implicit binarization of translation rules.
 + * 
 + * The {@link DotNode} object represents the (possibly partial) application of a synchronous rule.
 + * The implicit binarization is maintained with a pointer to the {@link Trie} node in the grammar,
 + * for easy retrieval of the next symbol to be matched. At every span (i,j) of the input sentence,
 + * every incomplete DotNode is examined to see whether it (a) needs a terminal and matches against
 + * the final terminal of the span or (b) needs a nonterminal and matches against a completed
 + * nonterminal in the main chart at some split point (k,j).
 + * 
 + * Once a rule is completed, it is entered into the {@link DotChart}. {@link DotCell} objects are
 + * used to group completed DotNodes over a span.
 + * 
 + * There is a separate DotChart for every grammar.
 + * 
 + * @author Zhifei Li, <zh...@gmail.com>
 + * @author Matt Post <po...@cs.jhu.edu>
 + * @author Kristy Hollingshead Seitz
 + */
 +class DotChart {
 +
 +  // ===============================================================
 +  // Static fields
 +  // ===============================================================
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(DotChart.class);
 +
 +
 +  // ===============================================================
 +  // Package-protected instance fields
 +  // ===============================================================
 +  /**
 +   * Two-dimensional chart of cells. Some cells might be null. This could definitely be represented
 +   * more efficiently, since only the upper half of this triangle is every used.
 +   */
-   private ChartSpan<DotCell> dotcells;
++  private final ChartSpan<DotCell> dotcells;
 +
 +  public DotCell getDotCell(int i, int j) {
 +    return dotcells.get(i, j);
 +  }
 +
 +  // ===============================================================
 +  // Private instance fields (maybe could be protected instead)
 +  // ===============================================================
 +
 +  /**
 +   * CKY+ style parse chart in which completed span entries are stored.
 +   */
-   private Chart dotChart;
++  private final Chart dotChart;
 +
 +  /**
 +   * Translation grammar which contains the translation rules.
 +   */
-   private Grammar pGrammar;
++  private final Grammar pGrammar;
 +
 +  /* Length of input sentence. */
 +  private final int sentLen;
 +
 +  /* Represents the input sentence being translated. */
 +  private final Lattice<Token> input;
 +
 +  // ===============================================================
 +  // Constructors
 +  // ===============================================================
 +
 +  // TODO: Maybe this should be a non-static inner class of Chart. That would give us implicit
 +  // access to all the arguments of this constructor. Though we would need to take an argument, i,
 +  // to know which Chart.this.grammars[i] to use.
 +
 +  /**
 +   * Constructs a new dot chart from a specified input lattice, a translation grammar, and a parse
 +   * chart.
 +   * 
 +   * @param input A lattice which represents an input sentence.
 +   * @param grammar A translation grammar.
 +   * @param chart A CKY+ style chart in which completed span entries are stored.
 +   */
 +  public DotChart(Lattice<Token> input, Grammar grammar, Chart chart) {
 +
 +    this.dotChart = chart;
 +    this.pGrammar = grammar;
 +    this.input = input;
 +    this.sentLen = input.size();
-     this.dotcells = new ChartSpan<DotCell>(sentLen, null);
++    this.dotcells = new ChartSpan<>(sentLen, null);
 +
 +    seed();
 +  }
 +
 +  /**
 +   * Add initial dot items: dot-items pointer to the root of the grammar trie.
 +   */
 +  void seed() {
 +    for (int j = 0; j <= sentLen - 1; j++) {
 +      if (pGrammar.hasRuleForSpan(j, j, input.distance(j, j))) {
 +        if (null == pGrammar.getTrieRoot()) {
 +          throw new RuntimeException("trie root is null");
 +        }
 +        addDotItem(pGrammar.getTrieRoot(), j, j, null, null, new SourcePath());
 +      }
 +    }
 +  }
 +
 +  /**
 +   * This function computes all possible expansions of all rules over the provided span (i,j). By
 +   * expansions, we mean the moving of the dot forward (from left to right) over a nonterminal or
 +   * terminal symbol on the rule's source side.
 +   * 
 +   * There are two kinds of expansions:
 +   * 
 +   * <ol>
 +   * <li>Expansion over a nonterminal symbol. For this kind of expansion, a rule has a dot
 +   * immediately prior to a source-side nonterminal. The main Chart is consulted to see whether
 +   * there exists a completed nonterminal with the same label. If so, the dot is advanced.
 +   * 
 +   * Discovering nonterminal expansions is a matter of enumerating all split points k such that i <
 +   * k and k < j. The nonterminal symbol must exist in the main Chart over (k,j).
 +   * 
 +   * <li>Expansion over a terminal symbol. In this case, expansion is a simple matter of determing
 +   * whether the input symbol at position j (the end of the span) matches the next symbol in the
 +   * rule. This is equivalent to choosing a split point k = j - 1 and looking for terminal symbols
 +   * over (k,j). Note that phrases in the input rule are handled one-by-one as we consider longer
 +   * spans.
 +   * </ol>
 +   */
 +  void expandDotCell(int i, int j) {
 +    if (LOG.isDebugEnabled())
 +      LOG.debug("Expanding dot cell ({}, {})", i, j);
 +
 +    /*
 +     * (1) If the dot is just to the left of a non-terminal variable, we look for theorems or axioms
 +     * in the Chart that may apply and extend the dot position. We look for existing axioms over all
 +     * spans (k,j), i < k < j.
 +     */
 +    for (int k = i + 1; k < j; k++) {
 +      extendDotItemsWithProvedItems(i, k, j, false);
 +    }
 +
 +    /*
 +     * (2) If the the dot-item is looking for a source-side terminal symbol, we simply match against
 +     * the input sentence and advance the dot.
 +     */
 +    Node<Token> node = input.getNode(j - 1);
 +    for (Arc<Token> arc : node.getOutgoingArcs()) {
 +
 +      int last_word = arc.getLabel().getWord();
 +      int arc_len = arc.getHead().getNumber() - arc.getTail().getNumber();
 +
 +      // int last_word=foreign_sent[j-1]; // input.getNode(j-1).getNumber(); //
 +
 +      if (null != dotcells.get(i, j - 1)) {
 +        // dotitem in dot_bins[i][k]: looking for an item in the right to the dot
 +
 +
 +        for (DotNode dotNode : dotcells.get(i, j - 1).getDotNodes()) {
 +
 +          // String arcWord = Vocabulary.word(last_word);
 +          // Assert.assertFalse(arcWord.endsWith("]"));
 +          // Assert.assertFalse(arcWord.startsWith("["));
 +          // logger.info("DotChart.expandDotCell: " + arcWord);
 +
 +          // List<Trie> child_tnodes = ruleMatcher.produceMatchingChildTNodesTerminalevel(dotNode,
 +          // last_word);
 +
 +          List<Trie> child_tnodes = null;
 +
 +          Trie child_node = dotNode.trieNode.match(last_word);
 +          if (null != child_node) {
 +            addDotItem(child_node, i, j - 1 + arc_len, dotNode.antSuperNodes, null,
 +                dotNode.srcPath.extend(arc));
 +          }
 +        }
 +      }
 +    }
 +  }
 +
 +  /**
 +   * note: (i,j) is a non-terminal, this cannot be a cn-side terminal, which have been handled in
 +   * case2 of dotchart.expand_cell add dotitems that start with the complete super-items in
 +   * cell(i,j)
 +   */
 +  void startDotItems(int i, int j) {
 +    extendDotItemsWithProvedItems(i, i, j, true);
 +  }
 +
 +  // ===============================================================
 +  // Private methods
 +  // ===============================================================
 +
 +  /**
 +   * Attempt to combine an item in the dot chart with an item in the main chart to create a new item
 +   * in the dot chart. The DotChart item is a {@link DotNode} begun at position i with the dot
 +   * currently at position k, that is, a partially-applied rule.
 +   * 
 +   * In other words, this method looks for (proved) theorems or axioms in the completed chart that
 +   * may apply and extend the dot position.
 +   * 
 +   * @param i Start index of a dot chart item
 +   * @param k End index of a dot chart item; start index of a completed chart item
 +   * @param j End index of a completed chart item
 +   * @param skipUnary if true, don't extend unary rules
 +   */
 +  private void extendDotItemsWithProvedItems(int i, int k, int j, boolean skipUnary) {
 +    if (this.dotcells.get(i, k) == null || this.dotChart.getCell(k, j) == null) {
 +      return;
 +    }
 +
 +    // complete super-items (items over the same span with different LHSs)
-     List<SuperNode> superNodes = new ArrayList<SuperNode>(this.dotChart.getCell(k, j)
-         .getSortedSuperItems().values());
++    List<SuperNode> superNodes = new ArrayList<>(this.dotChart.getCell(k, j).getSortedSuperItems().values());
 +
 +    /* For every partially complete item over (i,k) */
 +    for (DotNode dotNode : dotcells.get(i, k).dotNodes) {
 +      /* For every completed nonterminal in the main chart */
 +      for (SuperNode superNode : superNodes) {
 +
 +        // String arcWord = Vocabulary.word(superNode.lhs);
 +        // logger.info("DotChart.extendDotItemsWithProvedItems: " + arcWord);
 +        // Assert.assertTrue(arcWord.endsWith("]"));
 +        // Assert.assertTrue(arcWord.startsWith("["));
 +
 +        /*
 +         * Regular Expression matching allows for a regular-expression style rules in the grammar,
 +         * which allows for a very primitive treatment of morphology. This is an advanced,
 +         * undocumented feature that introduces a complexity, in that the next "word" in the grammar
 +         * rule might match more than one outgoing arc in the grammar trie.
 +         */
 +        Trie child_node = dotNode.getTrieNode().match(superNode.lhs);
 +        if (child_node != null) {
 +          if ((!skipUnary) || (child_node.hasExtensions())) {
 +            addDotItem(child_node, i, j, dotNode.getAntSuperNodes(), superNode, dotNode
 +                .getSourcePath().extendNonTerminal());
 +          }
 +        }
 +      }
 +    }
 +  }
 +
 +  /*
 +   * We introduced the ability to have regular expressions in rules for matching against terminals.
 +   * For example, you could have the rule
 +   * 
 +   * <pre> [X] ||| l?s herman?s ||| siblings </pre>
 +   * 
 +   * When this is enabled for a grammar, we need to test against *all* (positive) outgoing arcs of
 +   * the grammar trie node to see if any of them match, and then return the whole set. This is quite
 +   * expensive, which is why you should only enable regular expressions for small grammars.
 +   */
 +
 +  private ArrayList<Trie> matchAll(DotNode dotNode, int wordID) {
 +    ArrayList<Trie> trieList = new ArrayList<>();
 +    HashMap<Integer, ? extends Trie> childrenTbl = dotNode.trieNode.getChildren();
 +
 +    if (childrenTbl != null && wordID >= 0) {
 +      // get all the extensions, map to string, check for *, build regexp
 +      for (Map.Entry<Integer, ? extends Trie> entry : childrenTbl.entrySet()) {
 +        Integer arcID = entry.getKey();
 +        if (arcID == wordID) {
 +          trieList.add(entry.getValue());
 +        } else {
 +          String arcWord = Vocabulary.word(arcID);
 +          if (Vocabulary.word(wordID).matches(arcWord)) {
 +            trieList.add(entry.getValue());
 +          }
 +        }
 +      }
 +    }
 +    return trieList;
 +  }
 +
 +
 +  /**
 +   * Creates a {@link DotNode} and adds it into the {@link DotChart} at the correct place. These
 +   * are (possibly incomplete) rule applications. 
 +   * 
 +   * @param tnode the trie node pointing to the location ("dot") in the grammar trie
 +   * @param i
 +   * @param j
 +   * @param antSuperNodesIn the supernodes representing the rule's tail nodes
 +   * @param curSuperNode the lefthand side of the rule being created
 +   * @param srcPath the path taken through the input lattice
 +   */
 +  private void addDotItem(Trie tnode, int i, int j, ArrayList<SuperNode> antSuperNodesIn,
 +      SuperNode curSuperNode, SourcePath srcPath) {
-     ArrayList<SuperNode> antSuperNodes = new ArrayList<SuperNode>();
++    ArrayList<SuperNode> antSuperNodes = new ArrayList<>();
 +    if (antSuperNodesIn != null) {
 +      antSuperNodes.addAll(antSuperNodesIn);
 +    }
 +    if (curSuperNode != null) {
 +      antSuperNodes.add(curSuperNode);
 +    }
 +
 +    DotNode item = new DotNode(i, j, tnode, antSuperNodes, srcPath);
 +    if (dotcells.get(i, j) == null) {
 +      dotcells.set(i, j, new DotCell());
 +    }
 +    dotcells.get(i, j).addDotNode(item);
 +    dotChart.nDotitemAdded++;
 +
 +    if (LOG.isDebugEnabled()) {
 +      LOG.debug("Add a dotitem in cell ({}, {}), n_dotitem={}, {}", i, j,
 +          dotChart.nDotitemAdded, srcPath);
 +
 +      RuleCollection rules = tnode.getRuleCollection();
 +      if (rules != null) {
 +        for (Rule r : rules.getRules()) {
 +          // System.out.println("rule: "+r.toString());
 +          LOG.debug("{}", r);
 +        }
 +      }
 +    }
 +  }
 +
 +  // ===============================================================
 +  // Package-protected classes
 +  // ===============================================================
 +
 +  /**
 +   * A DotCell groups together DotNodes that have been applied over a particular span. A DotNode, in
 +   * turn, is a partially-applied grammar rule, represented as a pointer into the grammar trie
 +   * structure.
 +   */
 +  static class DotCell {
 +
 +    // Package-protected fields
-     private List<DotNode> dotNodes = new ArrayList<DotNode>();
++    private final List<DotNode> dotNodes = new ArrayList<>();
 +
 +    public List<DotNode> getDotNodes() {
 +      return dotNodes;
 +    }
 +
 +    private void addDotNode(DotNode dt) {
 +      /*
 +       * if(l_dot_items==null) l_dot_items= new ArrayList<DotItem>();
 +       */
 +      dotNodes.add(dt);
 +    }
 +  }
 +
 +  /**
 +   * A DotNode represents the partial application of a rule rooted to a particular span (i,j). It
 +   * maintains a pointer to the trie node in the grammar for efficient mapping.
 +   */
 +  static class DotNode {
 +
-     private int i, j;
++    private final int i;
++    private final int j;
 +    private Trie trieNode = null;
 +    
 +    /* A list of grounded (over a span) nonterminals that have been crossed in traversing the rule */
 +    private ArrayList<SuperNode> antSuperNodes = null;
 +    
 +    /* The source lattice cost of applying the rule */
-     private SourcePath srcPath;
++    private final SourcePath srcPath;
 +
 +    @Override
 +    public String toString() {
 +      int size = 0;
 +      if (trieNode != null && trieNode.getRuleCollection() != null)
 +        size = trieNode.getRuleCollection().getRules().size();
 +      return String.format("DOTNODE i=%d j=%d #rules=%d #tails=%d", i, j, size, antSuperNodes.size());
 +    }
 +    
 +    /**
 +     * Initialize a dot node with the span, grammar trie node, list of supernode tail pointers, and
 +     * the lattice sourcepath.
 +     * 
 +     * @param i
 +     * @param j
 +     * @param trieNode
 +     * @param antSuperNodes
 +     * @param srcPath
 +     */
 +    public DotNode(int i, int j, Trie trieNode, ArrayList<SuperNode> antSuperNodes, SourcePath srcPath) {
 +      this.i = i;
 +      this.j = j;
 +      this.trieNode = trieNode;
 +      this.antSuperNodes = antSuperNodes;
 +      this.srcPath = srcPath;
 +    }
 +
 +    public boolean equals(Object obj) {
 +      if (obj == null)
 +        return false;
 +      if (!this.getClass().equals(obj.getClass()))
 +        return false;
 +      DotNode state = (DotNode) obj;
 +
 +      /*
 +       * Technically, we should be comparing the span inforamtion as well, but that would require us
 +       * to store it, increasing memory requirements, and we should be able to guarantee that we
 +       * won't be comparing DotNodes across spans.
 +       */
 +      // if (this.i != state.i || this.j != state.j)
 +      // return false;
 +
-       if (this.trieNode != state.trieNode)
-         return false;
++      return this.trieNode == state.trieNode;
 +
-       return true;
 +    }
 +
 +    /**
 +     * Technically the hash should include the span (i,j), but since DotNodes are grouped by span,
 +     * this isn't necessary, and we gain something by not having to store the span.
 +     */
 +    public int hashCode() {
 +      return this.trieNode.hashCode();
 +    }
 +
 +    // convenience function
 +    public boolean hasRules() {
 +      return getTrieNode().getRuleCollection() != null && getTrieNode().getRuleCollection().getRules().size() != 0;
 +    }
 +    
 +    public RuleCollection getRuleCollection() {
 +      return getTrieNode().getRuleCollection();
 +    }
 +
 +    public Trie getTrieNode() {
 +      return trieNode;
 +    }
 +
 +    public SourcePath getSourcePath() {
 +      return srcPath;
 +    }
 +
 +    public ArrayList<SuperNode> getAntSuperNodes() {
 +      return antSuperNodes;
 +    }
 +
 +    public int begin() {
 +      return i;
 +    }
 +    
 +    public int end() {
 +      return j;
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SourcePath.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SourcePath.java
index 1d96149,0000000..efc6688
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SourcePath.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SourcePath.java
@@@ -1,63 -1,0 +1,63 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.lattice.Arc;
 +
 +/**
 + * This class represents information about a path taken through the source lattice.
 + * 
 + * <p>This implementation only tracks the source path cost which is assumed to be a scalar value.
 + *       If you need multiple values, or want to recover more detailed path statistics, you'll need
 + *       to update this code.
 + */
 +public class SourcePath {
 +
 +  private final float pathCost;
 +
 +  public SourcePath() {
 +    pathCost = 0.0f;
 +  }
 +
 +  private SourcePath(float cost) {
 +    pathCost = cost;
 +  }
 +
 +  public float getPathCost() {
 +    return pathCost;
 +  }
 +
 +  public SourcePath extend(Arc<Token> srcEdge) {
-     float tcost = (float) srcEdge.getCost();
++    float tcost = srcEdge.getCost();
 +    if (tcost == 0.0)
 +      return this;
 +    else
-       return new SourcePath(pathCost + (float) srcEdge.getCost());
++      return new SourcePath(pathCost + srcEdge.getCost());
 +  }
 +
 +  public SourcePath extendNonTerminal() {
 +    return this;
 +  }
 +
 +  public String toString() {
 +    return "SourcePath.cost=" + pathCost;
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/StateConstraint.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/StateConstraint.java
index d21ceca,0000000..b6b27c8
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/StateConstraint.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/StateConstraint.java
@@@ -1,75 -1,0 +1,74 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import java.util.Collection;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.state_maintenance.NgramDPState;
 +
 +/**
 + * This class provides constraints on the sorts of states that are permitted in the chart. Its
 + * original motivation was to be used as a means of doing forced decoding, which is accomplished by
 + * forcing all n-gram states that are created to match the target string.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * 
 + */
 +public class StateConstraint {
 +  private String target = null;
 +
 +  public StateConstraint(String target) {
 +    this.target = " <s> " + target + " </s> ";
 +  }
 +
 +  /**
 +   * Determines if all of the states passed in are legal in light of the input that was passed
 +   * earlier. Currently only defined for n-gram states.
 +   * 
 +   * @param dpStates {@link java.util.Collection} of {@link org.apache.joshua.decoder.ff.state_maintenance.DPState}'s
 +   * @return whether the states are legal in light of the target side sentence
 +   */
 +  public boolean isLegal(Collection<DPState> dpStates) {
 +    /*
 +     * Iterate over all the state-contributing objects associated with the new state, querying
 +     * n-gram ones (of which there is probably only one), allowing them to veto the move.
 +     */
 +    for (DPState dpState : dpStates) {
 +      if (dpState instanceof NgramDPState) {
 +        // Build a regular expression out of the state context.
 +        String leftWords = " "
 +            + Vocabulary.getWords(((NgramDPState) dpState).getLeftLMStateWords()) + " ";
 +        String rightWords = " "
 +            + Vocabulary.getWords(((NgramDPState) dpState).getRightLMStateWords()) + " ";
 +
 +        int leftPos = this.target.indexOf(leftWords);
 +        int rightPos = this.target.lastIndexOf(rightWords);
 +
-         boolean legal = (leftPos != -1 && leftPos <= rightPos);
- //        System.err.println(String.format("  isLegal(%s @ %d,%s @ %d) = %s", leftWords, leftPos,
++        //        System.err.println(String.format("  isLegal(%s @ %d,%s @ %d) = %s", leftWords, leftPos,
 +//         rightWords, rightPos, legal));
 +
-         return legal;
++        return (leftPos != -1 && leftPos <= rightPos);
 +      }
 +    }
 +
 +    return true;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SuperNode.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SuperNode.java
index a7c6e34,0000000..f228836
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SuperNode.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/SuperNode.java
@@@ -1,62 -1,0 +1,62 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +
 +/**
 + * Represents a list of items in the hypergraph that have the same left-hand side but may have
 + * different LM states.
 + * 
 + * @author Zhifei Li
 + */
 +class SuperNode {
 +
 +  /** Common left-hand side state. */
 +  final int lhs;
 +
 +  /**
 +   * List of hypergraph nodes, each of which has its own language model state.
 +   */
 +  final List<HGNode> nodes;
 +
 +  /**
 +   * All nodes in a SuperNode have the same start and end points, so we pick the first one and
 +   * return it.
 +   * 
 +   * @return
 +   */
 +  public int end() {
 +    return nodes.get(0).j;
 +  }
 +  
 +  
 +  /**
 +   * Constructs a super item defined by a common left-hand side.
 +   * 
 +   * @param lhs Left-hand side token
 +   */
 +  public SuperNode(int lhs) {
 +    this.lhs = lhs;
-     this.nodes = new ArrayList<HGNode>();
++    this.nodes = new ArrayList<>();
 +  }
 +}


[50/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
moved resources files


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/19b557bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/19b557bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/19b557bc

Branch: refs/heads/7
Commit: 19b557bca85b0ccb0009f0c6865d39ba438d507a
Parents: dc75670
Author: Matt Post <po...@cs.jhu.edu>
Authored: Tue Aug 23 17:17:04 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Tue Aug 23 17:17:04 2016 -0500

----------------------------------------------------------------------
 .../decoder/ff/lm/class_lm/ClassMapTest.java    |    2 +-
 joshua-core/src/test/resources/berkeley_lm/lm   |   16 +
 .../test/resources/berkeley_lm/lm.berkeleylm    |  Bin 0 -> 4294 bytes
 .../test/resources/berkeley_lm/lm.berkeleylm.gz |  Bin 0 -> 1786 bytes
 .../src/test/resources/berkeley_lm/lm.gz        |  Bin 0 -> 162 bytes
 joshua-core/src/test/resources/grammar.glue     |    4 +
 .../resources/kbest_extraction/glue-grammar     |    3 +
 .../src/test/resources/kbest_extraction/grammar |   25 +
 .../resources/kbest_extraction/joshua.config    |   27 +
 .../src/test/resources/kbest_extraction/lm.gz   |  Bin 0 -> 2466496 bytes
 .../test/resources/kbest_extraction/output.gold | 3126 ++++++++++++++++++
 .../kbest_extraction/output.scores.gold         | 3126 ++++++++++++++++++
 .../src/test/resources/kenlm/oilers.kenlm       |  Bin 0 -> 49011 bytes
 .../src/test/resources/lm_oov/joshua.config     |   17 +
 .../src/test/resources/phrase_decoder/config    |   29 +
 .../resources/phrase_decoder/constrained.config |   28 +
 .../phrase_decoder/constrained.output.gold      |    5 +
 .../src/test/resources/phrase_decoder/lm.1.gz   |  Bin 0 -> 2235 bytes
 .../test/resources/phrase_decoder/output.gold   |    1 +
 .../test/resources/phrase_decoder/rules.1.gz    |  Bin 0 -> 2998042 bytes
 joshua-core/src/test/resources/wa_grammar       |    3 +
 .../src/test/resources/wa_grammar.packed/config |    2 +
 .../test/resources/wa_grammar.packed/encoding   |  Bin 0 -> 154 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 0 -> 45 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 0 -> 47 bytes
 .../wa_grammar.packed/slice_00000.source        |  Bin 0 -> 204 bytes
 .../wa_grammar.packed/slice_00000.target        |  Bin 0 -> 128 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 0 -> 32 bytes
 .../test/resources/wa_grammar.packed/vocabulary |  Bin 0 -> 238 bytes
 src/test/resources/berkeley_lm/lm               |   16 -
 src/test/resources/berkeley_lm/lm.berkeleylm    |  Bin 4294 -> 0 bytes
 src/test/resources/berkeley_lm/lm.berkeleylm.gz |  Bin 1786 -> 0 bytes
 src/test/resources/berkeley_lm/lm.gz            |  Bin 162 -> 0 bytes
 src/test/resources/grammar.glue                 |    4 -
 .../resources/kbest_extraction/glue-grammar     |    3 -
 src/test/resources/kbest_extraction/grammar     |   25 -
 .../resources/kbest_extraction/joshua.config    |   27 -
 src/test/resources/kbest_extraction/lm.gz       |  Bin 2466496 -> 0 bytes
 src/test/resources/kbest_extraction/output.gold | 3126 ------------------
 .../kbest_extraction/output.scores.gold         | 3126 ------------------
 src/test/resources/kenlm/oilers.kenlm           |  Bin 49011 -> 0 bytes
 src/test/resources/lm_oov/joshua.config         |   17 -
 src/test/resources/phrase_decoder/config        |   29 -
 .../resources/phrase_decoder/constrained.config |   28 -
 .../phrase_decoder/constrained.output.gold      |    5 -
 src/test/resources/phrase_decoder/lm.1.gz       |  Bin 2235 -> 0 bytes
 src/test/resources/phrase_decoder/output.gold   |    1 -
 src/test/resources/phrase_decoder/rules.1.gz    |  Bin 2998042 -> 0 bytes
 src/test/resources/wa_grammar                   |    3 -
 src/test/resources/wa_grammar.packed/config     |    2 -
 src/test/resources/wa_grammar.packed/encoding   |  Bin 154 -> 0 bytes
 .../wa_grammar.packed/slice_00000.alignments    |  Bin 45 -> 0 bytes
 .../wa_grammar.packed/slice_00000.features      |  Bin 47 -> 0 bytes
 .../wa_grammar.packed/slice_00000.source        |  Bin 204 -> 0 bytes
 .../wa_grammar.packed/slice_00000.target        |  Bin 128 -> 0 bytes
 .../wa_grammar.packed/slice_00000.target.lookup |  Bin 32 -> 0 bytes
 src/test/resources/wa_grammar.packed/vocabulary |  Bin 238 -> 0 bytes
 57 files changed, 6413 insertions(+), 6413 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassMapTest.java
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassMapTest.java b/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassMapTest.java
index 5d37a05..15096f1 100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassMapTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassMapTest.java
@@ -45,7 +45,7 @@ public class ClassMapTest {
   @Test
   public void givenClassMapFile_whenClassMapRead_thenEntriesAreRead() {
     // GIVEN
-    final String classMapFile = "./src/test/resources/lm/class_lm/class.map";
+    final String classMapFile = "src/test/resources/lm/class_lm/class.map";
 
     // WHEN
     final ClassMap classMap = new ClassMap(classMapFile);

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/berkeley_lm/lm
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/berkeley_lm/lm b/joshua-core/src/test/resources/berkeley_lm/lm
new file mode 100644
index 0000000..05b4e6b
--- /dev/null
+++ b/joshua-core/src/test/resources/berkeley_lm/lm
@@ -0,0 +1,16 @@
+
+\data\
+ngram 1=5
+ngram 2=3
+
+\1-grams:
+-99.000000	<unk>
+-99.000000	<s>	-1.752754
+-2.034158	the	-0.800943
+-5.318589	chat-rooms	-0.151088
+-1.495702	</s>
+
+\2-grams:
+-1.773970	<s> the
+-4.878868	the chat-rooms
+-0.499794	chat-rooms </s>

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm b/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm
new file mode 100644
index 0000000..c048464
Binary files /dev/null and b/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm.gz
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm.gz b/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm.gz
new file mode 100644
index 0000000..f9f8d16
Binary files /dev/null and b/joshua-core/src/test/resources/berkeley_lm/lm.berkeleylm.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/berkeley_lm/lm.gz
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/berkeley_lm/lm.gz b/joshua-core/src/test/resources/berkeley_lm/lm.gz
new file mode 100644
index 0000000..ae47266
Binary files /dev/null and b/joshua-core/src/test/resources/berkeley_lm/lm.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/grammar.glue
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/grammar.glue b/joshua-core/src/test/resources/grammar.glue
new file mode 100644
index 0000000..69e1520
--- /dev/null
+++ b/joshua-core/src/test/resources/grammar.glue
@@ -0,0 +1,4 @@
+[GOAL] ||| <s> ||| <s> ||| 0
+[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
+[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0
+[GOAL] ||| <s> [X,1] </s> ||| <s> [X,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/glue-grammar
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/glue-grammar b/joshua-core/src/test/resources/kbest_extraction/glue-grammar
new file mode 100644
index 0000000..6a1162f
--- /dev/null
+++ b/joshua-core/src/test/resources/kbest_extraction/glue-grammar
@@ -0,0 +1,3 @@
+[GOAL] ||| <s> ||| <s> ||| 0
+[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
+[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/grammar
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/grammar b/joshua-core/src/test/resources/kbest_extraction/grammar
new file mode 100644
index 0000000..a03b2d9
--- /dev/null
+++ b/joshua-core/src/test/resources/kbest_extraction/grammar
@@ -0,0 +1,25 @@
+[X] ||| a ||| A ||| 2 
+[X] ||| a ||| B ||| 3
+[X] ||| a ||| C ||| 5
+[X] ||| a ||| D ||| 7
+[X] ||| a ||| E ||| 11
+[X] ||| b ||| A ||| 13
+[X] ||| b ||| B ||| 17
+[X] ||| b ||| C ||| 19
+[X] ||| b ||| D ||| 23
+[X] ||| b ||| E ||| 29
+[X] ||| c ||| A ||| 31
+[X] ||| c ||| B ||| 37
+[X] ||| c ||| C ||| 41
+[X] ||| c ||| D ||| 43
+[X] ||| c ||| E ||| 47
+[X] ||| d ||| A ||| 53
+[X] ||| d ||| B ||| 59
+[X] ||| d ||| C ||| 61
+[X] ||| d ||| D ||| 67
+[X] ||| d ||| E ||| 71
+[X] ||| e ||| A ||| 73
+[X] ||| e ||| B ||| 79
+[X] ||| e ||| C ||| 83
+[X] ||| e ||| D ||| 89
+[X] ||| e ||| E ||| 97

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/joshua.config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/joshua.config b/joshua-core/src/test/resources/kbest_extraction/joshua.config
new file mode 100644
index 0000000..69ec9c9
--- /dev/null
+++ b/joshua-core/src/test/resources/kbest_extraction/joshua.config
@@ -0,0 +1,27 @@
+feature-function = StateMinimizingLanguageModel -lm_type kenlm -lm_order 5 -lm_file src/test/resources/kbest_extraction/lm.gz
+
+tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
+tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
+
+mark_oovs=false
+
+#tm config
+default_non_terminal=X
+goalSymbol=GOAL
+
+#pruning config
+pop-limit=100
+
+#nbest config
+use_unique_nbest=true
+top-n = 3126
+
+#feature_function = WordPenalty
+feature_function = OOVPenalty
+
+# Model Weights ####
+
+lm_0 1
+tm_pt_0 1
+tm_glue_0 1
+OOVPenalty 10000

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/lm.gz
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/lm.gz b/joshua-core/src/test/resources/kbest_extraction/lm.gz
new file mode 100644
index 0000000..a26335e
Binary files /dev/null and b/joshua-core/src/test/resources/kbest_extraction/lm.gz differ


[28/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/server/ServerThread.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/server/ServerThread.java
index 6cfea6c,0000000..e9f9c62
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/server/ServerThread.java
+++ b/joshua-core/src/main/java/org/apache/joshua/server/ServerThread.java
@@@ -1,297 -1,0 +1,300 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.server;
 +
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.io.BufferedReader;
 +import java.io.IOException;
 +import java.io.InputStreamReader;
 +import java.io.OutputStream;
 +import java.io.StringReader;
 +import java.io.UnsupportedEncodingException;
 +import java.net.Socket;
 +import java.net.SocketException;
 +import java.net.URLDecoder;
 +import java.nio.charset.Charset;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.HashMap;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.Translations;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.format.HieroFormatReader;
 +import org.apache.joshua.decoder.io.JSONMessage;
 +import org.apache.joshua.decoder.io.TranslationRequestStream;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import com.sun.net.httpserver.HttpExchange;
 +import com.sun.net.httpserver.HttpHandler;
 +
 +/**
 + * This class handles a concurrent request for translations from a newly opened socket, for
 + * both raw TCP/IP connections and for HTTP connections.
 + * 
 + */
 +public class ServerThread extends Thread implements HttpHandler {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(ServerThread.class);
 +  private static final Charset FILE_ENCODING = Charset.forName("UTF-8");
 +  
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  private Socket socket = null;
 +  private final Decoder decoder;
 +
 +  /**
 +   * Creates a new TcpServerThread that can run a set of translations.
 +   * 
 +   * @param socket the socket representing the input/output streams
 +   * @param decoder the configured decoder that handles performing translations
 +   * @param joshuaConfiguration a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   */
 +  public ServerThread(Socket socket, Decoder decoder, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    this.socket = socket;
 +    this.decoder = decoder;
 +  }
 +
 +  /**
 +   * Reads the input from the socket, submits the input to the decoder, transforms the resulting
 +   * translations into the required output format, writes out the formatted output, then closes the
 +   * socket.
 +   */
 +  @Override
 +  public void run() {
 +
 +    //TODO: use try-with-resources block
 +    try {
 +      BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), FILE_ENCODING));
 +
 +      TranslationRequestStream request = new TranslationRequestStream(reader, joshuaConfiguration);
 +
 +      try {
 +        Translations translations = decoder.decodeAll(request);
 +        
 +        OutputStream out = socket.getOutputStream();
 +        
 +        for (Translation translation: translations) {
 +          out.write(translation.toString().getBytes());
 +        }
 +        
 +      } catch (SocketException e) {
 +        LOG.error(" Socket interrupted", e);
 +        request.shutdown();
 +      } finally {
 +        reader.close();
 +        socket.close();
 +      }
 +    } catch (IOException e) {
 +      LOG.error(e.getMessage(), e);
 +    }
 +  }
 +  
 +  public HashMap<String, String> queryToMap(String query) throws UnsupportedEncodingException {
 +    HashMap<String, String> result = new HashMap<String, String>();
 +    for (String param : query.split("&")) {
 +        String pair[] = param.split("=");
 +        if (pair.length > 1) {
 +          result.put(pair[0], URLDecoder.decode(pair[1], "UTF-8"));
 +        } else {
 +            result.put(pair[0], "");
 +        }
 +    }
 +    return result;
 +  } 
 +
 +  private class HttpWriter extends OutputStream {
 +
 +    private HttpExchange client = null;
 +    private OutputStream out = null;
 +    
 +    public HttpWriter(HttpExchange client) {
 +      this.client = client;
 +      client.getResponseHeaders().add("Access-Control-Allow-Origin", "*");
 +    }
 +    
 +    @Override
 +    public void write(byte[] response) throws IOException {
 +      client.sendResponseHeaders(200, response.length);
 +      out = client.getResponseBody();
 +      out.write(response);
 +      out.close();
 +    }
 +
 +    @Override
 +    public void write(int b) throws IOException {
 +      out.write(b);
 +    }
 +  }
 +
 +  /**
 +   * Called to handle an HTTP connection. This looks for metadata in the URL string, which is processed
 +   * if present. It also then handles returning a JSON-formatted object to the caller. 
 +   * 
 +   * @param client the client connection
 +   */
 +  @Override
 +  public synchronized void handle(HttpExchange client) throws IOException {
 +
 +    HashMap<String, String> params = queryToMap(client.getRequestURI().getQuery());
 +    String query = params.get("q");
 +    String meta = params.get("meta");
 +    
 +    BufferedReader reader = new BufferedReader(new StringReader(query));
 +    TranslationRequestStream request = new TranslationRequestStream(reader, joshuaConfiguration);
 +    
 +    Translations translations = decoder.decodeAll(request);
 +    JSONMessage message = new JSONMessage();
 +    if (meta != null && ! meta.isEmpty())
 +      handleMetadata(meta, message);
 +
 +    for (Translation translation: translations) {
 +      LOG.info("TRANSLATION: '{}' with {} k-best items", translation, translation.getStructuredTranslations().size());
 +      message.addTranslation(translation);
 +    }
 +
 +    OutputStream out = new HttpWriter(client);
 +    out.write(message.toString().getBytes());
 +    if (LOG.isDebugEnabled())
 +      LOG.debug(message.toString());
 +    out.close();
 +    
 +    reader.close();
 +  }
 +  
 +  /**
 +   * Processes metadata commands received in the HTTP request. Some commands result in sending data back.
 +   *
 +   * @param meta the metadata request
 +   * @return result string (for some commands)
 +   */
 +  private void handleMetadata(String meta, JSONMessage message) {
 +    String[] tokens = meta.split("\\s+", 2);
 +    String type = tokens[0];
 +    String args = tokens.length > 1 ? tokens[1] : "";
 +    
 +    if (type.equals("get_weight")) {
 +      String weight = tokens[1];
 +      LOG.info("WEIGHT: %s = %.3f", weight, Decoder.weights.getOrDefault(hashFeature(weight)));
 +
 +    } else if (type.equals("set_weights")) {
 +      // Change a decoder weight
 +      String[] argTokens = args.split("\\s+");
 +      for (int i = 0; i < argTokens.length; i += 2) {
 +        String feature = argTokens[i];
 +        int featureId = hashFeature(feature);
 +        String newValue = argTokens[i+1];
 +        float old_weight = Decoder.weights.getOrDefault(featureId);
 +        Decoder.weights.put(featureId, Float.parseFloat(newValue));
 +        LOG.info("set_weights: {} {} -> {}", feature, old_weight, Decoder.weights.getOrDefault(featureId));
 +      }
 +      
 +      message.addMetaData("weights " + Decoder.weights.toString());
 +      
 +    } else if (type.equals("get_weights")) {
 +      message.addMetaData("weights " + Decoder.weights.toString());
 +      
 +    } else if (type.equals("add_rule")) {
 +      String argTokens[] = args.split(" \\|\\|\\| ");
 +  
 +      if (argTokens.length < 3) {
 +        LOG.error("* INVALID RULE '{}'", meta);
 +        return;
 +      }
 +      
 +      String lhs = argTokens[0];
 +      String source = argTokens[1];
 +      String target = argTokens[2];
 +      String featureStr = "";
++      String alignmentStr = "";
 +      if (argTokens.length > 3) 
 +        featureStr = argTokens[3];
-           
++      if (argTokens.length > 4)
++        alignmentStr = " ||| " + argTokens[4];
++      
 +      /* Prepend source and target side nonterminals for phrase-based decoding. Probably better
 +       * handled in each grammar type's addRule() function.
 +       */
 +      String ruleString = (joshuaConfiguration.search_algorithm.equals("stack"))
-           ? String.format("%s ||| [X,1] %s ||| [X,1] %s ||| custom=1 %s", lhs, source, target, featureStr)
-           : String.format("%s ||| %s ||| %s ||| custom=1 %s", lhs, source, target, featureStr);
++          ? String.format("%s ||| [X,1] %s ||| [X,1] %s ||| -1 %s %s", lhs, source, target, featureStr, alignmentStr)
++          : String.format("%s ||| %s ||| %s ||| -1 %s %s", lhs, source, target, featureStr, alignmentStr);
 +      
 +      Rule rule = new HieroFormatReader(decoder.getCustomPhraseTable().getOwner()).parseLine(ruleString);
 +      decoder.addCustomRule(rule);
 +      
 +      LOG.info("Added custom rule {}", rule.toString());
 +  
 +    } else if (type.equals("list_rules")) {
 +  
 +      LOG.info("list_rules");
 +      
 +      // Walk the the grammar trie
 +      ArrayList<Trie> nodes = new ArrayList<Trie>();
 +      nodes.add(decoder.getCustomPhraseTable().getTrieRoot());
 +  
 +      while (nodes.size() > 0) {
 +        Trie trie = nodes.remove(0);
 +  
 +        if (trie == null)
 +          continue;
 +  
 +        if (trie.hasRules()) {
 +          for (Rule rule: trie.getRuleCollection().getRules()) {
 +            message.addRule(rule.toString());
 +            LOG.debug("Found rule: " + rule);
 +          }
 +        }
 +  
 +        if (trie.getExtensions() != null)
 +          nodes.addAll(trie.getExtensions());
 +      }
 +  
 +    } else if (type.equals("remove_rule")) {
 +      
 +      Rule rule = new HieroFormatReader(decoder.getCustomPhraseTable().getOwner()).parseLine(args);
 +      
 +      LOG.info("remove_rule " + rule);
 +  
 +      Trie trie = decoder.getCustomPhraseTable().getTrieRoot();
 +      int[] sourceTokens = rule.getSource();
 +      for (int i = 0; i < sourceTokens.length; i++) {
 +        Trie nextTrie = trie.match(sourceTokens[i]);
 +        if (nextTrie == null)
 +          return;
 +        
 +        trie = nextTrie;
 +      }
 +
 +      if (trie.hasRules()) {
 +        for (Rule ruleCand: trie.getRuleCollection().getRules()) {
 +          if (Arrays.equals(rule.getTarget(), ruleCand.getTarget())) {
 +            trie.getRuleCollection().getRules().remove(ruleCand);
 +            break;
 +          }
 +        }
 +        return;
 +      }
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/tools/GrammarPacker.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/tools/GrammarPacker.java
index 6c02d19,0000000..5861052
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/tools/GrammarPacker.java
+++ b/joshua-core/src/main/java/org/apache/joshua/tools/GrammarPacker.java
@@@ -1,932 -1,0 +1,936 @@@
 +/**
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.tools;
 +
 +import static org.apache.joshua.decoder.ff.tm.OwnerMap.UNKNOWN_OWNER_ID;
 +import static org.apache.joshua.decoder.ff.tm.packed.PackedGrammar.VOCABULARY_FILENAME;
 +
 +import java.io.BufferedOutputStream;
 +import java.io.DataOutputStream;
 +import java.io.File;
 +import java.io.FileOutputStream;
 +import java.io.FileWriter;
 +import java.io.IOException;
 +import java.io.PrintWriter;
 +import java.nio.ByteBuffer;
 +import java.util.ArrayList;
 +import java.util.LinkedList;
 +import java.util.List;
 +import java.util.Map.Entry;
 +import java.util.Queue;
 +import java.util.TreeMap;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleFactory;
 +import org.apache.joshua.decoder.ff.tm.format.HieroFormatReader;
 +import org.apache.joshua.decoder.ff.tm.format.MosesFormatReader;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.encoding.EncoderConfiguration;
 +import org.apache.joshua.util.encoding.FeatureTypeAnalyzer;
 +import org.apache.joshua.util.encoding.IntEncoder;
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +
 +public class GrammarPacker {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(GrammarPacker.class);
 +
 +  /**
 +   * The packed grammar version number. Increment this any time you add new features, and update
 +   * the documentation.
 +   * 
 +   * Version history:
 +   * 
 +   * - 3 (May 2016). This was the first version that was marked. It removed the special phrase-
 +   * table packing that packed phrases without the [X,1] on the source and target sides, which
 +   * then required special handling in the decoder to use for phrase-based decoding.
 +   * 
-    * 
++   * - 4 (August 2016). Phrase-based decoding rewritten to represent phrases without a builtin
++   * nonterminal. Instead, cost-less glue rules are used in phrase-based decoding. This eliminates
++   * the need for special handling of phrase grammars (except for having to add a LHS), and lets
++   * phrase grammars be used in both hierarchical and phrase-based decoding without conversion.
++   *
 +   */
-   public static final int VERSION = 3;
++  public static final int VERSION = 4;
 +  
 +  // Size limit for slice in bytes.
 +  private static int DATA_SIZE_LIMIT = (int) (Integer.MAX_VALUE * 0.8);
 +  // Estimated average number of feature entries for one rule.
 +  private static int DATA_SIZE_ESTIMATE = 20;
 +
 +  private static final String SOURCE_WORDS_SEPARATOR = " ||| ";
 +
 +  // Output directory name.
 +  private String output;
 +
 +  // Input grammar to be packed.
 +  private String grammar;
 +
 +  public String getGrammar() {
 +    return grammar;
 +  }
 +
 +  public String getOutputDirectory() {
 +    return output;
 +  }
 +
 +  // Approximate maximum size of a slice in number of rules
 +  private int approximateMaximumSliceSize;
 +
 +  private boolean labeled;
 +
 +  private boolean packAlignments;
 +  private boolean grammarAlignments;
 +  private String alignments;
 +
 +  private FeatureTypeAnalyzer types;
 +  private EncoderConfiguration encoderConfig;
 +
 +  private String dump;
 +
 +  private int max_source_len;
 +
 +  public GrammarPacker(String grammar_filename, String config_filename, String output_filename,
 +      String alignments_filename, String featuredump_filename, boolean grammar_alignments,
 +      int approximateMaximumSliceSize)
 +      throws IOException {
 +    this.labeled = true;
 +    this.grammar = grammar_filename;
 +    this.output = output_filename;
 +    this.dump = featuredump_filename;
 +    this.grammarAlignments = grammar_alignments;
 +    this.approximateMaximumSliceSize = approximateMaximumSliceSize;
 +    this.max_source_len = 0;
 +
 +    // TODO: Always open encoder config? This is debatable.
 +    this.types = new FeatureTypeAnalyzer(true);
 +
 +    this.alignments = alignments_filename;
 +    packAlignments = grammarAlignments || (alignments != null);
 +    if (!packAlignments) {
 +      LOG.info("No alignments file or grammar specified, skipping.");
 +    } else if (alignments != null && !new File(alignments_filename).exists()) {
 +      throw new RuntimeException("Alignments file does not exist: " + alignments);
 +    }
 +
 +    if (config_filename != null) {
 +      readConfig(config_filename);
 +      types.readConfig(config_filename);
 +    } else {
 +      LOG.info("No config specified. Attempting auto-detection of feature types.");
 +    }
 +    LOG.info("Approximate maximum slice size (in # of rules) set to {}", approximateMaximumSliceSize);
 +
 +    File working_dir = new File(output);
 +    working_dir.mkdir();
 +    if (!working_dir.exists()) {
 +      throw new RuntimeException("Failed creating output directory.");
 +    }
 +  }
 +
 +  private void readConfig(String config_filename) throws IOException {
 +    LineReader reader = new LineReader(config_filename);
 +    while (reader.hasNext()) {
 +      // Clean up line, chop comments off and skip if the result is empty.
 +      String line = reader.next().trim();
 +      if (line.indexOf('#') != -1)
 +        line = line.substring(0, line.indexOf('#'));
 +      if (line.isEmpty())
 +        continue;
 +      String[] fields = line.split("[\\s]+");
 +
 +      if (fields.length < 2) {
 +        throw new RuntimeException("Incomplete line in config.");
 +      }
 +      if ("slice_size".equals(fields[0])) {
 +        // Number of records to concurrently load into memory for sorting.
 +        approximateMaximumSliceSize = Integer.parseInt(fields[1]);
 +      }
 +    }
 +    reader.close();
 +  }
 +
 +  /**
 +   * Executes the packing.
 +   * 
 +   * @throws IOException if there is an error reading the grammar
 +   */
 +  public void pack() throws IOException {
 +    LOG.info("Beginning exploration pass.");
 +
 +    // Explore pass. Learn vocabulary and feature value histograms.
 +    LOG.info("Exploring: {}", grammar);
 +
 +    HieroFormatReader grammarReader = getGrammarReader();
 +    explore(grammarReader);
 +
 +    LOG.info("Exploration pass complete. Freezing vocabulary and finalizing encoders.");
 +    if (dump != null) {
 +      PrintWriter dump_writer = new PrintWriter(dump);
 +      dump_writer.println(types.toString());
 +      dump_writer.close();
 +    }
 +
 +    types.inferTypes(this.labeled);
 +    LOG.info("Type inference complete.");
 +
 +    LOG.info("Finalizing encoding.");
 +
 +    LOG.info("Writing encoding.");
 +    types.write(output + File.separator + "encoding");
 +
 +    writeVocabulary();
 +
 +    String configFile = output + File.separator + "config";
 +    LOG.info("Writing config to '{}'", configFile);
 +    // Write config options
 +    FileWriter config = new FileWriter(configFile);
 +    config.write(String.format("version = %d\n", VERSION));
 +    config.write(String.format("max-source-len = %d\n", max_source_len));
 +    config.close();
 +
 +    // Read previously written encoder configuration to match up to changed
 +    // vocabulary id's.
 +    LOG.info("Reading encoding.");
 +    encoderConfig = new EncoderConfiguration();
 +    encoderConfig.load(output + File.separator + "encoding");
 +
 +    LOG.info("Beginning packing pass.");
 +    // Actual binarization pass. Slice and pack source, target and data.
 +    grammarReader = getGrammarReader();
 +    LineReader alignment_reader = null;
 +    if (packAlignments && !grammarAlignments)
 +      alignment_reader = new LineReader(alignments);
 +    binarize(grammarReader, alignment_reader);
 +    LOG.info("Packing complete.");
 +
 +    LOG.info("Packed grammar in: {}", output);
 +    LOG.info("Done.");
 +  }
 +
 +  /**
 +   * Returns a reader that turns whatever file format is found into unowned Hiero grammar rules.
 +   * This means, features are NOT prepended with an owner string at packing time.
 +   * 
 +   * @param grammarFile
 +   * @return GrammarReader of correct Format
 +   * @throws IOException
 +   */
 +  private HieroFormatReader getGrammarReader() throws IOException {
 +    LineReader reader = new LineReader(grammar);
 +    String line = reader.next();
 +    if (line.startsWith("[")) {
 +      return new HieroFormatReader(grammar, UNKNOWN_OWNER_ID);
 +    } else {
 +      return new MosesFormatReader(grammar, UNKNOWN_OWNER_ID);
 +    }
 +  }
 +
 +  /**
 +   * This first pass over the grammar 
 +   * @param reader
 +   */
 +  private void explore(HieroFormatReader reader) {
 +
 +    // We always assume a labeled grammar. Unlabeled features are assumed to be dense and to always
 +    // appear in the same order. They are assigned numeric names in order of appearance.
 +    this.types.setLabeled(true);
 +
 +    for (Rule rule : reader) {
 +
 +      max_source_len = Math.max(max_source_len, rule.getSource().length);
 +
 +      /* Add symbols to vocabulary.
 +       * NOTE: In case of nonterminals, we add both stripped versions ("[X]")
 +       * and "[X,1]" to the vocabulary.
 +       * 
 +       * TODO: MJP May 2016: Is it necessary to add [X,1]? This is currently being done in
 +       * {@link HieroFormatReader}, which is called by {@link MosesFormatReader}. 
 +       */
 +
 +      // pass the value through the appropriate encoder.
 +      for (final Entry<Integer, Float> entry : rule.getFeatureVector().entrySet()) {
 +        types.observe(entry.getKey(), entry.getValue());
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Returns a String encoding the first two source words.
 +   * If there is only one source word, use empty string for the second.
 +   */
 +  private String getFirstTwoSourceWords(final String[] source_words) {
 +    return source_words[0] + SOURCE_WORDS_SEPARATOR + ((source_words.length > 1) ? source_words[1] : "");
 +  }
 +
 +  private void binarize(HieroFormatReader grammarReader, LineReader alignment_reader) throws IOException {
 +    int counter = 0;
 +    int slice_counter = 0;
 +    int num_slices = 0;
 +
 +    boolean ready_to_flush = false;
 +    // to determine when flushing is possible
 +    String prev_first_two_source_words = null;
 +
 +    PackingTrie<SourceValue> source_trie = new PackingTrie<SourceValue>();
 +    PackingTrie<TargetValue> target_trie = new PackingTrie<TargetValue>();
 +    FeatureBuffer feature_buffer = new FeatureBuffer();
 +
 +    AlignmentBuffer alignment_buffer = null;
 +    if (packAlignments)
 +      alignment_buffer = new AlignmentBuffer();
 +
 +    TreeMap<Integer, Float> features = new TreeMap<Integer, Float>();
 +    for (Rule rule : grammarReader) {
 +      counter++;
 +      slice_counter++;
 +
 +      String lhs_word = Vocabulary.word(rule.getLHS());
 +      String[] source_words = rule.getSourceWords().split("\\s+");
 +      String[] target_words = rule.getTargetWords().split("\\s+");
 +
 +      // Reached slice limit size, indicate that we're closing up.
 +      if (!ready_to_flush
 +          && (slice_counter > approximateMaximumSliceSize
 +              || feature_buffer.overflowing()
 +              || (packAlignments && alignment_buffer.overflowing()))) {
 +        ready_to_flush = true;
 +        // store the first two source words when slice size limit was reached
 +        prev_first_two_source_words = getFirstTwoSourceWords(source_words);
 +      }
 +      // ready to flush
 +      if (ready_to_flush) {
 +        final String first_two_source_words = getFirstTwoSourceWords(source_words);
 +        // the grammar can only be partitioned at the level of first two source word changes.
 +        // Thus, we can only flush if the current first two source words differ from the ones
 +        // when the slice size limit was reached.
 +        if (!first_two_source_words.equals(prev_first_two_source_words)) {
 +          LOG.warn("ready to flush and first two words have changed ({} vs. {})",
 +              prev_first_two_source_words, first_two_source_words);
 +          LOG.info("flushing {} rules to slice.", slice_counter);
 +          flush(source_trie, target_trie, feature_buffer, alignment_buffer, num_slices);
 +          source_trie.clear();
 +          target_trie.clear();
 +          feature_buffer.clear();
 +          if (packAlignments)
 +            alignment_buffer.clear();
 +
 +          num_slices++;
 +          slice_counter = 0;
 +          ready_to_flush = false;
 +        }
 +      }
 +
 +      int alignment_index = -1;
 +      // If present, process alignments.
 +      if (packAlignments) {
 +        byte[] alignments = null;
 +        if (grammarAlignments) {
 +          alignments = rule.getAlignment();
 +        } else {
 +          if (!alignment_reader.hasNext()) {
 +            LOG.error("No more alignments starting in line {}", counter);
 +            throw new RuntimeException("No more alignments starting in line " + counter);
 +          }
 +          alignments = RuleFactory.parseAlignmentString(alignment_reader.next().trim());
 +        }
 +        alignment_index = alignment_buffer.add(alignments);
 +      }
 +
 +      // Process features.
 +      // Implicitly sort via TreeMap, write to data buffer, remember position
 +      // to pass on to the source trie node.
 +      features.clear();
 +      for (Entry<Integer, Float> entry : rule.getFeatureVector().entrySet()) {
 +        int featureId = entry.getKey();
 +        float featureValue = entry.getValue();
 +        if (featureValue != 0f) {
 +          features.put(encoderConfig.innerId(featureId), featureValue);
 +        }
 +      }
 +
 +      int features_index = feature_buffer.add(features);
 +
 +      // Sanity check on the data block index.
 +      if (packAlignments && features_index != alignment_index) {
 +        LOG.error("Block index mismatch between features ({}) and alignments ({}).",
 +            features_index, alignment_index);
 +        throw new RuntimeException("Data block index mismatch.");
 +      }
 +
 +      // Process source side.
 +      SourceValue sv = new SourceValue(Vocabulary.id(lhs_word), features_index);
 +      int[] source = new int[source_words.length];
 +      for (int i = 0; i < source_words.length; i++) {
 +        if (FormatUtils.isNonterminal(source_words[i]))
 +          source[i] = Vocabulary.id(FormatUtils.stripNonTerminalIndex(source_words[i]));
 +        else
 +          source[i] = Vocabulary.id(source_words[i]);
 +      }
 +      source_trie.add(source, sv);
 +
 +      // Process target side.
 +      TargetValue tv = new TargetValue(sv);
 +      int[] target = new int[target_words.length];
 +      for (int i = 0; i < target_words.length; i++) {
 +        if (FormatUtils.isNonterminal(target_words[i])) {
 +          target[target_words.length - (i + 1)] = -FormatUtils.getNonterminalIndex(target_words[i]);
 +        } else {
 +          target[target_words.length - (i + 1)] = Vocabulary.id(target_words[i]);
 +        }
 +      }
 +      target_trie.add(target, tv);
 +    }
 +    // flush last slice and clear buffers
 +    flush(source_trie, target_trie, feature_buffer, alignment_buffer, num_slices);
 +  }
 +
 +  /**
 +   * Serializes the source, target and feature data structures into interlinked binary files. Target
 +   * is written first, into a skeletal (node don't carry any data) upward-pointing trie, updating
 +   * the linking source trie nodes with the position once it is known. Source and feature data are
 +   * written simultaneously. The source structure is written into a downward-pointing trie and
 +   * stores the rule's lhs as well as links to the target and feature stream. The feature stream is
 +   * prompted to write out a block
 +   * 
 +   * @param source_trie
 +   * @param target_trie
 +   * @param feature_buffer
 +   * @param id
 +   * @throws IOException
 +   */
 +  private void flush(PackingTrie<SourceValue> source_trie,
 +      PackingTrie<TargetValue> target_trie, FeatureBuffer feature_buffer,
 +      AlignmentBuffer alignment_buffer, int id) throws IOException {
 +    // Make a slice object for this piece of the grammar.
 +    PackingFileTuple slice = new PackingFileTuple("slice_" + String.format("%05d", id));
 +    // Pull out the streams for source, target and data output.
 +    DataOutputStream source_stream = slice.getSourceOutput();
 +    DataOutputStream target_stream = slice.getTargetOutput();
 +    DataOutputStream target_lookup_stream = slice.getTargetLookupOutput();
 +    DataOutputStream feature_stream = slice.getFeatureOutput();
 +    DataOutputStream alignment_stream = slice.getAlignmentOutput();
 +
 +    Queue<PackingTrie<TargetValue>> target_queue;
 +    Queue<PackingTrie<SourceValue>> source_queue;
 +
 +    // The number of bytes both written into the source stream and
 +    // buffered in the source queue.
 +    int source_position;
 +    // The number of bytes written into the target stream.
 +    int target_position;
 +
 +    // Add trie root into queue, set target position to 0 and set cumulated
 +    // size to size of trie root.
 +    target_queue = new LinkedList<PackingTrie<TargetValue>>();
 +    target_queue.add(target_trie);
 +    target_position = 0;
 +
 +    // Target lookup table for trie levels.
 +    int current_level_size = 1;
 +    int next_level_size = 0;
 +    ArrayList<Integer> target_lookup = new ArrayList<Integer>();
 +
 +    // Packing loop for upwards-pointing target trie.
 +    while (!target_queue.isEmpty()) {
 +      // Pop top of queue.
 +      PackingTrie<TargetValue> node = target_queue.poll();
 +      // Register that this is where we're writing the node to.
 +      node.address = target_position;
 +      // Tell source nodes that we're writing to this position in the file.
 +      for (TargetValue tv : node.values)
 +        tv.parent.target = node.address;
 +      // Write link to parent.
 +      if (node.parent != null)
 +        target_stream.writeInt(node.parent.address);
 +      else
 +        target_stream.writeInt(-1);
 +      target_stream.writeInt(node.symbol);
 +      // Enqueue children.
 +      for (int k : node.children.descendingKeySet()) {
 +        PackingTrie<TargetValue> child = node.children.get(k);
 +        target_queue.add(child);
 +      }
 +      target_position += node.size(false, true);
 +      next_level_size += node.children.descendingKeySet().size();
 +
 +      current_level_size--;
 +      if (current_level_size == 0) {
 +        target_lookup.add(target_position);
 +        current_level_size = next_level_size;
 +        next_level_size = 0;
 +      }
 +    }
 +    target_lookup_stream.writeInt(target_lookup.size());
 +    for (int i : target_lookup)
 +      target_lookup_stream.writeInt(i);
 +    target_lookup_stream.close();
 +
 +    // Setting up for source and data writing.
 +    source_queue = new LinkedList<PackingTrie<SourceValue>>();
 +    source_queue.add(source_trie);
 +    source_position = source_trie.size(true, false);
 +    source_trie.address = target_position;
 +
 +    // Ready data buffers for writing.
 +    feature_buffer.initialize();
 +    if (packAlignments)
 +      alignment_buffer.initialize();
 +
 +    // Packing loop for downwards-pointing source trie.
 +    while (!source_queue.isEmpty()) {
 +      // Pop top of queue.
 +      PackingTrie<SourceValue> node = source_queue.poll();
 +      // Write number of children.
 +      source_stream.writeInt(node.children.size());
 +      // Write links to children.
 +      for (int k : node.children.descendingKeySet()) {
 +        PackingTrie<SourceValue> child = node.children.get(k);
 +        // Enqueue child.
 +        source_queue.add(child);
 +        // Child's address will be at the current end of the queue.
 +        child.address = source_position;
 +        // Advance cumulated size by child's size.
 +        source_position += child.size(true, false);
 +        // Write the link.
 +        source_stream.writeInt(k);
 +        source_stream.writeInt(child.address);
 +      }
 +      // Write number of data items.
 +      source_stream.writeInt(node.values.size());
 +      // Write lhs and links to target and data.
 +      for (SourceValue sv : node.values) {
 +        int feature_block_index = feature_buffer.write(sv.data);
 +        if (packAlignments) {
 +          int alignment_block_index = alignment_buffer.write(sv.data);
 +          if (alignment_block_index != feature_block_index) {
 +            LOG.error("Block index mismatch.");
 +            throw new RuntimeException("Block index mismatch: alignment (" + alignment_block_index
 +                + ") and features (" + feature_block_index + ") don't match.");
 +          }
 +        }
 +        source_stream.writeInt(sv.lhs);
 +        source_stream.writeInt(sv.target);
 +        source_stream.writeInt(feature_block_index);
 +      }
 +    }
 +    // Flush the data stream.
 +    feature_buffer.flush(feature_stream);
 +    if (packAlignments)
 +      alignment_buffer.flush(alignment_stream);
 +
 +    target_stream.close();
 +    source_stream.close();
 +    feature_stream.close();
 +    if (packAlignments)
 +      alignment_stream.close();
 +  }
 +
 +  public void writeVocabulary() throws IOException {
 +    final String vocabularyFilename = output + File.separator + VOCABULARY_FILENAME;
 +    LOG.info("Writing vocabulary to {}", vocabularyFilename);
 +    Vocabulary.write(vocabularyFilename);
 +  }
 +
 +  /**
 +   * Integer-labeled, doubly-linked trie with some provisions for packing.
 +   * 
 +   * @author Juri Ganitkevitch
 +   * 
 +   * @param <D> The trie's value type.
 +   */
 +  class PackingTrie<D extends PackingTrieValue> {
 +    int symbol;
 +    PackingTrie<D> parent;
 +
 +    TreeMap<Integer, PackingTrie<D>> children;
 +    List<D> values;
 +
 +    int address;
 +
 +    PackingTrie() {
 +      address = -1;
 +
 +      symbol = 0;
 +      parent = null;
 +
 +      children = new TreeMap<Integer, PackingTrie<D>>();
 +      values = new ArrayList<D>();
 +    }
 +
 +    PackingTrie(PackingTrie<D> parent, int symbol) {
 +      this();
 +      this.parent = parent;
 +      this.symbol = symbol;
 +    }
 +
 +    void add(int[] path, D value) {
 +      add(path, 0, value);
 +    }
 +
 +    private void add(int[] path, int index, D value) {
 +      if (index == path.length)
 +        this.values.add(value);
 +      else {
 +        PackingTrie<D> child = children.get(path[index]);
 +        if (child == null) {
 +          child = new PackingTrie<D>(this, path[index]);
 +          children.put(path[index], child);
 +        }
 +        child.add(path, index + 1, value);
 +      }
 +    }
 +
 +    /**
 +     * Calculate the size (in ints) of a packed trie node. Distinguishes downwards pointing (parent
 +     * points to children) from upwards pointing (children point to parent) tries, as well as
 +     * skeletal (no data, just the labeled links) and non-skeletal (nodes have a data block)
 +     * packing.
 +     * 
 +     * @param downwards Are we packing into a downwards-pointing trie?
 +     * @param skeletal Are we packing into a skeletal trie?
 +     * 
 +     * @return Number of bytes the trie node would occupy.
 +     */
 +    int size(boolean downwards, boolean skeletal) {
 +      int size = 0;
 +      if (downwards) {
 +        // Number of children and links to children.
 +        size = 1 + 2 * children.size();
 +      } else {
 +        // Link to parent.
 +        size += 2;
 +      }
 +      // Non-skeletal packing: number of data items.
 +      if (!skeletal)
 +        size += 1;
 +      // Non-skeletal packing: write size taken up by data items.
 +      if (!skeletal && !values.isEmpty())
 +        size += values.size() * values.get(0).size();
 +
 +      return size;
 +    }
 +
 +    void clear() {
 +      children.clear();
 +      values.clear();
 +    }
 +  }
 +
 +  interface PackingTrieValue {
 +    int size();
 +  }
 +
 +  class SourceValue implements PackingTrieValue {
 +    int lhs;
 +    int data;
 +    int target;
 +
 +    public SourceValue() {
 +    }
 +
 +    SourceValue(int lhs, int data) {
 +      this.lhs = lhs;
 +      this.data = data;
 +    }
 +
 +    void setTarget(int target) {
 +      this.target = target;
 +    }
 +
 +    public int size() {
 +      return 3;
 +    }
 +  }
 +
 +  class TargetValue implements PackingTrieValue {
 +    SourceValue parent;
 +
 +    TargetValue(SourceValue parent) {
 +      this.parent = parent;
 +    }
 +
 +    public int size() {
 +      return 0;
 +    }
 +  }
 +
 +  abstract class PackingBuffer<T> {
 +    private byte[] backing;
 +    protected ByteBuffer buffer;
 +
 +    protected ArrayList<Integer> memoryLookup;
 +    protected int totalSize;
 +    protected ArrayList<Integer> onDiskOrder;
 +
 +    PackingBuffer() throws IOException {
 +      allocate();
 +      memoryLookup = new ArrayList<Integer>();
 +      onDiskOrder = new ArrayList<Integer>();
 +      totalSize = 0;
 +    }
 +
 +    abstract int add(T item);
 +
 +    // Allocate a reasonably-sized buffer for the feature data.
 +    private void allocate() {
 +      backing = new byte[approximateMaximumSliceSize * DATA_SIZE_ESTIMATE];
 +      buffer = ByteBuffer.wrap(backing);
 +    }
 +
 +    // Reallocate the backing array and buffer, copies data over.
 +    protected void reallocate() {
 +      if (backing.length == Integer.MAX_VALUE)
 +        return;
 +      long attempted_length = backing.length * 2l;
 +      int new_length;
 +      // Detect overflow.
 +      if (attempted_length >= Integer.MAX_VALUE)
 +        new_length = Integer.MAX_VALUE;
 +      else
 +        new_length = (int) attempted_length;
 +      byte[] new_backing = new byte[new_length];
 +      System.arraycopy(backing, 0, new_backing, 0, backing.length);
 +      int old_position = buffer.position();
 +      ByteBuffer new_buffer = ByteBuffer.wrap(new_backing);
 +      new_buffer.position(old_position);
 +      buffer = new_buffer;
 +      backing = new_backing;
 +    }
 +
 +    /**
 +     * Prepare the data buffer for disk writing.
 +     */
 +    void initialize() {
 +      onDiskOrder.clear();
 +    }
 +
 +    /**
 +     * Enqueue a data block for later writing.
 +     * 
 +     * @param block_index The index of the data block to add to writing queue.
 +     * @return The to-be-written block's output index.
 +     */
 +    int write(int block_index) {
 +      onDiskOrder.add(block_index);
 +      return onDiskOrder.size() - 1;
 +    }
 +
 +    /**
 +     * Performs the actual writing to disk in the order specified by calls to write() since the last
 +     * call to initialize().
 +     * 
 +     * @param out
 +     * @throws IOException
 +     */
 +    void flush(DataOutputStream out) throws IOException {
 +      writeHeader(out);
 +      int size;
 +      int block_address;
 +      for (int block_index : onDiskOrder) {
 +        block_address = memoryLookup.get(block_index);
 +        size = blockSize(block_index);
 +        out.write(backing, block_address, size);
 +      }
 +    }
 +
 +    void clear() {
 +      buffer.clear();
 +      memoryLookup.clear();
 +      onDiskOrder.clear();
 +    }
 +
 +    boolean overflowing() {
 +      return (buffer.position() >= DATA_SIZE_LIMIT);
 +    }
 +
 +    private void writeHeader(DataOutputStream out) throws IOException {
 +      if (out.size() == 0) {
 +        out.writeInt(onDiskOrder.size());
 +        out.writeInt(totalSize);
 +        int disk_position = headerSize();
 +        for (int block_index : onDiskOrder) {
 +          out.writeInt(disk_position);
 +          disk_position += blockSize(block_index);
 +        }
 +      } else {
 +        throw new RuntimeException("Got a used stream for header writing.");
 +      }
 +    }
 +
 +    private int headerSize() {
 +      // One integer for each data block, plus number of blocks and total size.
 +      return 4 * (onDiskOrder.size() + 2);
 +    }
 +
 +    private int blockSize(int block_index) {
 +      int block_address = memoryLookup.get(block_index);
 +      return (block_index < memoryLookup.size() - 1 ? memoryLookup.get(block_index + 1) : totalSize)
 +          - block_address;
 +    }
 +  }
 +
 +  class FeatureBuffer extends PackingBuffer<TreeMap<Integer, Float>> {
 +
 +    private IntEncoder idEncoder;
 +
 +    FeatureBuffer() throws IOException {
 +      super();
 +      idEncoder = types.getIdEncoder();
 +      LOG.info("Encoding feature ids in: {}", idEncoder.getKey());
 +    }
 +
 +    /**
 +     * Add a block of features to the buffer.
 +     * 
 +     * @param features TreeMap with the features for one rule.
 +     * @return The index of the resulting data block.
 +     */
 +    int add(TreeMap<Integer, Float> features) {
 +      int data_position = buffer.position();
 +
 +      // Over-estimate how much room this addition will need: for each
 +      // feature (ID_SIZE for label, "upper bound" of 4 for the value), plus ID_SIZE for
 +      // the number of features. If this won't fit, reallocate the buffer.
 +      int size_estimate = (4 + EncoderConfiguration.ID_SIZE) * features.size()
 +          + EncoderConfiguration.ID_SIZE;
 +      if (buffer.capacity() - buffer.position() <= size_estimate)
 +        reallocate();
 +
 +      // Write features to buffer.
 +      idEncoder.write(buffer, features.size());
 +      for (Integer k : features.descendingKeySet()) {
 +        float v = features.get(k);
 +        // Sparse features.
 +        if (v != 0.0) {
 +          idEncoder.write(buffer, k);
 +          encoderConfig.encoder(k).write(buffer, v);
 +        }
 +      }
 +      // Store position the block was written to.
 +      memoryLookup.add(data_position);
 +      // Update total size (in bytes).
 +      totalSize = buffer.position();
 +
 +      // Return block index.
 +      return memoryLookup.size() - 1;
 +    }
 +  }
 +
 +  class AlignmentBuffer extends PackingBuffer<byte[]> {
 +
 +    AlignmentBuffer() throws IOException {
 +      super();
 +    }
 +
 +    /**
 +     * Add a rule alignments to the buffer.
 +     * 
 +     * @param alignments a byte array with the alignment points for one rule.
 +     * @return The index of the resulting data block.
 +     */
 +    int add(byte[] alignments) {
 +      int data_position = buffer.position();
 +      int size_estimate = alignments.length + 1;
 +      if (buffer.capacity() - buffer.position() <= size_estimate)
 +        reallocate();
 +
 +      // Write alignment points to buffer.
 +      buffer.put((byte) (alignments.length / 2));
 +      buffer.put(alignments);
 +
 +      // Store position the block was written to.
 +      memoryLookup.add(data_position);
 +      // Update total size (in bytes).
 +      totalSize = buffer.position();
 +      // Return block index.
 +      return memoryLookup.size() - 1;
 +    }
 +  }
 +
 +  class PackingFileTuple implements Comparable<PackingFileTuple> {
 +    private File sourceFile;
 +    private File targetLookupFile;
 +    private File targetFile;
 +
 +    private File featureFile;
 +    private File alignmentFile;
 +
 +    PackingFileTuple(String prefix) {
 +      sourceFile = new File(output + File.separator + prefix + ".source");
 +      targetFile = new File(output + File.separator + prefix + ".target");
 +      targetLookupFile = new File(output + File.separator + prefix + ".target.lookup");
 +      featureFile = new File(output + File.separator + prefix + ".features");
 +
 +      alignmentFile = null;
 +      if (packAlignments)
 +        alignmentFile = new File(output + File.separator + prefix + ".alignments");
 +
 +      LOG.info("Allocated slice: {}", sourceFile.getAbsolutePath());
 +    }
 +
 +    DataOutputStream getSourceOutput() throws IOException {
 +      return getOutput(sourceFile);
 +    }
 +
 +    DataOutputStream getTargetOutput() throws IOException {
 +      return getOutput(targetFile);
 +    }
 +
 +    DataOutputStream getTargetLookupOutput() throws IOException {
 +      return getOutput(targetLookupFile);
 +    }
 +
 +    DataOutputStream getFeatureOutput() throws IOException {
 +      return getOutput(featureFile);
 +    }
 +
 +    DataOutputStream getAlignmentOutput() throws IOException {
 +      if (alignmentFile != null)
 +        return getOutput(alignmentFile);
 +      return null;
 +    }
 +
 +    private DataOutputStream getOutput(File file) throws IOException {
 +      if (file.createNewFile()) {
 +        return new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
 +      } else {
 +        throw new RuntimeException("File doesn't exist: " + file.getName());
 +      }
 +    }
 +
 +    long getSize() {
 +      return sourceFile.length() + targetFile.length() + featureFile.length();
 +    }
 +
 +    @Override
 +    public int compareTo(PackingFileTuple o) {
 +      if (getSize() > o.getSize()) {
 +        return -1;
 +      } else if (getSize() < o.getSize()) {
 +        return 1;
 +      } else {
 +        return 0;
 +      }
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
index 7752785,0000000..cbe6a7f
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMBerkeleySentenceProbablityTest.java
@@@ -1,64 -1,0 +1,64 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.berkeley_lm;
 +
 +import edu.berkeley.nlp.lm.ArrayEncodedNgramLanguageModel;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.Test;
 +
 +import static org.testng.Assert.assertTrue;
 +import static org.testng.Assert.assertFalse;
 +
 +import static org.testng.Assert.assertEquals;
 +
 +public class LMBerkeleySentenceProbablityTest {
 +
 +  @Test
 +  public void verifySentenceLogProbability() {
-     LMGrammarBerkeley grammar = new LMGrammarBerkeley(2, "resources/berkeley_lm/lm");
++    LMGrammarBerkeley grammar = new LMGrammarBerkeley(2, "src/test/resources/berkeley_lm/lm");
 +    grammar.registerWord("the", 2);
 +    grammar.registerWord("chat-rooms", 3);
 +    grammar.registerWord("<unk>", 0);
 +
 +    ArrayEncodedNgramLanguageModel<String> lm = grammar.getLM();
 +    float expected =
 +        lm.getLogProb(new int[] {}, 0, 0)
 +        + lm.getLogProb(new int[] {0}, 0, 1)
 +        + lm.getLogProb(new int[] {0, 2}, 0, 2)
 +        + lm.getLogProb(new int[] {2, 3}, 0, 2)
 +        + lm.getLogProb(new int[] {3, 0}, 0, 2);
 +
 +    float result = grammar.sentenceLogProbability(new int[] {0, 2, 3, 0}, 2, 0);
 +    assertEquals(expected, result, 0.0);
 +  }
 +  
 +  @Test
 +  public void givenUnknownWord_whenIsOov_thenCorrectlyDetected() {
-     LMGrammarBerkeley lm = new LMGrammarBerkeley(2, "resources/berkeley_lm/lm");
++    LMGrammarBerkeley lm = new LMGrammarBerkeley(2, "src/test/resources/berkeley_lm/lm");
 +    assertTrue(lm.isOov(Vocabulary.id("UNKNOWN_WORD")));
 +    assertFalse(lm.isOov(Vocabulary.id("chat-rooms")));
 +  }
 +  
 +  @AfterMethod
 +  public void tearDown() {
 +    Vocabulary.clear();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
index cc4a94c,0000000..cf04a3d
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/berkeley_lm/LMGrammarBerkeleyTest.java
@@@ -1,83 -1,0 +1,83 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.berkeley_lm;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.DataProvider;
 +import org.testng.annotations.Test;
 +
 +import static org.testng.Assert.assertEquals;
 +
 +/**
 + * Replacement for test/lm/berkeley/test.sh regression test
 + */
 +
 +public class LMGrammarBerkeleyTest {
 +
 +  private static final String INPUT = "the chat-rooms";
 +  private static final String EXPECTED_OUTPUT = "glue_0=-2.000000 lm_0=-7.152632\n";
 +  private static final String EXPECTED_OUTPUT_WITH_OOV = "glue_0=-2.000000 lm_0=-7.152632 lm_0_oov=0.000000\n";
 +  private static final String[] OPTIONS = "-v 1 -output-format %f".split(" ");
 +
 +  private JoshuaConfiguration joshuaConfig;
 +  private Decoder decoder;
 +
 +  @DataProvider(name = "languageModelFiles")
 +  public Object[][] lmFiles() {
-     return new Object[][]{{"resources/berkeley_lm/lm"},
-             {"resources/berkeley_lm/lm.gz"},
-             {"resources/berkeley_lm/lm.berkeleylm"},
-             {"resources/berkeley_lm/lm.berkeleylm.gz"}};
++    return new Object[][]{{"src/test/resources/berkeley_lm/lm"},
++            {"src/test/resources/berkeley_lm/lm.gz"},
++            {"src/test/resources/berkeley_lm/lm.berkeleylm"},
++            {"src/test/resources/berkeley_lm/lm.berkeleylm.gz"}};
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +  }
 +
 +  @Test(dataProvider = "languageModelFiles")
 +  public void verifyLM(String lmFile) {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.processCommandLineOptions(OPTIONS);
 +    joshuaConfig.features.add("LanguageModel -lm_type berkeleylm -lm_order 2 -lm_file " + lmFile);
 +    decoder = new Decoder(joshuaConfig, null);
 +    final String translation = decode(INPUT).toString();
 +    assertEquals(translation, EXPECTED_OUTPUT);
 +  }
 +
 +  private Translation decode(String input) {
 +    final Sentence sentence = new Sentence(input, 0, joshuaConfig);
 +    return decoder.decode(sentence);
 +  }
 +
 +  @Test
 +  public void givenLmWithOovFeature_whenDecoder_thenCorrectFeaturesReturned() {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.processCommandLineOptions(OPTIONS);
-     joshuaConfig.features.add("LanguageModel -lm_type berkeleylm -oov_feature -lm_order 2 -lm_file resources/berkeley_lm/lm");
++    joshuaConfig.features.add("LanguageModel -lm_type berkeleylm -oov_feature -lm_order 2 -lm_file src/test/resources/berkeley_lm/lm");
 +    decoder = new Decoder(joshuaConfig, null);
 +    final String translation = decode(INPUT).toString();
 +    assertEquals(translation, EXPECTED_OUTPUT_WITH_OOV);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
index 0d7a9c4,0000000..2067f30
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/ff/lm/class_lm/ClassBasedLanguageModelTest.java
@@@ -1,77 -1,0 +1,77 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.lm.class_lm;
 +
 +import static org.testng.Assert.assertEquals;
 +import static org.testng.Assert.assertTrue;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.FeatureMap;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.lm.LanguageModelFF;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.util.io.KenLmTestUtil;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +/**
 + * This unit test relies on KenLM.  If the KenLM library is not found when the test is run all tests will be skipped.
 + */
 +public class ClassBasedLanguageModelTest {
 +
 +  private static final float WEIGHT = 0.5f;
 +
 +  private LanguageModelFF ff;
 +
 +  @BeforeMethod
 +  public void setUp() {
 +    Decoder.resetGlobalState();
 +
 +    FeatureVector weights = new FeatureVector(1);
 +    weights.put(FeatureMap.hashFeature("lm_0"), WEIGHT);
 +    String[] args = { "-lm_type", "kenlm", "-lm_order", "9",
-       "-lm_file", "./src/test/resources/lm/class_lm/class_lm_9gram.gz",
-       "-class_map", "./src/test/resources/lm/class_lm/class.map" };
++      "-lm_file", "src/test/resources/lm/class_lm/class_lm_9gram.gz",
++      "-class_map", "src/test/resources/lm/class_lm/class.map" };
 +
 +    JoshuaConfiguration config = new JoshuaConfiguration();
 +    KenLmTestUtil.Guard(() -> ff = new LanguageModelFF(weights, args, config));
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() {
 +    Decoder.resetGlobalState();
 +  }
 +
 +  @Test
 +  public void givenLmDefinition_whenInitialized_thenInitializationIsCorrect() {
 +    assertTrue(ff.isClassLM());
 +    assertTrue(ff.isStateful());
 +  }
 +
 +  @Test
 +  public void givenRuleWithSingleWord_whenGetRuleId_thenIsMappedToClass() {
 +    final int[] target = Vocabulary.addAll(new String[] { "professionalism" });
 +    final Rule rule = new Rule(0, null, target, 0, new FeatureVector(0), null, OwnerMap.register(OwnerMap.UNKNOWN_OWNER));
 +    assertEquals(Vocabulary.word(ff.getRuleIds(rule)[0]), "13");
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
index 41569aa,0000000..f2cbe7f
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/kbest_extraction/KBestExtractionTest.java
@@@ -1,83 -1,0 +1,83 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.kbest_extraction;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.io.KenLmTestUtil;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +import org.testng.reporters.Files;
 +
 +import java.io.File;
 +import java.io.IOException;
 +import java.nio.file.Path;
 +import java.nio.file.Paths;
 +
 +import static com.google.common.base.Charsets.UTF_8;
 +import static java.nio.file.Files.readAllBytes;
 +import static org.testng.Assert.assertEquals;
 +
 +/**
 + * Reimplements the kbest extraction regression test
 + * TODO (fhieber): this test strangely only works with StateMinimizing KenLM.
 + * This is to be investigated
 + */
 +
 +public class KBestExtractionTest {
 +
-   private static final String CONFIG = "resources/kbest_extraction/joshua.config";
++  private static final String CONFIG = "src/test/resources/kbest_extraction/joshua.config";
 +  private static final String INPUT = "a b c d e";
-   private static final Path GOLD_PATH = Paths.get("resources/kbest_extraction/output.scores.gold");
++  private static final Path GOLD_PATH = Paths.get("src/test/resources/kbest_extraction/output.scores.gold");
 +
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    //BROKEN
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.readConfigFile(CONFIG);
 +    joshuaConfig.outputFormat = "%i ||| %s ||| %c";
 +    KenLmTestUtil.Guard(() -> decoder = new Decoder(joshuaConfig, ""));
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +    decoder = null;
 +  }
 +
 +  @Test
 +  public void givenInput_whenKbestExtraction_thenOutputIsAsExpected() throws IOException {
 +    final String translation = decode(INPUT).toString();
 +    final String gold = new String(readAllBytes(GOLD_PATH), UTF_8);
 +    Files.writeFile(translation, new File("resources/kbest_extraction/output.actual"));
 +    assertEquals(translation, gold);
 +  }
 +
 +  private Translation decode(String input) {
 +    final Sentence sentence = new Sentence(input, 0, joshuaConfig);
 +    return decoder.decode(sentence);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
index f2fc6a7,0000000..625fe0c
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
@@@ -1,75 -1,0 +1,90 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 + package org.apache.joshua.decoder.phrase.decode;
 +
- import static com.google.common.base.Charsets.UTF_8;
- import static java.nio.file.Files.readAllBytes;
 +import static org.testng.Assert.assertEquals;
 +
 +import java.io.IOException;
- import java.nio.file.Path;
- import java.nio.file.Paths;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.util.io.KenLmTestUtil;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +/**
 + * Reimplements the constrained phrase decoding test
 + */
 +public class PhraseDecodingTest {
 +
-   private static final String CONFIG = "resources/phrase_decoder/config";
++  private static final String CONFIG = "src/test/resources/phrase_decoder/config";
 +  private static final String INPUT = "una estrategia republicana para obstaculizar la reelecci�n de Obama";
-   private static final Path GOLD_PATH = Paths.get("resources/phrase_decoder/output.gold");
- 
++  private static final String OUTPUT = "0 ||| a strategy republican to hinder reelection Obama ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";
++  private static final String OUTPUT_WITH_ALIGNMENTS = "0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";
++  
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.readConfigFile(CONFIG);
 +    KenLmTestUtil.Guard(() -> decoder = new Decoder(joshuaConfig, ""));
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +    decoder = null;
 +  }
 +
-   @Test(enabled = false)
++  @Test(enabled = true)
 +  public void givenInput_whenPhraseDecoding_thenOutputIsAsExpected() throws IOException {
-     final String translation = decode(INPUT).toString();
-     final String gold = new String(readAllBytes(GOLD_PATH), UTF_8);
-     assertEquals(gold, translation);
++    final String translation = decode(INPUT).toString().trim();
++    final String gold = OUTPUT;
++    assertEquals(translation, gold);
++  }
++  
++  @Test(enabled = false)
++  public void givenInput_whenPhraseDecodingWithAlignments_thenOutputHasAlignments() throws IOException {
++    final String translation = decode(INPUT).toString().trim();
++    final String gold = OUTPUT_WITH_ALIGNMENTS;
++    assertEquals(translation, gold);
++  }
++  
++  @Test(enabled = true)
++  public void givenInput_whenPhraseDecoding_thenInputCanBeRetrieved() throws IOException {
++    String outputFormat = joshuaConfig.outputFormat;
++    joshuaConfig.outputFormat = "%e";
++    final String translation = decode(INPUT).toString().trim();
++    joshuaConfig.outputFormat = outputFormat;
++    final String gold = INPUT;
++    assertEquals(translation, gold);
 +  }
 +
 +  private Translation decode(String input) {
 +    final Sentence sentence = new Sentence(input, 0, joshuaConfig);
++//    joshuaConfig.setVerbosity(2);
 +    return decoder.decode(sentence);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/system/KenLmTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/system/KenLmTest.java
index 40514cd,0000000..74baef3
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/system/KenLmTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/system/KenLmTest.java
@@@ -1,100 -1,0 +1,100 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.system;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.lm.KenLM;
 +import org.apache.joshua.util.io.KenLmTestUtil;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +import static org.apache.joshua.corpus.Vocabulary.registerLanguageModel;
 +import static org.apache.joshua.corpus.Vocabulary.unregisterLanguageModels;
 +import static org.testng.Assert.assertTrue;
 +import static org.testng.AssertJUnit.assertEquals;
 +import static org.testng.AssertJUnit.assertFalse;
 +
 +/**
 + * KenLM JNI interface tests.
 + * Loads libken.{so,dylib}.
 + * If run in Eclipse, add -Djava.library.path=./lib to JVM arguments
 + * of the run configuration.
 + */
 +
 +public class KenLmTest {
 +
-   private static final String LANGUAGE_MODEL_PATH = "resources/kenlm/oilers.kenlm";
++  private static final String LANGUAGE_MODEL_PATH = "src/test/resources/kenlm/oilers.kenlm";
 +  private KenLM kenLm;
 +
 +  @Test
 +  public void givenKenLm_whenQueryingForNgramProbability_thenProbIsCorrect() {
 +    // GIVEN
 +    KenLmTestUtil.Guard(() -> kenLm = new KenLM(3, LANGUAGE_MODEL_PATH));
 +
 +    int[] words = Vocabulary.addAll("Wayne Gretzky");
 +    registerLanguageModel(kenLm);
 +
 +    // WHEN
 +    float probability = kenLm.prob(words);
 +
 +    // THEN
 +    assertEquals("Found the wrong probability for 2-gram \"Wayne Gretzky\"", -0.99f, probability,
 +            Float.MIN_VALUE);
 +  }
 +
 +  @Test
 +  public void givenKenLm_whenQueryingForNgramProbability_thenIdAndStringMethodsReturnTheSame() {
 +    // GIVEN
 +    KenLmTestUtil.Guard(() -> kenLm = new KenLM(LANGUAGE_MODEL_PATH));
 +
 +    registerLanguageModel(kenLm);
 +    String sentence = "Wayne Gretzky";
 +    String[] words = sentence.split("\\s+");
 +    int[] ids = Vocabulary.addAll(sentence);
 +
 +    // WHEN
 +    float prob_string = kenLm.prob(words);
 +    float prob_id = kenLm.prob(ids);
 +
 +    // THEN
 +    assertEquals("ngram probabilities differ for word and id based n-gram query", prob_string, prob_id,
 +            Float.MIN_VALUE);
 +
 +  }
 +
 +  @Test
 +  public void givenKenLm_whenIsKnownWord_thenReturnValuesAreCorrect() {
 +    KenLmTestUtil.Guard(() -> kenLm = new KenLM(LANGUAGE_MODEL_PATH));
 +    assertTrue(kenLm.isKnownWord("Wayne"));
 +    assertFalse(kenLm.isKnownWord("Wayne2222"));
 +  }
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    Vocabulary.clear();
 +    unregisterLanguageModels();
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    Vocabulary.clear();
 +    unregisterLanguageModels();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
index 9e2f622,0000000..84789ce
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/system/LmOovFeatureTest.java
@@@ -1,76 -1,0 +1,76 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 + package org.apache.joshua.system;
 +
 +import static org.testng.Assert.assertEquals;
 +
 +import java.io.IOException;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +public class LmOovFeatureTest {
 +
-   private static final String CONFIG = "resources/lm_oov/joshua.config";
++  private static final String CONFIG = "src/test/resources/lm_oov/joshua.config";
 +  private static final String INPUT = "a chat-rooms full";
 +  // expecting 2 lm oovs ('a' & 'full') and 2 grammar OOVs ('chat-rooms' & 'full') and score -198.000
 +  private static final String EXPECTED_FEATURES = "lm_0=-206.718124 lm_0_oov=2.000000 OOVPenalty=-200.000000 pt_0=2.000000 glue_0=-3.000000 | -198.000";
 +
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.readConfigFile(CONFIG);
 +    joshuaConfig.outputFormat = "%f | %c";
 +    decoder = new Decoder(joshuaConfig, "");
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +    decoder = null;
 +  }
 +
 +  @Test
 +  public void givenInputWithDifferentOovTypes_whenDecode_thenFeaturesAreAsExpected() throws IOException {
 +    final String translation = decode(INPUT).toString().trim();
 +    System.out.println(translation);
 +    assertEquals(translation, EXPECTED_FEATURES);
 +  }
 +
 +  private Translation decode(String input) {
 +    final Sentence sentence = new Sentence(input, 0, joshuaConfig);
 +    return decoder.decode(sentence);
 +  }
 +  
 +  public static void main(String[] args) throws Exception {
 +    
 +    LmOovFeatureTest test = new LmOovFeatureTest();
 +    test.setUp();
 +    test.givenInputWithDifferentOovTypes_whenDecode_thenFeaturesAreAsExpected();
 +    test.tearDown();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
index 092dbc6,0000000..7b1c47f
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
+++ b/joshua-core/src/test/java/org/apache/joshua/system/MultithreadedTranslationTests.java
@@@ -1,155 -1,0 +1,155 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.system;
 +
 +import java.io.BufferedReader;
 +import java.io.ByteArrayInputStream;
 +import java.io.ByteArrayOutputStream;
 +import java.io.IOException;
 +import java.io.InputStreamReader;
 +import java.nio.charset.Charset;
 +import java.util.ArrayList;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.Translations;
 +import org.apache.joshua.decoder.io.TranslationRequestStream;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +import static org.testng.Assert.assertTrue;
 +
 +/**
 + * Integration test for multithreaded Joshua decoder tests. Grammar used is a
 + * toy packed grammar.
 + *
 + * @author kellens
 + */
 +public class MultithreadedTranslationTests {
 +
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +  private static final String INPUT = "A K B1 U Z1 Z2 B2 C";
 +  private int previousLogLevel;
 +  private final static long NANO_SECONDS_PER_SECOND = 1_000_000_000;
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.search_algorithm = "cky";
 +    joshuaConfig.mark_oovs = false;
 +    joshuaConfig.pop_limit = 100;
 +    joshuaConfig.use_unique_nbest = false;
 +    joshuaConfig.include_align_index = false;
 +    joshuaConfig.topN = 0;
-     joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar.packed");
-     joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
++    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar.packed");
++    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
 +    joshuaConfig.goal_symbol = "[GOAL]";
 +    joshuaConfig.default_non_terminal = "[X]";
 +    joshuaConfig.features.add("OOVPenalty");
 +    joshuaConfig.weights.add("tm_pt_0 1");
 +    joshuaConfig.weights.add("tm_pt_1 1");
 +    joshuaConfig.weights.add("tm_pt_2 1");
 +    joshuaConfig.weights.add("tm_pt_3 1");
 +    joshuaConfig.weights.add("tm_pt_4 1");
 +    joshuaConfig.weights.add("tm_pt_5 1");
 +    joshuaConfig.weights.add("tm_glue_0 1");
 +    joshuaConfig.weights.add("OOVPenalty 2");
 +    joshuaConfig.num_parallel_decoders = 500; // This will enable 500 parallel
 +                                              // decoders to run at once.
 +                                              // Useful to help flush out
 +                                              // concurrency errors in
 +                                              // underlying
 +                                              // data-structures.
 +    this.decoder = new Decoder(joshuaConfig, ""); // Second argument
 +                                                  // (configFile)
 +                                                  // is not even used by the
 +                                                  // constructor/initialize.
 +
 +    previousLogLevel = Decoder.VERBOSE;
 +    Decoder.VERBOSE = 0;
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    this.decoder.cleanUp();
 +    this.decoder = null;
 +    Decoder.VERBOSE = previousLogLevel;
 +  }
 +
 +
 +
 +  // This test was created specifically to reproduce a multithreaded issue
 +  // related to mapped byte array access in the PackedGrammer getAlignmentArray
 +  // function.
 +
 +  // We'll test the decoding engine using N = 10,000 identical inputs. This
 +  // should be sufficient to induce concurrent data access for many shared
 +  // data structures.
 +
 +  @Test
 +  public void givenPackedGrammar_whenNTranslationsCalledConcurrently_thenReturnNResults() throws IOException {
 +    // GIVEN
 +
 +    int inputLines = 10000;
 +    joshuaConfig.use_structured_output = true; // Enabled alignments.
 +    StringBuilder sb = new StringBuilder();
 +    for (int i = 0; i < inputLines; i++) {
 +      sb.append(INPUT + "\n");
 +    }
 +
 +    // Append a large string together to simulate N requests to the decoding
 +    // engine.
 +    TranslationRequestStream req = new TranslationRequestStream(
 +        new BufferedReader(new InputStreamReader(new ByteArrayInputStream(sb.toString()
 +        .getBytes(Charset.forName("UTF-8"))))), joshuaConfig);
 +    
 +    ByteArrayOutputStream output = new ByteArrayOutputStream();
 +
 +    // WHEN
 +    // Translate all spans in parallel.
 +    Translations translations = this.decoder.decodeAll(req);
 +
 +    ArrayList<Translation> translationResults = new ArrayList<Translation>();
 +
 +
 +    final long translationStartTime = System.nanoTime();
 +    try {
 +      for (Translation t: translations)
 +        translationResults.add(t);
 +    } finally {
 +      if (output != null) {
 +        try {
 +          output.close();
 +        } catch (IOException e) {
 +          e.printStackTrace();
 +        }
 +      }
 +    }
 +
 +    final long translationEndTime = System.nanoTime();
 +    final double pipelineLoadDurationInSeconds = (translationEndTime - translationStartTime) / ((double)NANO_SECONDS_PER_SECOND);
 +    System.err.println(String.format("%.2f seconds", pipelineLoadDurationInSeconds));
 +
 +    // THEN
 +    assertTrue(translationResults.size() == inputLines);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
index 0cc8721,0000000..1c9a6fe
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/system/StructuredOutputTest.java
@@@ -1,114 -1,0 +1,114 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.system;
 +
 +import java.util.Arrays;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.testng.Assert;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +/**
 + * Integration test for the complete Joshua decoder using a toy grammar that translates
 + * a bunch of capital letters to lowercase letters. Rules in the test grammar
 + * drop and generate additional words and simulate reordering of rules, so that
 + * proper extraction of word alignments can be tested.
 + *
 + * @author fhieber
 + */
 +public class StructuredOutputTest {
 +
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +  private Translation translation = null;
 +  private static final String input = "A K B1 U Z1 Z2 B2 C";
 +  private static final String expectedTranslation = "a b n1 u z c1 k1 k2 k3 n1 n2 n3 c2";
 +  private static final String expectedWordAlignmentString = "0-0 2-1 6-1 3-3 4-4 5-4 7-5 1-6 1-7 1-8 7-12";
 +  private static final List<List<Integer>> expectedWordAlignment = Arrays.asList(
 +      Arrays.asList(0), Arrays.asList(2, 6), Arrays.asList(), Arrays.asList(3),
 +      Arrays.asList(4, 5), Arrays.asList(7), Arrays.asList(1),
 +      Arrays.asList(1), Arrays.asList(1), Arrays.asList(), Arrays.asList(),
 +      Arrays.asList(), Arrays.asList(7));
 +  private static final double expectedScore = -17.0;
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.search_algorithm = "cky";
 +    joshuaConfig.mark_oovs = false;
 +    joshuaConfig.pop_limit = 100;
 +    joshuaConfig.use_unique_nbest = false;
 +    joshuaConfig.include_align_index = false;
 +    joshuaConfig.topN = 0;
-     joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar");
-     joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
++    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar");
++    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
 +    joshuaConfig.goal_symbol = "[GOAL]";
 +    joshuaConfig.default_non_terminal = "[X]";
 +    joshuaConfig.features.add("OOVPenalty");
 +    joshuaConfig.weights.add("pt_0 -1");
 +    joshuaConfig.weights.add("pt_1 -1");
 +    joshuaConfig.weights.add("pt_2 -1");
 +    joshuaConfig.weights.add("pt_3 -1");
 +    joshuaConfig.weights.add("pt_4 -1");
 +    joshuaConfig.weights.add("pt_5 -1");
 +    joshuaConfig.weights.add("glue_0 -1");
 +    joshuaConfig.weights.add("OOVPenalty 2");
 +    decoder = new Decoder(joshuaConfig, ""); // second argument (configFile
 +                                             // is not even used by the
 +                                             // constructor/initialize)
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +    decoder = null;
 +    translation = null;
 +  }
 +
 +  private Translation decode(String input) {
 +    Sentence sentence = new Sentence(input, 0, joshuaConfig);
 +    return decoder.decode(sentence);
 +  }
 +
 +  @Test
 +  public void test() {
 +
 +    // test standard output
 +    joshuaConfig.use_structured_output = false;
 +    joshuaConfig.outputFormat = "%s | %a ";
 +    translation = decode(input);
 +    Assert.assertEquals(translation.toString().trim(), expectedTranslation + " | " + expectedWordAlignmentString);
 +
 +    // test structured output
 +    joshuaConfig.use_structured_output = true; // set structured output creation to true
 +    translation = decode(input);
 +    Assert.assertEquals(translation.getStructuredTranslations().get(0).getTranslationString(), expectedTranslation);
 +    Assert.assertEquals(translation.getStructuredTranslations().get(0).getTranslationTokens(), Arrays.asList(expectedTranslation.split("\\s+")));
 +    Assert.assertEquals(translation.getStructuredTranslations().get(0).getTranslationScore(), expectedScore, 0.00001);
 +    Assert.assertEquals(translation.getStructuredTranslations().get(0).getTranslationWordAlignments(), expectedWordAlignment);
 +    Assert.assertEquals(translation.getStructuredTranslations().get(0).getTranslationWordAlignments().size(), translation
 +        .getStructuredTranslations().get(0).getTranslationTokens().size());
 +  }
 +}


[19/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/output.scores.gold
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/output.scores.gold b/resources/kbest_extraction/output.scores.gold
deleted file mode 100644
index 2f8b814..0000000
--- a/resources/kbest_extraction/output.scores.gold
+++ /dev/null
@@ -1,3126 +0,0 @@
-0 ||| A A A A A ||| -195.045
-0 ||| B A A A A ||| -196.045
-0 ||| C A A A A ||| -198.045
-0 ||| A B A A A ||| -199.045
-0 ||| B B A A A ||| -200.045
-0 ||| D A A A A ||| -200.045
-0 ||| A A A A B ||| -201.045
-0 ||| A A A B A ||| -201.045
-0 ||| A A B A A ||| -201.045
-0 ||| A C A A A ||| -201.045
-0 ||| B A A A B ||| -202.045
-0 ||| B A A B A ||| -202.045
-0 ||| B A B A A ||| -202.045
-0 ||| B C A A A ||| -202.045
-0 ||| C B A A A ||| -202.045
-0 ||| A A A C A ||| -203.045
-0 ||| C A A A B ||| -204.045
-0 ||| C A A B A ||| -204.045
-0 ||| B A A C A ||| -204.045
-0 ||| C A B A A ||| -204.045
-0 ||| E A A A A ||| -204.045
-0 ||| C C A A A ||| -204.045
-0 ||| D B A A A ||| -204.045
-0 ||| A A A A C ||| -205.045
-0 ||| A B A B A ||| -205.045
-0 ||| A B A A B ||| -205.045
-0 ||| A A C A A ||| -205.045
-0 ||| A B B A A ||| -205.045
-0 ||| A D A A A ||| -205.045
-0 ||| B A A A C ||| -206.045
-0 ||| B B A A B ||| -206.045
-0 ||| B B A B A ||| -206.045
-0 ||| D A A A B ||| -206.045
-0 ||| B A C A A ||| -206.045
-0 ||| D A A B A ||| -206.045
-0 ||| B B B A A ||| -206.045
-0 ||| C A A C A ||| -206.045
-0 ||| D A B A A ||| -206.045
-0 ||| B D A A A ||| -206.045
-0 ||| D C A A A ||| -206.045
-0 ||| A A B A B ||| -207.045
-0 ||| A A B B A ||| -207.045
-0 ||| A A A B B ||| -207.045
-0 ||| A B A C A ||| -207.045
-0 ||| A C A A B ||| -207.045
-0 ||| A C A B A ||| -207.045
-0 ||| A C B A A ||| -207.045
-0 ||| A A D A A ||| -207.045
-0 ||| C A A A C ||| -208.045
-0 ||| B A A B B ||| -208.045
-0 ||| C B A B A ||| -208.045
-0 ||| B A B A B ||| -208.045
-0 ||| B C A B A ||| -208.045
-0 ||| B C A A B ||| -208.045
-0 ||| B A B B A ||| -208.045
-0 ||| C B A A B ||| -208.045
-0 ||| D A A C A ||| -208.045
-0 ||| C A C A A ||| -208.045
-0 ||| B B A C A ||| -208.045
-0 ||| E B A A A ||| -208.045
-0 ||| B C B A A ||| -208.045
-0 ||| C B B A A ||| -208.045
-0 ||| C D A A A ||| -208.045
-0 ||| B A D A A ||| -208.045
-0 ||| A B A A C ||| -209.045
-0 ||| A A A C B ||| -209.045
-0 ||| A A B C A ||| -209.045
-0 ||| A B C A A ||| -209.045
-0 ||| A C A C A ||| -209.045
-0 ||| A A A D A ||| -209.045
-0 ||| C A A B B ||| -210.045
-0 ||| D A A A C ||| -210.045
-0 ||| C A B A B ||| -210.045
-0 ||| B A A C B ||| -210.045
-0 ||| C C A A B ||| -210.045
-0 ||| D B A A B ||| -210.045
-0 ||| B B A A C ||| -210.045
-0 ||| E A A A B ||| -210.045
-0 ||| D B A B A ||| -210.045
-0 ||| D A C A A ||| -210.045
-0 ||| E A A B A ||| -210.045
-0 ||| B A A D A ||| -210.045
-0 ||| D D A A A ||| -210.045
-0 ||| B C A C A ||| -210.045
-0 ||| C A D A A ||| -210.045
-0 ||| C A B B A ||| -210.045
-0 ||| E A B A A ||| -210.045
-0 ||| C B A C A ||| -210.045
-0 ||| E C A A A ||| -210.045
-0 ||| C C A B A ||| -210.045
-0 ||| B B C A A ||| -210.045
-0 ||| B A B C A ||| -210.045
-0 ||| C C B A A ||| -210.045
-0 ||| D B B A A ||| -210.045
-0 ||| A B A B B ||| -211.045
-0 ||| A B B B A ||| -211.045
-0 ||| A A A B C ||| -211.045
-0 ||| A D A B A ||| -211.045
-0 ||| A C A A C ||| -211.045
-0 ||| A A C B A ||| -211.045
-0 ||| A A C A B ||| -211.045
-0 ||| A C C A A ||| -211.045
-0 ||| A A B A C ||| -211.045
-0 ||| A B D A A ||| -211.045
-0 ||| A A A A D ||| -211.045
-0 ||| A A E A A ||| -211.045
-0 ||| A B B A B ||| -211.045
-0 ||| A E A A A ||| -211.045
-0 ||| A D A A B ||| -211.045
-0 ||| A D B A A ||| -211.045
-0 ||| B D A A B ||| -212.045
-0 ||| C B A A C ||| -212.045
-0 ||| B B B B A ||| -212.045
-0 ||| B A C A B ||| -212.045
-0 ||| D A A B B ||| -212.045
-0 ||| E A A C A ||| -212.045
-0 ||| B B A B B ||| -212.045
-0 ||| C A A D A ||| -212.045
-0 ||| B A A B C ||| -212.045
-0 ||| D C A B A ||| -212.045
-0 ||| B C A A C ||| -212.045
-0 ||| D B A C A ||| -212.045
-0 ||| B A A A D ||| -212.045
-0 ||| B A C B A ||| -212.045
-0 ||| D C A A B ||| -212.045
-0 ||| D A B B A ||| -212.045
-0 ||| B B B A B ||| -212.045
-0 ||| B D A B A ||| -212.045
-0 ||| C A A C B ||| -212.045
-0 ||| B A E A A ||| -212.045
-0 ||| B A B A C ||| -212.045
-0 ||| C C A C A ||| -212.045
-0 ||| D A B A B ||| -212.045
-0 ||| B C C A A ||| -212.045
-0 ||| C A B C A ||| -212.045
-0 ||| B E A A A ||| -212.045
-0 ||| D A D A A ||| -212.045
-0 ||| C B C A A ||| -212.045
-0 ||| B B D A A ||| -212.045
-0 ||| D C B A A ||| -212.045
-0 ||| B D B A A ||| -212.045
-0 ||| A C B A B ||| -213.045
-0 ||| A A D A B ||| -213.045
-0 ||| A A B B B ||| -213.045
-0 ||| A A A C C ||| -213.045
-0 ||| A B A C B ||| -213.045
-0 ||| A C A B B ||| -213.045
-0 ||| A B B C A ||| -213.045
-0 ||| A A A E A ||| -213.045
-0 ||| A C B B A ||| -213.045
-0 ||| A A D B A ||| -213.045
-0 ||| A B A D A ||| -213.045
-0 ||| A D A C A ||| -213.045
-0 ||| A A C C A ||| -213.045
-0 ||| A C D A A ||| -213.045
-0 ||| B C A B B ||| -214.045
-0 ||| B A B B B ||| -214.045
-0 ||| B C B A B ||| -214.045
-0 ||| C B B A B ||| -214.045
-0 ||| E B A A B ||| -214.045
-0 ||| C A A B C ||| -214.045
-0 ||| D A A C B ||| -214.045
-0 ||| C A C A B ||| -214.045
-0 ||| B B A C B ||| -214.045
-0 ||| C A B A C ||| -214.045
-0 ||| C D A A B ||| -214.045
-0 ||| B A D A B ||| -214.045
-0 ||| C B A B B ||| -214.045
-0 ||| E A A A C ||| -214.045
-0 ||| D B A A C ||| -214.045
-0 ||| C A A A D ||| -214.045
-0 ||| D A B C A ||| -214.045
-0 ||| C C A A C ||| -214.045
-0 ||| B A A C C ||| -214.045
-0 ||| B A D B A ||| -214.045
-0 ||| B A C C A ||| -214.045
-0 ||| B B B C A ||| -214.045
-0 ||| D C A C A ||| -214.045
-0 ||| D A A D A ||| -214.045
-0 ||| B B A D A ||| -214.045
-0 ||| C A C B A ||| -214.045
-0 ||| B A A E A ||| -214.045
-0 ||| C C C A A ||| -214.045
-0 ||| B D A C A ||| -214.045
-0 ||| E B A B A ||| -214.045
-0 ||| E B B A A ||| -214.045
-0 ||| B C B B A ||| -214.045
-0 ||| C B B B A ||| -214.045
-0 ||| C A E A A ||| -214.045
-0 ||| C D A B A ||| -214.045
-0 ||| C D B A A ||| -214.045
-0 ||| B C D A A ||| -214.045
-0 ||| E D A A A ||| -214.045
-0 ||| D B C A A ||| -214.045
-0 ||| C E A A A ||| -214.045
-0 ||| E A C A A ||| -214.045
-0 ||| C B D A A ||| -214.045
-0 ||| A B C A B ||| -215.045
-0 ||| A B B A C ||| -215.045
-0 ||| A D A A C ||| -215.045
-0 ||| A A C A C ||| -215.045
-0 ||| A B A B C ||| -215.045
-0 ||| A A B C B ||| -215.045
-0 ||| A C A C B ||| -215.045
-0 ||| A B A A D ||| -215.045
-0 ||| A A A D B ||| -215.045
-0 ||| A B C B A ||| -215.045
-0 ||| A C A D A ||| -215.045
-0 ||| A A D C A ||| -215.045
-0 ||| A C B C A ||| -215.045
-0 ||| A A B D A ||| -215.045
-0 ||| A B E A A ||| -215.045
-0 ||| A D C A A ||| -215.045
-0 ||| B B C A B ||| -216.045
-0 ||| E C A A B ||| -216.045
-0 ||| C C A B B ||| -216.045
-0 ||| B A B C B ||| -216.045
-0 ||| C C B B A ||| -216.045
-0 ||| C C B A B ||| -216.045
-0 ||| D B B A B ||| -216.045
-0 ||| E A A B B ||| -216.045
-0 ||| D A C B A ||| -216.045
-0 ||| B A C A C ||| -216.045
-0 ||| D A C A B ||| -216.045
-0 ||| D D A B A ||| -216.045
-0 ||| D A B A C ||| -216.045
-0 ||| B D A A C ||| -216.045
-0 ||| C C D A A ||| -216.045
-0 ||| D B A B B ||| -216.045
-0 ||| B A B D A ||| -216.045
-0 ||| B A A D B ||| -216.045
-0 ||| C A D B A ||| -216.045
-0 ||| B B A A D ||| -216.045
-0 ||| E A B B A ||| -216.045
-0 ||| D A A A D ||| -216.045
-0 ||| D C C A A ||| -216.045
-0 ||| D A A B C ||| -216.045
-0 ||| E C A B A ||| -216.045
-0 ||| C A D A B ||| -216.045
-0 ||| B B C B A ||| -216.045
-0 ||| B C A C B ||| -216.045
-0 ||| B D C A A ||| -216.045
-0 ||| C A B B B ||| -216.045
-0 ||| C D A C A ||| -216.045
-0 ||| D D A A B ||| -216.045
-0 ||| D B B B A ||| -216.045
-0 ||| C A A C C ||| -216.045
-0 ||| D D B A A ||| -216.045
-0 ||| B B A B C ||| -216.045
-0 ||| B A D C A ||| -216.045
-0 ||| C B A C B ||| -216.045
-0 ||| C A A E A ||| -216.045
-0 ||| E A B A B ||| -216.045
-0 ||| D B D A A ||| -216.045
-0 ||| D C A A C ||| -216.045
-0 ||| B C A D A ||| -216.045
-0 ||| B B B A C ||| -216.045
-0 ||| D E A A A ||| -216.045
-0 ||| C A C C A ||| -216.045
-0 ||| E A D A A ||| -216.045
-0 ||| C B B C A ||| -216.045
-0 ||| E C B A A ||| -216.045
-0 ||| B C B C A ||| -216.045
-0 ||| B B E A A ||| -216.045
-0 ||| C B A D A ||| -216.045
-0 ||| D A E A A ||| -216.045
-0 ||| E B A C A ||| -216.045
-0 ||| A D B A B ||| -217.045
-0 ||| A A C B B ||| -217.045
-0 ||| A C A B C ||| -217.045
-0 ||| A B B B B ||| -217.045
-0 ||| A B A C C ||| -217.045
-0 ||| A B D A B ||| -217.045
-0 ||| A A E A B ||| -217.045
-0 ||| A C C A B ||| -217.045
-0 ||| A E A A B ||| -217.045
-0 ||| A D A B B ||| -217.045
-0 ||| A A B B C ||| -217.045
-0 ||| A B D B A ||| -217.045
-0 ||| A A D A C ||| -217.045
-0 ||| A C B A C ||| -217.045
-0 ||| A B C C A ||| -217.045
-0 ||| A A A B D ||| -217.045
-0 ||| A C C B A ||| -217.045
-0 ||| A A B A D ||| -217.045
-0 ||| A D D A A ||| -217.045
-0 ||| A C A A D ||| -217.045
-0 ||| A D B B A ||| -217.045
-0 ||| A E A B A ||| -217.045
-0 ||| A C E A A ||| -217.045
-0 ||| A A E B A ||| -217.045
-0 ||| A E B A A ||| -217.045
-0 ||| A B A E A ||| -217.045
-0 ||| B B B B B ||| -218.045
-0 ||| E A A C B ||| -218.045
-0 ||| D C A B B ||| -218.045
-0 ||| B C A B C ||| -218.045
-0 ||| B D A B B ||| -218.045
-0 ||| B E A A B ||| -218.045
-0 ||| D A B B B ||| -218.045
-0 ||| B A E A B ||| -218.045
-0 ||| B A C B B ||| -218.045
-0 ||| B C B A C ||| -218.045
-0 ||| C C A C B ||| -218.045
-0 ||| C A B C B ||| -218.045
-0 ||| C A A D B ||| -218.045
-0 ||| D B A C B ||| -218.045
-0 ||| B C C A B ||| -218.045
-0 ||| B B C C A ||| -218.045
-0 ||| B A B B C ||| -218.045
-0 ||| B B D A B ||| -218.045
-0 ||| C B C A B ||| -218.045
-0 ||| C B E A A ||| -218.045
-0 ||| C B A A D ||| -218.045
-0 ||| D A D A B ||| -218.045
-0 ||| D C B A B ||| -218.045
-0 ||| E A B C A ||| -218.045
-0 ||| B D B A B ||| -218.045
-0 ||| E C A C A ||| -218.045
-0 ||| C B A B C ||| -218.045
-0 ||| B A E B A ||| -218.045
-0 ||| D A A C C ||| -218.045
-0 ||| D A C C A ||| -218.045
-0 ||| C B B A C ||| -218.045
-0 ||| C C B C A ||| -218.045
-0 ||| E B A A C ||| -218.045
-0 ||| C A B D A ||| -218.045
-0 ||| B A D A C ||| -218.045
-0 ||| C A D C A ||| -218.045
-0 ||| B B A C C ||| -218.045
-0 ||| C D C A A ||| -218.045
-0 ||| C A C A C ||| -218.045
-0 ||| D D A C A ||| -218.045
-0 ||| C D A A C ||| -218.045
-0 ||| B B D B A ||| -218.045
-0 ||| B A B A D ||| -218.045
-0 ||| E B C A A ||| -218.045
-0 ||| B C A A D ||| -218.045
-0 ||| D A D B A ||| -218.045
-0 ||| B A A B D ||| -218.045
-0 ||| B E A B A ||| -218.045
-0 ||| D C D A A ||| -218.045
-0 ||| D B B C A ||| -218.045
-0 ||| D B A D A ||| -218.045
-0 ||| E A A D A ||| -218.045
-0 ||| B D D A A ||| -218.045
-0 ||| C B C B A ||| -218.045
-0 ||| B C E A A ||| -218.045
-0 ||| B C C B A ||| -218.045
-0 ||| B E B A A ||| -218.045
-0 ||| C C A D A ||| -218.045
-0 ||| B D B B A ||| -218.045
-0 ||| D A A E A ||| -218.045
-0 ||| D C B B A ||| -218.045
-0 ||| B B A E A ||| -218.045
-0 ||| A B B C B ||| -219.045
-0 ||| A A A C D ||| -219.045
-0 ||| A B A D B ||| -219.045
-0 ||| A A A D C ||| -219.045
-0 ||| A C D A B ||| -219.045
-0 ||| A C A C C ||| -219.045
-0 ||| A A A E B ||| -219.045
-0 ||| A C B B B ||| -219.045
-0 ||| A A D B B ||| -219.045
-0 ||| A A C C B ||| -219.045
-0 ||| A D A C B ||| -219.045
-0 ||| A A B E A ||| -219.045
-0 ||| A A A A E ||| -219.045
-0 ||| A B C A C ||| -219.045
-0 ||| A D B C A ||| -219.045
-0 ||| A A B C C ||| -219.045
-0 ||| A E A C A ||| -219.045
-0 ||| A B D C A ||| -219.045
-0 ||| A C C C A ||| -219.045
-0 ||| A C D B A ||| -219.045
-0 ||| A A C D A ||| -219.045
-0 ||| A D A D A ||| -219.045
-0 ||| A B B D A ||| -219.045
-0 ||| A A E C A ||| -219.045
-0 ||| A C A E A ||| -219.045
-0 ||| E A A B C ||| -220.045
-0 ||| D C A C B ||| -220.045
-0 ||| D A C A C ||| -220.045
-0 ||| B B B C B ||| -220.045
-0 ||| B A C C B ||| -220.045
-0 ||| B A D B B ||| -220.045
-0 ||| B A B C C ||| -220.045
-0 ||| C C B A C ||| -220.045
-0 ||| B A A C D ||| -220.045
-0 ||| D A A D B ||| -220.045
-0 ||| E B B A B ||| -220.045
-0 ||| C C A B C ||| -220.045
-0 ||| B C A C C ||| -220.045
-0 ||| C A B A D ||| -220.045
-0 ||| C A A B D ||| -220.045
-0 ||| C C A A D ||| -220.045
-0 ||| D B B A C ||| -220.045
-0 ||| E C A A C ||| -220.045
-0 ||| B B C A C ||| -220.045
-0 ||| B A A D C ||| -220.045
-0 ||| E A A A D ||| -220.045
-0 ||| B B A D B ||| -220.045
-0 ||| C A D A C ||| -220.045
-0 ||| D A B C B ||| -220.045
-0 ||| D C B C A ||| -220.045
-0 ||| D B A B C ||| -220.045
-0 ||| D B A A D ||| -220.045
-0 ||| E B A B B ||| -220.045
-0 ||| C A C B B ||| -220.045
-0 ||| B A C D A ||| -220.045
-0 ||| B D A C B ||| -220.045
-0 ||| C C C A B ||| -220.045
-0 ||| B A A E B ||| -220.045
-0 ||| B A E C A ||| -220.045
-0 ||| D B C A B ||| -220.045
-0 ||| C A E A B ||| -220.045
-0 ||| B A B E A ||| -220.045
-0 ||| C B B B B ||| -220.045
-0 ||| B C B B B ||| -220.045
-0 ||| C D B B A ||| -220.045
-0 ||| D D A A C ||| -220.045
-0 ||| E D A A B ||| -220.045
-0 ||| B B D C A ||| -220.045
-0 ||| C D A B B ||| -220.045
-0 ||| C A B B C ||| -220.045
-0 ||| B D B C A ||| -220.045
-0 ||| B C D A B ||| -220.045
-0 ||| C D B A B ||| -220.045
-0 ||| D A D C A ||| -220.045
-0 ||| E A B A C ||| -220.045
-0 ||| B A A A E ||| -220.045
-0 ||| D A B D A ||| -220.045
-0 ||| C E A A B ||| -220.045
-0 ||| C B A C C ||| -220.045
-0 ||| B E A C A ||| -220.045
-0 ||| C B D A B ||| -220.045
-0 ||| E A C A B ||| -220.045
-0 ||| C B C C A ||| -220.045
-0 ||| E B D A A ||| -220.045
-0 ||| C A E B A ||| -220.045
-0 ||| E D B A A ||| -220.045
-0 ||| C B A E A ||| -220.045
-0 ||| E E A A A ||| -220.045
-0 ||| B C C C A ||| -220.045
-0 ||| D B E A A ||| -220.045
-0 ||| B B B D A ||| -220.045
-0 ||| C D D A A ||| -220.045
-0 ||| D C A D A ||| -220.045
-0 ||| D D C A A ||| -220.045
-0 ||| C C C B A ||| -220.045
-0 ||| C C E A A ||| -220.045
-0 ||| E B B B A ||| -220.045
-0 ||| C E B A A ||| -220.045
-0 ||| B C D B A ||| -220.045
-0 ||| E C C A A ||| -220.045
-0 ||| C E A B A ||| -220.045
-0 ||| E A E A A ||| -220.045
-0 ||| B C A E A ||| -220.045
-0 ||| D B C B A ||| -220.045
-0 ||| E D A B A ||| -220.045
-0 ||| E A C B A ||| -220.045
-0 ||| C B D B A ||| -220.045
-0 ||| B D A D A ||| -220.045
-0 ||| A E A A C ||| -221.045
-0 ||| A B B A D ||| -221.045
-0 ||| A A B D B ||| -221.045
-0 ||| A B B B C ||| -221.045
-0 ||| A A E A C ||| -221.045
-0 ||| A D B A C ||| -221.045
-0 ||| A A C B C ||| -221.045
-0 ||| A C B C B ||| -221.045
-0 ||| A B D A C ||| -221.045
-0 ||| A D A B C ||| -221.045
-0 ||| A C C A C ||| -221.045
-0 ||| A B E A B ||| -221.045
-0 ||| A A D C B ||| -221.045
-0 ||| A C A D B ||| -221.045
-0 ||| A B C B B ||| -221.045
-0 ||| A A C A D ||| -221.045
-0 ||| A D C A B ||| -221.045
-0 ||| A B A B D ||| -221.045
-0 ||| A D C B A ||| -221.045
-0 ||| A D A A D ||| -221.045
-0 ||| A B E B A ||| -221.045
-0 ||| A C D C A ||| -221.045
-0 ||| A E C A A ||| -221.045
-0 ||| A C B D A ||| -221.045
-0 ||| A D E A A ||| -221.045
-0 ||| A A D D A ||| -221.045
-0 ||| D C B A C ||| -222.045
-0 ||| C C D A B ||| -222.045
-0 ||| B A B D B ||| -222.045
-0 ||| B B C B B ||| -222.045
-0 ||| C A D B B ||| -222.045
-0 ||| E A B B B ||| -222.045
-0 ||| E C A B B ||| -222.045
-0 ||| B D A A D ||| -222.045
-0 ||| D C C A B ||| -222.045
-0 ||| D B D A B ||| -222.045
-0 ||| D D B A B ||| -222.045
-0 ||| D B B B B ||| -222.045
-0 ||| E C B A B ||| -222.045
-0 ||| C A A E B ||| -222.045
-0 ||| B A D C B ||| -222.045
-0 ||| C B B C B ||| -222.045
-0 ||| B B B A D ||| -222.045
-0 ||| B C A D B ||| -222.045
-0 ||| E A D A B ||| -222.045
-0 ||| D E A A B ||| -222.045
-0 ||| C A C C B ||| -222.045
-0 ||| C B A D B ||| -222.045
-0 ||| B B E A B ||| -222.045
-0 ||| B C B C B ||| -222.045
-0 ||| D A E A B ||| -222.045
-0 ||| E B A C B ||| -222.045
-0 ||| D C A B C ||| -222.045
-0 ||| C A B C C ||| -222.045
-0 ||| E A A C C ||| -222.045
-0 ||| B B B B C ||| -222.045
-0 ||| B A E A C ||| -222.045
-0 ||| B D A B C ||| -222.045
-0 ||| C C A C C ||| -222.045
-0 ||| D A B B C ||| -222.045
-0 ||| B E A A C ||| -222.045
-0 ||| B A C B C ||| -222.045
-0 ||| D A D A C ||| -222.045
-0 ||| B D B A C ||| -222.045
-0 ||| C A A D C ||| -222.045
-0 ||| B C C A C ||| -222.045
-0 ||| D B A C C ||| -222.045
-0 ||| C B C A C ||| -222.045
-0 ||| B A C A D ||| -222.045
-0 ||| B B D A C ||| -222.045
-0 ||| D A B A D ||| -222.045
-0 ||| D D A B B ||| -222.045
-0 ||| D A C B B ||| -222.045
-0 ||| B D C A B ||| -222.045
-0 ||| D C A A D ||| -222.045
-0 ||| C C B B B ||| -222.045
-0 ||| D A A B D ||| -222.045
-0 ||| B B A B D ||| -222.045
-0 ||| C A A A E ||| -222.045
-0 ||| C A A C D ||| -222.045
-0 ||| C D A C B ||| -222.045
-0 ||| B A D D A ||| -222.045
-0 ||| C C D B A ||| -222.045
-0 ||| D C C B A ||| -222.045
-0 ||| E A D B A ||| -222.045
-0 ||| B D C B A ||| -222.045
-0 ||| D E A B A ||| -222.045
-0 ||| E C B B A ||| -222.045
-0 ||| B B E B A ||| -222.045
-0 ||| E B A D A ||| -222.045
-0 ||| D A E B A ||| -222.045
-0 ||| C A B E A ||| -222.045
-0 ||| E A A E A ||| -222.045
-0 ||| D B D B A ||| -222.045
-0 ||| C A E C A ||| -222.045
-0 ||| C C A E A ||| -222.045
-0 ||| C B D C A ||| -222.045
-0 ||| B C D C A ||| -222.045
-0 ||| E B B C A ||| -222.045
-0 ||| C D A D A ||| -222.045
-0 ||| D D D A A ||| -222.045
-0 ||| C D B C A ||| -222.045
-0 ||| E C D A A ||| -222.045
-0 ||| E A C C A ||| -222.045
-0 ||| B E C A A ||| -222.045
-0 ||| D B A E A ||| -222.045
-0 ||| D E B A A ||| -222.045
-0 ||| D D B B A ||| -222.045
-0 ||| B D E A A ||| -222.045
-0 ||| E D A C A ||| -222.045
-0 ||| D C E A A ||| -222.045
-0 ||| C E A C A ||| -222.045
-0 ||| B C B D A ||| -222.045
-0 ||| D B C C A ||| -222.045
-0 ||| C B B D A ||| -222.045
-0 ||| C A C D A ||| -222.045
-0 ||| C C C C A ||| -222.045
-0 ||| A C A B D ||| -223.045
-0 ||| A D B B B ||| -223.045
-0 ||| A D D A B ||| -223.045
-0 ||| A B C C B ||| -223.045
-0 ||| A E B B A ||| -223.045
-0 ||| A C C B B ||| -223.045
-0 ||| A A B B D ||| -223.045
-0 ||| A D C C A ||| -223.045
-0 ||| A B D B B ||| -223.045
-0 ||| A A E B B ||| -223.045
-0 ||| A C E B A ||| -223.045
-0 ||| A C E A B ||| -223.045
-0 ||| A E B A B ||| -223.045
-0 ||| A D D B A ||| -223.045
-0 ||| A B A E B ||| -223.045
-0 ||| A B E C A ||| -223.045
-0 ||| A A D A D ||| -223.045
-0 ||| A E D A A ||| -223.045
-0 ||| A B A A E ||| -223.045
-0 ||| A A C E A ||| -223.045
-0 ||| A C B B C ||| -223.045
-0 ||| A B B E A ||| -223.045
-0 ||| A C D A C ||| -223.045
-0 ||| A D A E A ||| -223.045
-0 ||| A B A D C ||| -223.045
-0 ||| A B C D A ||| -223.045
-0 ||| A A A E C ||| -223.045
-0 ||| A B A C D ||| -223.045
-0 ||| A E A B B ||| -223.045
-0 ||| A C B A D ||| -223.045
-0 ||| A A D B C ||| -223.045
-0 ||| A B B C C ||| -223.045
-0 ||| A D A C C ||| -223.045
-0 ||| A A C C C ||| -223.045
-0 ||| B B B C C ||| -224.045
-0 ||| D A C C B ||| -224.045
-0 ||| D C B B B ||| -224.045
-0 ||| B A E B B ||| -224.045
-0 ||| E A C A C ||| -224.045
-0 ||| D C D B A ||| -224.045
-0 ||| E C A C B ||| -224.045
-0 ||| D D A C B ||| -224.045
-0 ||| C C D C A ||| -224.045
-0 ||| B B C C B ||| -224.045
-0 ||| D A A E B ||| -224.045
-0 ||| E B C B A ||| -224.045
-0 ||| C D C A B ||| -224.045
-0 ||| B C A B D ||| -224.045
-0 ||| C C B D A ||| -224.045
-0 ||| C A D C B ||| -224.045
-0 ||| B C B A D ||| -224.045
-0 ||| C D C B A ||| -224.045
-0 ||| C B E A B ||| -224.045
-0 ||| C A B D B ||| -224.045
-0 ||| B B E C A ||| -224.045
-0 ||| C C B C B ||| -224.045
-0 ||| D C A C C ||| -224.045
-0 ||| C B E B A ||| -224.045
-0 ||| B D B B B ||| -224.045
-0 ||| E B C A B ||| -224.045
-0 ||| E A D C A ||| -224.045
-0 ||| D B B C B ||| -224.045
-0 ||| B A B B D ||| -224.045
-0 ||| B B C D A ||| -224.045
-0 ||| B B D B B ||| -224.045
-0 ||| D A D B B ||| -224.045
-0 ||| D C C C A ||| -224.045
-0 ||| D C D A B ||| -224.045
-0 ||| B E A B B ||| -224.045
-0 ||| E C B C A ||| -224.045
-0 ||| C C A D B ||| -224.045
-0 ||| B D D A B ||| -224.045
-0 ||| D A C D A ||| -224.045
-0 ||| E A A D B ||| -224.045
-0 ||| D B A D B ||| -224.045
-0 ||| E C A D A ||| -224.045
-0 ||| B E B A B ||| -224.045
-0 ||| C B C B B ||| -224.045
-0 ||| E A B D A ||| -224.045
-0 ||| B C E A B ||| -224.045
-0 ||| D E A C A ||| -224.045
-0 ||| E A B C B ||| -224.045
-0 ||| B D D B A ||| -224.045
-0 ||| B B A E B ||| -224.045
-0 ||| B D C C A ||| -224.045
-0 ||| B B A C D ||| -224.045
-0 ||| B B B E A ||| -224.045
-0 ||| B C C B B ||| -224.045
-0 ||| B D A E A ||| -224.045
-0 ||| C B A B D ||| -224.045
-0 ||| D A E C A ||| -224.045
-0 ||| C A C A D ||| -224.045
-0 ||| D B D C A ||| -224.045
-0 ||| E B B A C ||| -224.045
-0 ||| B C E B A ||| -224.045
-0 ||| D A A C D ||| -224.045
-0 ||| C D E A A ||| -224.045
-0 ||| B A D A D ||| -224.045
-0 ||| D B B D A ||| -224.045
-0 ||| B A C C C ||| -224.045
-0 ||| E D C A A ||| -224.045
-0 ||| D A A D C ||| -224.045
-0 ||| D D A D A ||| -224.045
-0 ||| C B B A D ||| -224.045
-0 ||| C E C A A ||| -224.045
-0 ||| B A D B C ||| -224.045
-0 ||| D A B E A ||| -224.045
-0 ||| E B A A D ||| -224.045
-0 ||| E B E A A ||| -224.045
-0 ||| B B A D C ||| -224.045
-0 ||| D C A E A ||| -224.045
-0 ||| E B A B C ||| -224.045
-0 ||| B E D A A ||| -224.045
-0 ||| B D A C C ||| -224.045
-0 ||| B E B B A ||| -224.045
-0 ||| D A B C C ||| -224.045
-0 ||| B A C E A ||| -224.045
-0 ||| C D A B C ||| -224.045
-0 ||| D D B C A ||| -224.045
-0 ||| C A C B C ||| -224.045
-0 ||| C A D D A ||| -224.045
-0 ||| C E A A C ||| -224.045
-0 ||| D A A A E ||| -224.045
-0 ||| C B B B C ||| -224.045
-0 ||| B A A E C ||| -224.045
-0 ||| C D A A D ||| -224.045
-0 ||| C C C A C ||| -224.045
-0 ||| E D A A C ||| -224.045
-0 ||| C A E A C ||| -224.045
-0 ||| D B C A C ||| -224.045
-0 ||| B C B B C ||| -224.045
-0 ||| B B A A E ||| -224.045
-0 ||| B C D A C ||| -224.045
-0 ||| C D B A C ||| -224.045
-0 ||| C B D A C ||| -224.045
-0 ||| A C D B B ||| -225.045
-0 ||| A A B C D ||| -225.045
-0 ||| A C C C B ||| -225.045
-0 ||| A A C D B ||| -225.045
-0 ||| A D A D B ||| -225.045
-0 ||| A E A C B ||| -225.045
-0 ||| A B D C B ||| -225.045
-0 ||| A B B D B ||| -225.045
-0 ||| A A E D A ||| -225.045
-0 ||| A A E C B ||| -225.045
-0 ||| A C A E B ||| -225.045
-0 ||| A A B A E ||| -225.045
-0 ||| A C E C A ||| -225.045
-0 ||| A A A D D ||| -225.045
-0 ||| A D D C A ||| -225.045
-0 ||| A A B E B ||| -225.045
-0 ||| A A D E A ||| -225.045
-0 ||| A C A C D ||| -225.045
-0 ||| A C C D A ||| -225.045
-0 ||| A B C A D ||| -225.045
-0 ||| A D B D A ||| -225.045
-0 ||| A D B C B ||| -225.045
-0 ||| A E A D A ||| -225.045
-0 ||| A C A A E ||| -225.045
-0 ||| A C B E A ||| -225.045
-0 ||| A D C A C ||| -225.045
-0 ||| A B D D A ||| -225.045
-0 ||| A A A B E ||| -225.045
-0 ||| A E B C A ||| -225.045
-0 ||| A A B D C ||| -225.045
-0 ||| A C A D C ||| -225.045
-0 ||| A C B C C ||| -225.045
-0 ||| A A D C C ||| -225.045
-0 ||| A B E A C ||| -225.045
-0 ||| A B C B C ||| -225.045
-0 ||| C C E A B ||| -226.045
-0 ||| B B C B C ||| -226.045
-0 ||| B A B D C ||| -226.045
-0 ||| C C D A C ||| -226.045
-0 ||| D C C A C ||| -226.045
-0 ||| C B B C C ||| -226.045
-0 ||| E A B B C ||| -226.045
-0 ||| E C A B C ||| -226.045
-0 ||| B C C C B ||| -226.045
-0 ||| B A D C C ||| -226.045
-0 ||| C B A D C ||| -226.045
-0 ||| D B D A C ||| -226.045
-0 ||| D D B A C ||| -226.045
-0 ||| D B B B C ||| -226.045
-0 ||| C A A E C ||| -226.045
-0 ||| E C B A C ||| -226.045
-0 ||| C D A C C ||| -226.045
-0 ||| C A C C C ||| -226.045
-0 ||| B C A D C ||| -226.045
-0 ||| E E A A B ||| -226.045
-0 ||| C B A E B ||| -226.045
-0 ||| D E A A C ||| -226.045
-0 ||| E A D A C ||| -226.045
-0 ||| C B C C B ||| -226.045
-0 ||| E B D A B ||| -226.045
-0 ||| B B E A C ||| -226.045
-0 ||| D B E A B ||| -226.045
-0 ||| C D D A B ||| -226.045
-0 ||| B C B C C ||| -226.045
-0 ||| C A E B B ||| -226.045
-0 ||| B B B D B ||| -226.045
-0 ||| C C C B B ||| -226.045
-0 ||| D A C A D ||| -226.045
-0 ||| D A E A C ||| -226.045
-0 ||| C B A A E ||| -226.045
-0 ||| C A D B C ||| -226.045
-0 ||| E D B A B ||| -226.045
-0 ||| E B A C C ||| -226.045
-0 ||| D C D C A ||| -226.045
-0 ||| D D C A B ||| -226.045
-0 ||| B A A B E ||| -226.045
-0 ||| E A A B D ||| -226.045
-0 ||| E B A E A ||| -226.045
-0 ||| D C A D B ||| -226.045
-0 ||| D A D D A ||| -226.045
-0 ||| C C A B D ||| -226.045
-0 ||| E D B B A ||| -226.045
-0 ||| B A C D B ||| -226.045
-0 ||| B C E C A ||| -226.045
-0 ||| B A B C D ||| -226.045
-0 ||| C D A E A ||| -226.045
-0 ||| C C B A D ||| -226.045
-0 ||| B A D E A ||| -226.045
-0 ||| B B C A D ||| -226.045
-0 ||| C E B B A ||| -226.045
-0 ||| B C A C D ||| -226.045
-0 ||| C A C E A ||| -226.045
-0 ||| E C A A D ||| -226.045
-0 ||| C D C C A ||| -226.045
-0 ||| D B B A D ||| -226.045
-0 ||| E B D B A ||| -226.045
-0 ||| B A E C B ||| -226.045
-0 ||| E B C C A ||| -226.045
-0 ||| C A D A D ||| -226.045
-0 ||| C B E C A ||| -226.045
-0 ||| B A B E B ||| -226.045
-0 ||| E E A B A ||| -226.045
-0 ||| B C D B B ||| -226.045
-0 ||| D B E B A ||| -226.045
-0 ||| B D B C B ||| -226.045
-0 ||| D D C B A ||| -226.045
-0 ||| C D B B B ||| -226.045
-0 ||| C D D B A ||| -226.045
-0 ||| B B D C B ||| -226.045
-0 ||| C C E B A ||| -226.045
-0 ||| B E A C B ||| -226.045
-0 ||| E C C B A ||| -226.045
-0 ||| D A B D B ||| -226.045
-0 ||| B E B C A ||| -226.045
-0 ||| C E B A B ||| -226.045
-0 ||| B D D C A ||| -226.045
-0 ||| D B A B D ||| -226.045
-0 ||| D E C A A ||| -226.045
-0 ||| E B B B B ||| -226.045
-0 ||| B E A D A ||| -226.045
-0 ||| B C A A E ||| -226.045
-0 ||| D D E A A ||| -226.045
-0 ||| E A C B B ||| -226.045
-0 ||| C B B E A ||| -226.045
-0 ||| C E A B B ||| -226.045
-0 ||| E C E A A ||| -226.045
-0 ||| B A B A E ||| -226.045
-0 ||| B B D D A ||| -226.045
-0 ||| E C C A B ||| -226.045
-0 ||| C E D A A ||| -226.045
-0 ||| E D A B B ||| -226.045
-0 ||| C B C D A ||| -226.045
-0 ||| B A A D D ||| -226.045
-0 ||| E E B A A ||| -226.045
-0 ||| E A E A B ||| -226.045
-0 ||| B A E D A ||| -226.045
-0 ||| D B C B B ||| -226.045
-0 ||| E D D A A ||| -226.045
-0 ||| B C A E B ||| -226.045
-0 ||| B C C D A ||| -226.045
-0 ||| B D A D B ||| -226.045
-0 ||| D C B D A ||| -226.045
-0 ||| C B D B B ||| -226.045
-0 ||| B D B D A ||| -226.045
-0 ||| D C B C B ||| -226.045
-0 ||| B C B E A ||| -226.045
-0 ||| D D A A D ||| -226.045
-0 ||| E A E B A ||| -226.045
-0 ||| C A B B D ||| -226.045
-0 ||| E A B A D ||| -226.045
-0 ||| B D C A C ||| -226.045
-0 ||| D A D C B ||| -226.045
-0 ||| D A C B C ||| -226.045
-0 ||| D D A B C ||| -226.045
-0 ||| C C B B C ||| -226.045
-0 ||| C B A C D ||| -226.045
-0 ||| A C E A C ||| -227.045
-0 ||| A B D B C ||| -227.045
-0 ||| A E B A C ||| -227.045
-0 ||| A A E B C ||| -227.045
-0 ||| A D D A C ||| -227.045
-0 ||| A B C C C ||| -227.045
-0 ||| A E C A B ||| -227.045
-0 ||| A A D D B ||| -227.045
-0 ||| A D E A B ||| -227.045
-0 ||| A D B B C ||| -227.045
-0 ||| A C D C B ||| -227.045
-0 ||| A B E B B ||| -227.045
-0 ||| A D E B A ||| -227.045
-0 ||| A D C B B ||| -227.045
-0 ||| A B C E A ||| -227.045
-0 ||| A B A E C ||| -227.045
-0 ||| A E C B A ||| -227.045
-0 ||| A A A C E ||| -227.045
-0 ||| A E E A A ||| -227.045
-0 ||| A A C B D ||| -227.045
-0 ||| A C D D A ||| -227.045
-0 ||| A D B A D ||| -227.045
-0 ||| A E A A D ||| -227.045
-0 ||| A C C B C ||| -227.045
-0 ||| A A E A D ||| -227.045
-0 ||| A B B B D ||| -227.045
-0 ||| A D A B D ||| -227.045
-0 ||| A B D A D ||| -227.045
-0 ||| A C C A D ||| -227.045
-0 ||| A E A B C ||| -227.045
-0 ||| A C B D B ||| -227.045
-0 ||| E C B B B ||| -228.045
-0 ||| E C D A B ||| -228.045
-0 ||| B B E B B ||| -228.045
-0 ||| C A B E B ||| -228.045
-0 ||| E B A D B ||| -228.045
-0 ||| D A E B B ||| -228.045
-0 ||| C B D C B ||| -228.045
-0 ||| E A A E B ||| -228.045
-0 ||| D B D B B ||| -228.045
-0 ||| C D B C B ||| -228.045
-0 ||| C A E C B ||| -228.045
-0 ||| C C A E B ||| -228.045
-0 ||| B C D C B ||| -228.045
-0 ||| D D D A B ||| -228.045
-0 ||| E B B C B ||| -228.045
-0 ||| C D A D B ||| -228.045
-0 ||| B E C A B ||| -228.045
-0 ||| B D E A B ||| -228.045
-0 ||| E A C C B ||| -228.045
-0 ||| D B A E B ||| -228.045
-0 ||| D E B A B ||| -228.045
-0 ||| D D B B B ||| -228.045
-0 ||| B C B D B ||| -228.045
-0 ||| C E A C B ||| -228.045
-0 ||| E D A C B ||| -228.045
-0 ||| D C E A B ||| -228.045
-0 ||| D B C C B ||| -228.045
-0 ||| C A C D B ||| -228.045
-0 ||| D C B A D ||| -228.045
-0 ||| C B B D B ||| -228.045
-0 ||| C C C C B ||| -228.045
-0 ||| D C B B C ||| -228.045
-0 ||| D A C C C ||| -228.045
-0 ||| D C D A C ||| -228.045
-0 ||| C B C B C ||| -228.045
-0 ||| E A A D C ||| -228.045
-0 ||| B A D D B ||| -228.045
-0 ||| D C C B B ||| -228.045
-0 ||| C C D B B ||| -228.045
-0 ||| B D C B B ||| -228.045
-0 ||| B E B A C ||| -228.045
-0 ||| C B C A D ||| -228.045
-0 ||| B D A B D ||| -228.045
-0 ||| E A A C D ||| -228.045
-0 ||| C A B C D ||| -228.045
-0 ||| E C A C C ||| -228.045
-0 ||| D C A B D ||| -228.045
-0 ||| B B C C C ||| -228.045
-0 ||| B A E A D ||| -228.045
-0 ||| D D A C C ||| -228.045
-0 ||| B B B B D ||| -228.045
-0 ||| C D C A C ||| -228.045
-0 ||| D A A E C ||| -228.045
-0 ||| E A D B B ||| -228.045
-0 ||| D B A C D ||| -228.045
-0 ||| B A C B D ||| -228.045
-0 ||| C B E A C ||| -228.045
-0 ||| B D B B C ||| -228.045
-0 ||| D B B C C ||| -228.045
-0 ||| B E A A D ||| -228.045
-0 ||| D A B B D ||| -228.045
-0 ||| D B A D C ||| -228.045
-0 ||| E B C A C ||| -228.045
-0 ||| D E A B B ||| -228.045
-0 ||| B A E B C ||| -228.045
-0 ||| B C C A D ||| -228.045
-0 ||| C C A C D ||| -228.045
-0 ||| C C B C C ||| -228.045
-0 ||| D A D A D ||| -228.045
-0 ||| B B D B C ||| -228.045
-0 ||| E D B C A ||| -228.045
-0 ||| B D D A C ||| -228.045
-0 ||| B E A B C ||| -228.045
-0 ||| C A A D D ||| -228.045
-0 ||| C C A D C ||| -228.045
-0 ||| B D B A D ||| -228.045
-0 ||| B E C B A ||| -228.045
-0 ||| E A B C C ||| -228.045
-0 ||| D D D B A ||| -228.045
-0 ||| B C E A C ||| -228.045
-0 ||| C C E C A ||| -228.045
-0 ||| B B A E C ||| -228.045
-0 ||| D E B B A ||| -228.045
-0 ||| B C C B C ||| -228.045
-0 ||| E A B E A ||| -228.045
-0 ||| B A A C E ||| -228.045
-0 ||| E B B D A ||| -228.045
-0 ||| C A A B E ||| -228.045
-0 ||| D E D A A ||| -228.045
-0 ||| C A B A E ||| -228.045
-0 ||| E C A E A ||| -228.045
-0 ||| C C A A E ||| -228.045
-0 ||| E C D B A ||| -228.045
-0 ||| E A A A E ||| -228.045
-0 ||| B E E A A ||| -228.045
-0 ||| D B A A E ||| -228.045
-0 ||| C C B E A ||| -228.045
-0 ||| C A B D C ||| -228.045
-0 ||| C E B C A ||| -228.045
-0 ||| D A D B C ||| -228.045
-0 ||| D A C E A ||| -228.045
-0 ||| B B D A D ||| -228.045
-0 ||| B B C E A ||| -228.045
-0 ||| C A D C C ||| -228.045
-0 ||| E A E C A ||| -228.045
-0 ||| D B E C A ||| -228.045
-0 ||| B D E B A ||| -228.045
-0 ||| E B D C A ||| -228.045
-0 ||| C A E D A ||| -228.045
-0 ||| C D D C A ||| -228.045
-0 ||| E E A C A ||| -228.045
-0 ||| D D C C A ||| -228.045
-0 ||| D B B E A ||| -228.045
-0 ||| C A D E A ||| -228.045
-0 ||| C B D D A ||| -228.045
-0 ||| E C C C A ||| -228.045
-0 ||| C C C D A ||| -228.045
-0 ||| E A C D A ||| -228.045
-0 ||| C D B D A ||| -228.045
-0 ||| D D A E A ||| -228.045
-0 ||| B C D D A ||| -228.045
-0 ||| D B C D A ||| -228.045
-0 ||| D C E B A ||| -228.045
-0 ||| E D A D A ||| -228.045
-0 ||| C E A D A ||| -228.045
-0 ||| A B E C B ||| -229.045
-0 ||| A A C E B ||| -229.045
-0 ||| A D A E B ||| -229.045
-0 ||| A C B B D ||| -229.045
-0 ||| A C D B C ||| -229.045
-0 ||| A D C C B ||| -229.045
-0 ||| A C C C C ||| -229.045
-0 ||| A A C C D ||| -229.045
-0 ||| A D D B B ||| -229.045
-0 ||| A D A C D ||| -229.045
-0 ||| A B B C D ||| -229.045
-0 ||| A C E B B ||| -229.045
-0 ||| A A C D C ||| -229.045
-0 ||| A B B E B ||| -229.045
-0 ||| A D A D C ||| -229.045
-0 ||| A E A C C ||| -229.045
-0 ||| A B D C C ||| -229.045
-0 ||| A A B E C ||| -229.045
-0 ||| A C D A D ||| -229.045
-0 ||| A A E C C ||| -229.045
-0 ||| A E B B B ||| -229.045
-0 ||| A E D A B ||| -229.045
-0 ||| A B D E A ||| -229.045
-0 ||| A C A E C ||| -229.045
-0 ||| A B A B E ||| -229.045
-0 ||| A D E C A ||| -229.045
-0 ||| A A C A E ||| -229.045
-0 ||| A D B C C ||| -229.045
-0 ||| A C C E A ||| -229.045
-0 ||| A A D B D ||| -229.045
-0 ||| A B B D C ||| -229.045
-0 ||| A A E E A ||| -229.045
-0 ||| A B B A E ||| -229.045
-0 ||| A D A A E ||| -229.045
-0 ||| A D B E A ||| -229.045
-0 ||| A B A D D ||| -229.045
-0 ||| A A A E D ||| -229.045
-0 ||| A B E D A ||| -229.045
-0 ||| A B C D B ||| -229.045
-0 ||| A E C C A ||| -229.045
-0 ||| A E A E A ||| -229.045
-0 ||| A D C D A ||| -229.045
-0 ||| A E D B A ||| -229.045
-0 ||| B A C A E ||| -230.045
-0 ||| E E A A C ||| -230.045
-0 ||| D C D B B ||| -230.045
-0 ||| E B C B B ||| -230.045
-0 ||| C C D C B ||| -230.045
-0 ||| D C C C B ||| -230.045
-0 ||| B B B C D ||| -230.045
-0 ||| C C E A C ||| -230.045
-0 ||| B B C D B ||| -230.045
-0 ||| B C C C C ||| -230.045
-0 ||| C D C B B ||| -230.045
-0 ||| E A D C B ||| -230.045
-0 ||| C B E B B ||| -230.045
-0 ||| B B E C B ||| -230.045
-0 ||| B D C C B ||| -230.045
-0 ||| E C A D B ||| -230.045
-0 ||| C E C A B ||| -230.045
-0 ||| E C B C B ||| -230.045
-0 ||| B D D B B ||| -230.045
-0 ||| D E A C B ||| -230.045
-0 ||| E A B D B ||| -230.045
-0 ||| D B D C B ||| -230.045
-0 ||| B B B E B ||| -230.045
-0 ||| D D A D B ||| -230.045
-0 ||| D A E C B ||| -230.045
-0 ||| B D A E B ||| -230.045
-0 ||| E D C A B ||| -230.045
-0 ||| B C E B B ||| -230.045
-0 ||| D B B D B ||| -230.045
-0 ||| C D E A B ||| -230.045
-0 ||| C A E B C ||| -230.045
-0 ||| D C A E B ||| -230.045
-0 ||| C D B A D ||| -230.045
-0 ||| B B B D C ||| -230.045
-0 ||| D D B C B ||| -230.045
-0 ||| B E D A B ||| -230.045
-0 ||| B A C E B ||| -230.045
-0 ||| D A B E B ||| -230.045
-0 ||| C B D A D ||| -230.045
-0 ||| B E B B B ||| -230.045
-0 ||| C B A E C ||| -230.045
-0 ||| C D D A C ||| -230.045
-0 ||| C B C C C ||| -230.045
-0 ||| D B E A C ||| -230.045
-0 ||| E B D A C ||| -230.045
-0 ||| C C C B C ||| -230.045
-0 ||| D D C A C ||| -230.045
-0 ||| C D B B C ||| -230.045
-0 ||| D C A C D ||| -230.045
-0 ||| B E A C C ||| -230.045
-0 ||| C E B A C ||| -230.045
-0 ||| B B B A E ||| -230.045
-0 ||| C B D B C ||| -230.045
-0 ||| E D B A C ||| -230.045
-0 ||| D A C D B ||| -230.045
-0 ||| C C B D B ||| -230.045
-0 ||| B D A A E ||| -230.045
-0 ||| E B E A B ||| -230.045
-0 ||| C A A C E ||| -230.045
-0 ||| D C A D C ||| -230.045
-0 ||| B A C C D ||| -230.045
-0 ||| B C D A D ||| -230.045
-0 ||| D A A D D ||| -230.045
-0 ||| C A D D B ||| -230.045
-0 ||| E B B A D ||| -230.045
-0 ||| E D E A A ||| -230.045
-0 ||| D A B D C ||| -230.045
-0 ||| B A C D C ||| -230.045
-0 ||| C A C B D ||| -230.045
-0 ||| B E C C A ||| -230.045
-0 ||| B A D B D ||| -230.045
-0 ||| B A E C C ||| -230.045
-0 ||| C D A B D ||| -230.045
-0 ||| C B C E A ||| -230.045
-0 ||| B C D B C ||| -230.045
-0 ||| B A B E C ||| -230.045
-0 ||| B B D C C ||| -230.045
-0 ||| C D E B A ||| -230.045
-0 ||| D A B C D ||| -230.045
-0 ||| E B A B D ||| -230.045
-0 ||| B B A D D ||| -230.045
-0 ||| C E E A A ||| -230.045
-0 ||| B D A C D ||| -230.045
-0 ||| B D B C C ||| -230.045
-0 ||| C E C B A ||| -230.045
-0 ||| E B B B C ||| -230.045
-0 ||| C C C A D ||| -230.045
-0 ||| D A D E A ||| -230.045
-0 ||| C E A A D ||| -230.045
-0 ||| E D A B C ||| -230.045
-0 ||| D E B C A ||| -230.045
-0 ||| B D A D C ||| -230.045
-0 ||| E C C A C ||| -230.045
-0 ||| E E C A A ||| -230.045
-0 ||| E A C B C ||| -230.045
-0 ||| D C A A E ||| -230.045
-0 ||| D D D C A ||| -230.045
-0 ||| C E A B C ||| -230.045
-0 ||| B C A E C ||| -230.045
-0 ||| E D C B A ||| -230.045
-0 ||| C B B B D ||| -230.045
-0 ||| E A C A D ||| -230.045
-0 ||| B D C D A ||| -230.045
-0 ||| D B C B C ||| -230.045
-0 ||| B A A E D ||| -230.045
-0 ||| C C D D A ||| -230.045
-0 ||| E A E A C ||| -230.045
-0 ||| B C B B D ||| -230.045
-0 ||| E C D C A ||| -230.045
-0 ||| D A D C C ||| -230.045
-0 ||| C A E A D ||| -230.045
-0 ||| B B E D A ||| -230.045
-0 ||| E D A A D ||| -230.045
-0 ||| B B A B E ||| -230.045
-0 ||| E C B D A ||| -230.045
-0 ||| D B C A D ||| -230.045
-0 ||| D A B A E ||| -230.045
-0 ||| E B E B A ||| -230.045
-0 ||| D A A B E ||| -230.045
-0 ||| D C B C C ||| -230.045
-0 ||| D B D D A ||| -230.045
-0 ||| D C E C A ||| -230.045
-0 ||| B D E C A ||| -230.045
-0 ||| D E A D A ||| -230.045
-0 ||| D C C D A ||| -230.045
-0 ||| D D B D A ||| -230.045
-0 ||| D A E D A ||| -230.045
-0 ||| B B D E A ||| -230.045
-0 ||| B E A E A ||| -230.045
-0 ||| E A D D A ||| -230.045
-0 ||| B D B E A ||| -230.045
-0 ||| B A E E A ||| -230.045
-0 ||| D C B E A ||| -230.045
-0 ||| B E D B A ||| -230.045
-0 ||| B C C E A ||| -230.045
-0 ||| A D E A C ||| -231.045
-0 ||| A A D D C ||| -231.045
-0 ||| A E C A C ||| -231.045
-0 ||| A A B B E ||| -231.045
-0 ||| A C A B E ||| -231.045
-0 ||| A C B E B ||| -231.045
-0 ||| A B C B D ||| -231.045
-0 ||| A A D A E ||| -231.045
-0 ||| A D C B C ||| -231.045
-0 ||| A A D C D ||| -231.045
-0 ||| A B E B C ||| -231.045
-0 ||| A E A D B ||| -231.045
-0 ||| A C B D C ||| -231.045
-0 ||| A D B D B ||| -231.045
-0 ||| A C D C C ||| -231.045
-0 ||| A D D C B ||| -231.045
-0 ||| A C C D B ||| -231.045
-0 ||| A A D E B ||| -231.045
-0 ||| A C E C B ||| -231.045
-0 ||| A B D D B ||| -231.045
-0 ||| A B E A D ||| -231.045
-0 ||| A E D C A ||| -231.045
-0 ||| A A E D B ||| -231.045
-0 ||| A C B C D ||| -231.045
-0 ||| A C E D A ||| -231.045
-0 ||| A E B C B ||| -231.045
-0 ||| A C A D D ||| -231.045
-0 ||| A E B D A ||| -231.045
-0 ||| A C B A E ||| -231.045
-0 ||| A D C A D ||| -231.045
-0 ||| A C D E A ||| -231.045
-0 ||| A A B D D ||| -231.045
-0 ||| A B A C E ||| -231.045
-0 ||| A D D D A ||| -231.045
-0 ||| B A B B E ||| -232.045
-0 ||| C A C A E ||| -232.045
-0 ||| D E C B A ||| -232.045
-0 ||| D C E A C ||| -232.045
-0 ||| C A C E B ||| -232.045
-0 ||| B C E C B ||| -232.045
-0 ||| C A E C C ||| -232.045
-0 ||| C D B C C ||| -232.045
-0 ||| E C B B C ||| -232.045
-0 ||| E B A D C ||| -232.045
-0 ||| C A B E C ||| -232.045
-0 ||| E C D A C ||| -232.045
-0 ||| B B E B C ||| -232.045
-0 ||| D A E B C ||| -232.045
-0 ||| D B D B C ||| -232.045
-0 ||| E A A E C ||| -232.045
-0 ||| C B D C C ||| -232.045
-0 ||| E D A C C ||| -232.045
-0 ||| C D A D C ||| -232.045
-0 ||| E B B C C ||| -232.045
-0 ||| C C A E C ||| -232.045
-0 ||| E D B B B ||| -232.045
-0 ||| D D D A C ||| -232.045
-0 ||| B C D C C ||| -232.045
-0 ||| C E A C C ||| -232.045
-0 ||| E A C C C ||| -232.045
-0 ||| B D E A C ||| -232.045
-0 ||| D A D D B ||| -232.045
-0 ||| B E C A C ||| -232.045
-0 ||| B C B D C ||| -232.045
-0 ||| E B A E B ||| -232.045
-0 ||| D D B B C ||| -232.045
-0 ||| D B A E C ||| -232.045
-0 ||| D E B A C ||| -232.045
-0 ||| C E B B B ||| -232.045
-0 ||| B A D E B ||| -232.045
-0 ||| C B A D D ||| -232.045
-0 ||| B B C B D ||| -232.045
-0 ||| C D A E B ||| -232.045
-0 ||| D B C C C ||| -232.045
-0 ||| B C A D D ||| -232.045
-0 ||| B C B A E ||| -232.045
-0 ||| B A D C D ||| -232.045
-0 ||| C B B C D ||| -232.045
-0 ||| D C C A D ||| -232.045
-0 ||| B A B D D ||| -232.045
-0 ||| C C D A D ||| -232.045
-0 ||| E A B B D ||| -232.045
-0 ||| E C A B D ||| -232.045
-0 ||| C B B D C ||| -232.045
-0 ||| D B D A D ||| -232.045
-0 ||| D B B B D ||| -232.045
-0 ||| C A C C D ||| -232.045
-0 ||| D D B A D ||| -232.045
-0 ||| C A C D C ||| -232.045
-0 ||| C A A E D ||| -232.045
-0 ||| C D A C D ||| -232.045
-0 ||| E C B A D ||| -232.045
-0 ||| C C C C C ||| -232.045
-0 ||| B A D A E ||| -232.045
-0 ||| E C E A B ||| -232.045
-0 ||| B A D D C ||| -232.045
-0 ||| B C B C D ||| -232.045
-0 ||| D E A A D ||| -232.045
-0 ||| D C D C B ||| -232.045
-0 ||| E A D A D ||| -232.045
-0 ||| B B E A D ||| -232.045
-0 ||| C B B E B ||| -232.045
-0 ||| E B D B B ||| -232.045
-0 ||| D D C B B ||| -232.045
-0 ||| C D C C B ||| -232.045
-0 ||| B D C B C ||| -232.045
-0 ||| D C C B C ||| -232.045
-0 ||| E B C C B ||| -232.045
-0 ||| D B E B B ||| -232.045
-0 ||| C C D B C ||| -232.045
-0 ||| E E A B B ||| -232.045
-0 ||| C B E C B ||| -232.045
-0 ||| D D E A B ||| -232.045
-0 ||| B C A B E ||| -232.045
-0 ||| E C C B B ||| -232.045
-0 ||| C C E B B ||| -232.045
-0 ||| C D D B B ||| -232.045
-0 ||| B E B C B ||| -232.045
-0 ||| B E A D B ||| -232.045
-0 ||| D E C A B ||| -232.045
-0 ||| B D D C B ||| -232.045
-0 ||| B B D D B ||| -232.045
-0 ||| B C C D B ||| -232.045
-0 ||| E D D A B ||| -232.045
-0 ||| C E D A B ||| -232.045
-0 ||| B A E D B ||| -232.045
-0 ||| C B C D B ||| -232.045
-0 ||| E E B A B ||| -232.045
-0 ||| D C B D B ||| -232.045
-0 ||| C C B B D ||| -232.045
-0 ||| B C B E B ||| -232.045
-0 ||| B D B D B ||| -232.045
-0 ||| E A D B C ||| -232.045
-0 ||| D E A B C ||| -232.045
-0 ||| D A A C E ||| -232.045
-0 ||| B B A C E ||| -232.045
-0 ||| E B A A E ||| -232.045
-0 ||| C B A B E ||| -232.045
-0 ||| D D A B D ||| -232.045
-0 ||| D A E A D ||| -232.045
-0 ||| D D E B A ||| -232.045
-0 ||| C B B A E ||| -232.045
-0 ||| C A D B D ||| -232.045
-0 ||| C D C D A ||| -232.045
-0 ||| D A C B D ||| -232.045
-0 ||| C D A A E ||| -232.045
-0 ||| D C D D A ||| -232.045
-0 ||| E B A C D ||| -232.045
-0 ||| E A E B B ||| -232.045
-0 ||| C D E C A ||| -232.045
-0 ||| B D C A D ||| -232.045
-0 ||| C E C C A ||| -232.045
-0 ||| B E D C A ||| -232.045
-0 ||| B C E D A ||| -232.045
-0 ||| E D C C A ||| -232.045
-0 ||| D E E A A ||| -232.045
-0 ||| E E B B A ||| -232.045
-0 ||| E B E C A ||| -232.045
-0 ||| E E D A A ||| -232.045
-0 ||| C A E E A ||| -232.045
-0 ||| C E A E A ||| -232.045
-0 ||| E D A E A ||| -232.045
-0 ||| C B D E A ||| -232.045
-0 ||| B E B D A ||| -232.045
-0 ||| C B E D A ||| -232.045
-0 ||| E C E B A ||| -232.045
-0 ||| C E D B A ||| -232.045
-0 ||| C C C E A ||| -232.045
-0 ||| E B B E A ||| -232.045
-0 ||| B D D D A ||| -232.045
-0 ||| E B C D A ||| -232.045
-0 ||| D B C E A ||| -232.045
-0 ||| E A C E A ||| -232.045
-0 ||| C D B E A ||| -232.045
-0 ||| B C D E A ||| -232.045
-0 ||| E D D B A ||| -232.045
-0 ||| A B C C D ||| -233.045
-0 ||| A A C E C ||| -233.045
-0 ||| A C E B C ||| -233.045
-0 ||| A C A C E ||| -233.045
-0 ||| A B E C C ||| -233.045
-0 ||| A D B B D ||| -233.045
-0 ||| A E A B D ||| -233.045
-0 ||| A D E B B ||| -233.045
-0 ||| A A B C E ||| -233.045
-0 ||| A E E A B ||| -233.045
-0 ||| A E C B B ||| -233.045
-0 ||| A B C E B ||| -233.045
-0 ||| A B C D C ||| -233.045
-0 ||| A E B A D ||| -233.045
-0 ||| A A E B D ||| -233.045
-0 ||| A D D A D ||| -233.045
-0 ||| A B B E C ||| -233.045
-0 ||| A B D B D ||| -233.045
-0 ||| A D D B C ||| -233.045
-0 ||| A D A E C ||| -233.045
-0 ||| A E D A C ||| -233.045
-0 ||| A E B B C ||| -233.045
-0 ||| A D C C C ||| -233.045
-0 ||| A A A D E ||| -233.045
-0 ||| A B A E D ||| -233.045
-0 ||| A B C A E ||| -233.045
-0 ||| A C E A D ||| -233.045
-0 ||| A D C E A ||| -233.045
-0 ||| A C D D B ||| -233.045
-0 ||| A C C B D ||| -233.045
-0 ||| A E E B A ||| -233.045
-0 ||| A B E E A ||| -233.045
-0 ||| C D B D B ||| -234.045
-0 ||| C C E C B ||| -234.045
-0 ||| C C B E B ||| -234.045
-0 ||| E A A D D ||| -234.045
-0 ||| C C A D D ||| -234.045
-0 ||| B E C B B ||| -234.045
-0 ||| E A A B E ||| -234.045
-0 ||| B B C D C ||| -234.045
-0 ||| E C D B B ||| -234.045
-0 ||| E B B D B ||| -234.045
-0 ||| E A B E B ||| -234.045
-0 ||| B E E A B ||| -234.045
-0 ||| C B C B D ||| -234.045
-0 ||| D E D A B ||| -234.045
-0 ||| E C A E B ||| -234.045
-0 ||| B E A B D ||| -234.045
-0 ||| E B C B C ||| -234.045
-0 ||| D C D B C ||| -234.045
-0 ||| D C C C C ||| -234.045
-0 ||| C C D C C ||| -234.045
-0 ||| B D A E C ||| -234.045
-0 ||| B D C C C ||| -234.045
-0 ||| D A E C C ||| -234.045
-0 ||| C D C B C ||| -234.045
-0 ||| D C D A D ||| -234.045
-0 ||| B B E C C ||| -234.045
-0 ||| C B E B C ||| -234.045
-0 ||| E A D C C ||| -234.045
-0 ||| D D A D C ||| -234.045
-0 ||| D A C C D ||| -234.045
-0 ||| B D D B C ||| -234.045
-0 ||| E C B C C ||| -234.045
-0 ||| E C A D C ||| -234.045
-0 ||| C E C A C ||| -234.045
-0 ||| B B B E C ||| -234.045
-0 ||| D E A C C ||| -234.045
-0 ||| D C B B D ||| -234.045
-0 ||| D B D C C ||| -234.045
-0 ||| E A B D C ||| -234.045
-0 ||| E A E C B ||| -234.045
-0 ||| B E B B C ||| -234.045
-0 ||| C A D C D ||| -234.045
-0 ||| D C A E C ||| -234.045
-0 ||| B C E B C ||| -234.045
-0 ||| E A C D B ||| -234.045
-0 ||| D B B D C ||| -234.045
-0 ||| C D E A C ||| -234.045
-0 ||| C E B C B ||| -234.045
-0 ||| D A B E C ||| -234.045
-0 ||| D A C E B ||| -234.045
-0 ||| D D B C C ||| -234.045
-0 ||| B A C E C ||| -234.045
-0 ||| B E D A C ||| -234.045
-0 ||| D A C A E ||| -234.045
-0 ||| B B C C D ||| -234.045
-0 ||| B E B A D ||| -234.045
-0 ||| E C A C D ||| -234.045
-0 ||| C C C D B ||| -234.045
-0 ||| B D B B D ||| -234.045
-0 ||| D D A C D ||| -234.045
-0 ||| C B E A D ||| -234.045
-0 ||| D A A E D ||| -234.045
-0 ||| C D C A D ||| -234.045
-0 ||| C B A C E ||| -234.045
-0 ||| D B B C D ||| -234.045
-0 ||| E C C C B ||| -234.045
-0 ||| B D D A D ||| -234.045
-0 ||| E B C A D ||| -234.045
-0 ||| D B A D D ||| -234.045
-0 ||| B A E B D ||| -234.045
-0 ||| C B D D B ||| -234.045
-0 ||| E B D C B ||| -234.045
-0 ||| E D B C B ||| -234.045
-0 ||| B B D B D ||| -234.045
-0 ||| B D E B B ||| -234.045
-0 ||| D D D B B ||| -234.045
-0 ||| D B E C B ||| -234.045
-0 ||| C A D E B ||| -234.045
-0 ||| E E A C B ||| -234.045
-0 ||| C A E D B ||| -234.045
-0 ||| D B B E B ||| -234.045
-0 ||| C C B C D ||| -234.045
-0 ||| D D C C B ||| -234.045
-0 ||| E D C A C ||| -234.045
-0 ||| D B C D B ||| -234.045
-0 ||| B C D D B ||| -234.045
-0 ||| D D A E B ||| -234.045
-0 ||| B C E A D ||| -234.045
-0 ||| D C E B B ||| -234.045
-0 ||| C E A D B ||| -234.045
-0 ||| C D D C B ||| -234.045
-0 ||| E D A D B ||| -234.045
-0 ||| C C A B E ||| -234.045
-0 ||| E A B C D ||| -234.045
-0 ||| C C B D C ||| -234.045
-0 ||| D A C D C ||| -234.045
-0 ||| E B E A C ||| -234.045
-0 ||| E C A A E ||| -234.045
-0 ||| B A B C E ||| -234.045
-0 ||| B B A E D ||| -234.045
-0 ||| D B B A E ||| -234.045
-0 ||| D E B B B ||| -234.045
-0 ||| C A D D C ||| -234.045
-0 ||| B C C B D ||| -234.045
-0 ||| B B C A E ||| -234.045
-0 ||| C A D A E ||| -234.045
-0 ||| B B C E B ||| -234.045
-0 ||| D B A B E ||| -234.045
-0 ||| D A D B D ||| -234.045
-0 ||| E D D C A ||| -234.045
-0 ||| B A A D E ||| -234.045
-0 ||| C C B A E ||| -234.045
-0 ||| C C D E A ||| -234.045
-0 ||| B C A C E ||| -234.045
-0 ||| C A B D D ||| -234.045
-0 ||| C E B D A ||| -234.045
-0 ||| D D A A E ||| -234.045
-0 ||| E A B A E ||| -234.045
-0 ||| E D B D A ||| -234.045
-0 ||| C A B B E ||| -234.045
-0 ||| E C E C A ||| -234.045
-0 ||| B E E B A ||| -234.045
-0 ||| D D E C A ||| -234.045
-0 ||| E C B E A ||| -234.045
-0 ||| D D C D A ||| -234.045
-0 ||| D B D E A ||| -234.045
-0 ||| B B E E A ||| -234.045
-0 ||| E A E D A ||| -234.045
-0 ||| E E A D A ||| -234.045
-0 ||| E B D D A ||| -234.045
-0 ||| E E B C A ||| -234.045
-0 ||| C D D D A ||| -234.045
-0 ||| D E D B A ||| -234.045
-0 ||| D D B E A ||| -234.045
-0 ||| D E C C A ||| -234.045
-0 ||| C E D C A ||| -234.045
-0 ||| D C C E A ||| -234.045
-0 ||| E C C D A ||| -234.045
-0 ||| D E A E A ||| -234.045
-0 ||| D A E E A ||| -234.045
-0 ||| B D C E A ||| -234.045
-0 ||| E A D E A ||| -234.045
-0 ||| C C E D A ||| -234.045
-0 ||| D B E D A ||| -234.045
-0 ||| A C C A E ||| -235.045
-0 ||| A C B E C ||| -235.045
-0 ||| A B D E B ||| -235.045
-0 ||| A C C D C ||| -235.045
-0 ||| A D A D D ||| -235.045
-0 ||| A B E D B ||| -235.045
-0 ||| A C C C D ||| -235.045
-0 ||| A C D B D ||| -235.045
-0 ||| A A D E C ||| -235.045
-0 ||| A C E C C ||| -235.045
-0 ||| A A E E B ||| -235.045
-0 ||| A D B C D ||| -235.045
-0 ||| A D B A E ||| -235.045
-0 ||| A C A E D ||| -235.045
-0 ||| A E D B B ||| -235.045
-0 ||| A E A C D ||| -235.045
-0 ||| A D D C C ||| -235.045
-0 ||| A D B E B ||| -235.045
-0 ||| A A C D D ||| -235.045
-0 ||| A B D C D ||| -235.045
-0 ||| A D B D C ||| -235.045
-0 ||| A D C D B ||| -235.045
-0 ||| A E C C B ||| -235.045
-0 ||| A E A E B ||| -235.045
-0 ||| A A E C D ||| -235.045
-0 ||| A E A D C ||| -235.045
-0 ||| A D E C B ||| -235.045
-0 ||| A B D D C ||| -235.045
-0 ||| A D E D A ||| -235.045
-0 ||| A B D A E ||| -235.045
-0 ||| A A C B E ||| -235.045
-0 ||| A E B C C ||| -235.045
-0 ||| A E E C A ||| -235.045
-0 ||| A C C E B ||| -235.045
-0 ||| A A E D C ||| -235.045
-0 ||| A E A A E ||| -235.045
-0 ||| A E B E A ||| -235.045
-0 ||| A D A B E ||| -235.045
-0 ||| A A B E D ||| -235.045
-0 ||| A B B D D ||| -235.045
-0 ||| A C E E A ||| -235.045
-0 ||| A B B B E ||| -235.045
-0 ||| A A E A E ||| -235.045
-0 ||| A E C D A ||| -235.045
-0 ||| A D D E A ||| -235.045
-0 ||| B E A E B ||| -236.045
-0 ||| B D E C B ||| -236.045
-0 ||| B D B D C ||| -236.045
-0 ||| B C E C C ||| -236.045
-0 ||| D C E C B ||| -236.045
-0 ||| C A C E C ||| -236.045
-0 ||| C B D B D ||| -236.045
-0 ||| D B D D B ||| -236.045
-0 ||| D C B C D ||| -236.045
-0 ||| B D B A E ||| -236.045
-0 ||| B B D E B ||| -236.045
-0 ||| B C C A E ||| -236.045
-0 ||| D C C D B ||| -236.045
-0 ||| D A D D C ||| -236.045
-0 ||| D A E D B ||| -236.045
-0 ||| E D B B C ||| -236.045
-0 ||| D D B D B ||| -236.045
-0 ||| B A D E C ||| -236.045
-0 ||| E E A A D ||| -236.045
-0 ||| E B A E C ||| -236.045
-0 ||| E A D D B ||| -236.045
-0 ||| C E B B C ||| -236.045
-0 ||| D A D A E ||| -236.045
-0 ||| C C E A D ||| -236.045
-0 ||| C D A E C ||| -236.045
-0 ||| B C C C D ||| -236.045
-0 ||| D C B A E ||| -236.045
-0 ||| C A A D E ||| -236.045
-0 ||| B A E A E ||| -236.045
-0 ||| B C B E C ||| -236.045
-0 ||| C B C C D ||| -236.045
-0 ||| B C C E B ||| -236.045
-0 ||| C A E B D ||| -236.045
-0 ||| C D D B C ||| -236.045
-0 ||| E C E A C ||| -236.045
-0 ||| B B B D D ||| -236.045
-0 ||| B B D A E ||| -236.045
-0 ||| C B A E D ||| -236.045
-0 ||| C C E B C ||| -236.045
-0 ||| C D D A D ||| -236.045
-0 ||| C D C C C ||| -236.045
-0 ||| D C D C C ||| -236.045
-0 ||| D D C B C ||| -236.045
-0 ||| C B B E C ||| -236.045
-0 ||| E B D B C ||| -236.045
-0 ||| B D A B E ||| -236.045
-0 ||| D C A B E ||| -236.045
-0 ||| D B E B C ||| -236.045
-0 ||| C B C A E ||| -236.045
-0 ||| E B C C C ||| -236.045
-0 ||| E C C B C ||| -236.045
-0 ||| E A A C E ||| -236.045
-0 ||| E E A B C ||| -236.045
-0 ||| D D E A C ||| -236.045
-0 ||| C A B C E ||| -236.045
-0 ||| C B E C C ||| -236.045
-0 ||| B B D D C ||| -236.045
-0 ||| E B D A D ||| -236.045
-0 ||| B B B B E ||| -236.045
-0 ||| E E B A C ||| -236.045
-0 ||| C C C B D ||| -236.045
-0 ||| C E B A D ||| -236.045
-0 ||| B D D C C ||| -236.045
-0 ||| D B E A D ||| -236.045
-0 ||| D E C A C ||| -236.045
-0 ||| B E B C C ||| -236.045
-0 ||| B E A D C ||| -236.045
-0 ||| C E D A C ||| -236.045
-0 ||| C B C D C ||| -236.045
-0 ||| E D D A C ||| -236.045
-0 ||| B C C D C ||| -236.045
-0 ||| B A E D C ||| -236.045
-0 ||| B A C B E ||| -236.045
-0 ||| D B A C E ||| -236.045
-0 ||| D C B E B ||| -236.045
-0 ||| D D C A D ||| -236.045
-0 ||| B E A C D ||| -236.045
-0 ||| C D B B D ||| -236.045
-0 ||| D C B D C ||| -236.045
-0 ||| D A B B E ||| -236.045
-0 ||| B E A A E ||| -236.045
-0 ||| C C A C E ||| -236.045
-0 ||| B D B E B ||| -236.045
-0 ||| C C D D B ||| -236.045
-0 ||| E A E B C ||| -236.045
-0 ||| B E C C B ||| -236.045
-0 ||| C B C E B ||| -236.045
-0 ||| B D C D B ||| -236.045
-0 ||| E D C B B ||| -236.045
-0 ||| E D B A D ||| -236.045
-0 ||| C D E B B ||| -236.045
-0 ||| D A D E B ||| -236.045
-0 ||| C E E A B ||| -236.045
-0 ||| C E C B B ||| -236.045
-0 ||| D D D C B ||| -236.045
-0 ||| D C A D D ||| -236.045
-0 ||| E E C A B ||| -236.045
-0 ||| E C B D B ||| -236.045
-0 ||| E B E B B ||| -236.045
-0 ||| B E D B B ||| -236.045
-0 ||| D E A D B ||| -236.045
-0 ||| B A E E B ||| -236.045
-0 ||| D A B D D ||| -236.045
-0 ||| B D A D D ||| -236.045
-0 ||| B A C D D ||| -236.045
-0 ||| B B D C D ||| -236.045
-0 ||| B A B E D ||| -236.045
-0 ||| B C D B D ||| -236.045
-0 ||| E D E A B ||| -236.045
-0 ||| B B E D B ||| -236.045
-0 ||| B A E C D ||| -236.045
-0 ||| B D B C D ||| -236.045
-0 ||| E B B B D ||| -236.045
-0 ||| E D A B D ||| -236.045
-0 ||| E B C E A ||| -236.045
-0 ||| E C C A D ||| -236.045
-0 ||| E A C B D ||| -236.045
-0 ||| D C E D A ||| -236.045
-0 ||| B C A E D ||| -236.045
-0 ||| C E A B D ||| -236.045
-0 ||| B D D E A ||| -236.045
-0 ||| D E B C B ||| -236.045
-0 ||| D B C B D ||| -236.045
-0 ||| C D C E A ||| -236.045
-0 ||| E A E A D ||| -236.045
-0 ||| E C D C B ||| -236.045
-0 ||| D A D C D ||| -236.045
-0 ||| D C D E A ||| -236.045
-0 ||| D D D D A ||| -236.045
-0 ||| C E E B A ||| -236.045
-0 ||| E C D D A ||| -236.045
-0 ||| B E E C A ||| -236.045
-0 ||| B C E E A ||| -236.045
-0 ||| E E C B A ||| -236.045
-0 ||| B E C D A ||| -236.045
-0 ||| D E B D A ||| -236.045
-0 ||| B E B E A ||| -236.045
-0 ||| E E E A A ||| -236.045
-0 ||| D E D C A ||| -236.045
-0 ||| C B E E A ||| -236.045
-0 ||| E D E B A ||| -236.045
-0 ||| B D E D A ||| -236.045
-0 ||| A C D D C ||| -237.045
-0 ||| A B C E C ||| -237.045
-0 ||| A C D A E ||| -237.045
-0 ||| A E C A D ||| -237.045
-0 ||| A E D D A ||| -237.045
-0 ||| A B E B D ||| -237.045
-0 ||| A C D E B ||| -237.045
-0 ||| A C B D D ||| -237.045
-0 ||| A E C B C ||| -237.045
-0 ||| A D A C E ||| -237.045
-0 ||| A E E A C ||| -237.045
-0 ||| A D D D B ||| -237.045
-0 ||| A B A D E ||| -237.045
-0 ||| A D E A D ||| -237.045
-0 ||| A C B B E ||| -237.045
-0 ||| A A D D D ||| -237.045
-0 ||| A A A E E ||| -237.045
-0 ||| A E D C B ||| -237.045
-0 ||| A A C C E ||| -237.045
-0 ||| A B B C E ||| -237.045
-0 ||| A E B D B ||| -237.045
-0 ||| A C E D B ||| -237.045
-0 ||| A A D B E ||| -237.045
-0 ||| A D C B D ||| -237.045
-0 ||| A C D C D ||| -237.045
-0 ||| A D E B C ||| -237.045
-0 ||| C B D E B ||| -238.045
-0 ||| C E C C B ||| -238.045
-0 ||| B C E D B ||| -238.045
-0 ||| B E D C B ||| -238.045
-0 ||| E C D A D ||| -238.045
-0 ||| B C B D D ||| -238.045
-0 ||| C A B E D ||| -238.045
-0 ||| C C B E C ||| -238.045
-0 ||| D E C B B ||| -238.045
-0 ||| D C E A D ||| -238.045
-0 ||| C A E C D ||| -238.045
-0 ||| E B A D D ||| -238.045
-0 ||| E C B B D ||| -238.045
-0 ||| C D B C D ||| -238.045
-0 ||| C E A A E ||| -238.045
-0 ||| D B B E C ||| -238.045
-0 ||| E D A C D ||| -238.045
-0 ||| B E C A D ||| -238.045
-0 ||| C C E C C ||| -238.045
-0 ||| D A E B D ||| -238.045
-0 ||| E B A B E ||| -238.045
-0 ||| B B E B D ||| -238.045
-0 ||| C B D C D ||| -238.045
-0 ||| E A A E D ||| -238.045
-0 ||| D B D B D ||| -238.045
-0 ||| C D B D C ||| -238.045
-0 ||| B A D B E ||| -238.045
-0 ||| C C A E D ||| -238.045
-0 ||| C D A D D ||| -238.045
-0 ||| E B B C D ||| -238.045
-0 ||| B D E A D ||| -238.045
-0 ||| D D D A D ||| -238.045
-0 ||| E A C C D ||| -238.045
-0 ||| B C D C D ||| -238.045
-0 ||| C E A C D ||| -238.045
-0 ||| D D B B D ||| -238.045
-0 ||| C A C D D ||| -238.045
-0 ||| E C A E C ||| -238.045
-0 ||| B E C B C ||| -238.045
-0 ||| D B A E D ||| -238.045
-0 ||| D E B A D ||| -238.045
-0 ||| D B C C D ||| -238.045
-0 ||| D E D A C ||| -238.045
-0 ||| E B B D C ||| -238.045
-0 ||| B B B C E ||| -238.045
-0 ||| E C D B C ||| -238.045
-0 ||| B E E A C ||| -238.045
-0 ||| E A B E C ||| -238.045
-0 ||| C B B D D ||| -238.045
-0 ||| E D C C B ||| -238.045
-0 ||| C A E D C ||| -238.045
-0 ||| B A D D D ||| -238.045
-0 ||| E A E C C ||| -238.045
-0 ||| E D A E B ||| -238.045
-0 ||| C B D A E ||| -238.045
-0 ||| C E B C C ||| -238.045
-0 ||| C D B A E ||| -238.045
-0 ||| E A C D C ||| -238.045
-0 ||| C C C C D ||| -238.045
-0 ||| B D C B D ||| -238.045
-0 ||| D A C E C ||| -238.045
-0 ||| D C C B D ||| -238.045
-0 ||| C C D B D ||| -238.045
-0 ||| E E D A B ||| -238.045
-0 ||| D A B C E ||| -238.045
-0 ||| C E A E B ||| -238.045
-0 ||| C C C D C ||| -238.045
-0 ||| E B E C B ||| -238.045
-0 ||| E E B B B ||| -238.045
-0 ||| D E E A B ||| -238.045
-0 ||| E E A C C ||| -238.045
-0 ||| C A E E B ||| -238.045
-0 ||| C A C B E ||| -238.045
-0 ||| C A D E C ||| -238.045
-0 ||| E C C C C ||| -238.045
-0 ||| D C A C E ||| -238.045
-0 ||| D B E C C ||| -238.045
-0 ||| D D D B C ||| -238.045
-0 ||| C B D D C ||| -238.045
-0 ||| E B D C C ||| -238.045
-0 ||| B D E B C ||| -238.045
-0 ||| E D B C C ||| -238.045
-0 ||| D D E B B ||| -238.045
-0 ||| B C D D C ||| -238.045
-0 ||| C C C E B ||| -238.045
-0 ||| B E B D B ||| -238.045
-0 ||| D B C D C ||| -238.045
-0 ||| D D C C C ||| -238.045
-0 ||| C D C D B ||| -238.045
-0 ||| D D A E C ||| -238.045
-0 ||| D C D D B ||| -238.045
-0 ||| C D E C B ||| -238.045
-0 ||| B C D A E ||| -238.045
-0 ||| C E A D C ||| -238.045
-0 ||| C E D B B ||| -238.045
-0 ||| E D A D C ||| -238.045
-0 ||| C B E D B ||| -238.045
-0 ||| D C E B C ||| -238.045
-0 ||| E A C A E ||| -238.045
-0 ||| C D D C C ||| -238.045
-0 ||| B B A D E ||| -238.045
-0 ||| E C E B B ||| -238.045
-0 ||| B A C C E ||| -238.045
-0 ||| D A A D E ||| -238.045
-0 ||| B C D E B ||| -238.045
-0 ||| E B B A E ||| -238.045
-0 ||| D E B B C ||| -238.045
-0 ||| C D B E B ||| -238.045
-0 ||| E B B E B ||| -238.045
-0 ||| B D D D B ||| -238.045
-0 ||| E A C E B ||| -238.045
-0 ||| D B C E B ||| -238.045
-0 ||| E B C D B ||| -238.045
-0 ||| E A D B D ||| -238.045
-0 ||| D E A B D ||| -238.045
-0 ||| E D D B B ||| -238.045
-0 ||| B D A C E ||| -238.045
-0 ||| D B E E A ||| -238.045
-0 ||| B B C E C ||| -238.045
-0 ||| C B B B E ||| -238.045
-0 ||| E B D E A ||| -238.045
-0 ||| B C B B E ||| -238.045
-0 ||| C C C A E ||| -238.045
-0 ||| E D B E A ||| -238.045
-0 ||| B A A E E ||| -238.045
-0 ||| D B C A E ||| -238.045
-0 ||| E D C D A ||| -238.045
-0 ||| E D A A E ||| -238.045
-0 ||| C A E A E ||| -238.045
-0 ||| E B E D A ||| -238.045
-0 ||| C D A B E ||| -238.045
-0 ||| C C E E A ||| -238.045
-0 ||| C E C D A ||| -238.045
-0 ||| C E B E A ||| -238.045
-0 ||| C D E D A ||| -238.045
-0 ||| E E D B A ||| -238.045
-0 ||| E E A E A ||| -238.045
-0 ||| D D C E A ||| -238.045
-0 ||| C E E C A ||| -238.045
-0 ||| E A E E A ||| -238.045
-0 ||| E E C C A ||| -238.045
-0 ||| E D E C A ||| -238.045
-0 ||| E C C E A ||| -238.045
-0 ||| D E E B A ||| -238.045
-0 ||| B E D D A ||| -238.045
-0 ||| C D D E A ||| -238.045
-0 ||| A A D C E ||| -239.045
-0 ||| A E B B D ||| -239.045
-0 ||| A B E C D ||| -239.045
-0 ||| A A B D E ||| -239.045
-0 ||| A D C E B ||| -239.045
-0 ||| A A E E C ||| -239.045
-0 ||| A B C B E ||| -239.045
-0 ||| A D C C D ||| -239.045
-0 ||| A B D E C ||| -239.045
-0 ||| A C E B D ||| -239.045
-0 ||| A B B E D ||| -239.045
-0 ||| A A C E D ||| -239.045
-0 ||| A E E B B ||| -239.045
-0 ||| A B E E B ||| -239.045
-0 ||| A D A E D ||| -239.045
-0 ||| A B E D C ||| -239.045
-0 ||| A E D A D ||| -239.045
-0 ||| A B C D D ||| -239.045
-0 ||| A D E E A ||| -239.045
-0 ||| A D E C C ||| -239.045
-0 ||| A E D B C ||| -239.045
-0 ||| A D C D C ||| -239.045
-0 ||| A E C C C ||| -239.045
-0 ||| A E C E A ||| -239.045
-0 ||| A E A E C ||| -239.045
-0 ||| A C B C E ||| -239.045
-0 ||| A D D B D ||| -239.045
-0 ||| A D B E C ||| -239.045
-0 ||| A B E A E ||| -239.045
-0 ||| A D C A E ||| -239.045
-0 ||| A C A D E ||| -239.045
-0 ||| A C C E C ||| -239.045
-0 ||| B E E B B ||| -240.045
-0 ||| B D C A E ||| -240.045
-0 ||| D E A C D ||| -240.045
-0 ||| E A D E B ||| -240.045
-0 ||| D D E C B ||| -240.045
-0 ||| D B D E B ||| -240.045
-0 ||| C A A E E ||| -240.045
-0 ||| D C C D C ||| -240.045
-0 ||| B D E C C ||| -240.045
-0 ||| B E A E C ||| -240.045
-0 ||| D C E C C ||| -240.045
-0 ||| E C E C B ||| -240.045
-0 ||| B B D E C ||| -240.045
-0 ||| D B D D C ||| -240.045
-0 ||| D D B D C ||| -240.045
-0 ||| C B B C E ||| -240.045
-0 ||| B B B E D ||| -240.045
-0 ||| D A E D C ||| -240.045
-0 ||| B A D C E ||| -240.045
-0 ||| B B C D D ||| -240.045
-0 ||| C B A D E ||| -240.045
-0 ||| B B C B E ||| -240.045
-0 ||| B C A D E ||| -240.045
-0 ||| E A D D C ||| -240.045
-0 ||| B D C C D ||| -240.045
-0 ||| D D B A E ||| -240.045
-0 ||| D C C A E ||| -240.045
-0 ||| E C A B E ||| -240.045
-0 ||| D C D B D ||| -240.045
-0 ||| E B C B D ||| -240.045
-0 ||| C E C A D ||| -240.045
-0 ||| B D A E D ||| -240.045
-0 ||| E A B B E ||| -240.045
-0 ||| B A B D E ||| -240.045
-0 ||| C C D C D ||| -240.045
-0 ||| C C D A E ||| -240.045
-0 ||| D C C C D ||| -240.045
-0 ||| E C A D D ||| -240.045
-0 ||| C B E B D ||| -240.045
-0 ||| D A E C D ||| -240.045
-0 ||| C A C C E ||| -240.045
-0 ||| B B E C D ||| -240.045
-0 ||| C D C B D ||| -240.045
-0 ||| E C B C D ||| -240.045
-0 ||| D D A D D ||| -240.045
-0 ||| D B B B E ||| -240.045
-0 ||| E A D C D ||| -240.045
-0 ||| B D D B D ||| -240.045
-0 ||| D B D A E ||| -240.045
-0 ||| D D C D B ||| -240.045
-0 ||| C D A C E ||| -240.045
-0 ||| B E B B D ||| -240.045
-0 ||| E C C D B ||| -240.045
-0 ||| B C C E C ||| -240.045
-0 ||| B E D A D ||| -240.045
-0 ||| E A B D D ||| -240.045
-0 ||| D B D C D ||| -240.045
-0 ||| E C B A E ||| -240.045
-0 ||| D B B D D ||| -240.045
-0 ||| D C A E D ||| -240.045
-0 ||| C D E A D ||| -240.045
-0 ||| B C E B D ||| -240.045
-0 ||| D A B E D ||| -240.045
-0 ||| D E A A E ||| -240.045
-0 ||| B C B C E ||| -240.045
-0 ||| B A C E D ||| -240.045
-0 ||| B B E A E ||| -240.045
-0 ||| E A D A E ||| -240.045
-0 ||| D D B C D ||| -240.045
-0 ||| E C B E B ||| -240.045
-0 ||| E E A D B ||| -240.045
-0 ||| C C B B E ||| -240.045
-0 ||| D C B E C ||| -240.045
-0 ||| D A D E C ||| -240.045
-0 ||| E C D C C ||| -240.045
-0 ||| C C E D B ||| -240.045
-0 ||| D A E A E ||| -240.045
-0 ||| E D C A D ||| -240.045
-0 ||| E D D C B ||| -240.045
-0 ||| C C D E B ||| -240.045
-0 ||| C A D D D ||| -240.045
-0 ||| E E B C B ||| -240.045
-0 ||| E A E D B ||| -240.045
-0 ||| D B E D B ||| -240.045
-0 ||| C E B D B ||| -240.045
-0 ||| E D B D B ||| -240.045
-0 ||| C D E B C ||| -240.045
-0 ||| E B D D B ||| -240.045
-0 ||| C C D D C ||| -240.045
-0 ||| B D B E C ||| -240.045
-0 ||| E D C B C ||| -240.045
-0 ||| B E C C C ||| -240.045
-0 ||| B D C D C ||| -240.045
-0 ||| C B C E C ||| -240.045
-0 ||| B B E D C ||| -240.045
-0 ||| D E A D C ||| -240.045
-0 ||| D E D B B ||| -240.045
-0 ||| D D A B E ||| -240.045
-0 ||| C D D D B ||| -240.045
-0 ||| E E C A C ||| -240.045
-0 ||| C E C B C ||| -240.045
-0 ||| C E E A C ||| -240.045
-0 ||| D D D C C ||| -240.045
-0 ||| C C B D D ||| -240.045
-0 ||| D C C E B ||| -240.045
-0 ||| D A C D D ||| -240.045
-0 ||| E B E A D ||| -240.045
-0 ||| E B E B C ||| -240.045
-0 ||| E C B D C ||| -240.045
-0 ||| D E A E B ||| -240.045
-0 ||| B D C E B ||| -240.045
-0 ||| B A E E C ||| -240.045
-0 ||| B E D B C ||| -240.045
-0 ||| D E B C C ||| -240.045
-0 ||| B B E E B ||| -240.045
-0 ||| D D B E B ||| -240.045
-0 ||| B D E E A ||| -240.045
-0 ||| D E C C B ||| -240.045
-0 ||| E D E A C ||| -240.045
-0 ||| E E B D A ||| -240.045
-0 ||| E B A C E ||| -240.045
-0 ||| C E D C B ||| -240.045
-0 ||| D E E C A ||| -240.045
-0 ||| D A C B E ||| -240.045
-0 ||| D A E E B ||| -240.045
-0 ||| D D E D A ||| -240.045
-0 ||| C A D B E ||| -240.045
-0 ||| D C E E A ||| -240.045
-0 ||| E C D E A ||| -240.045
-0 ||| E D D D A ||| -240.045
-0 ||| E E D C A ||| -240.045
-0 ||| D D D E A ||| -240.045
-0 ||| E C E D A ||| -240.045
-0 ||| B E C E A ||| -240.045
-0 ||| D E B E A ||| -240.045
-0 ||| C E D D A ||| -240.045
-0 ||| D E C D A ||| -240.045
-0 ||| A C E A E ||| -241.045
-0 ||| A C E C D ||| -241.045
-0 ||| A E E D A ||| -241.045
-0 ||| A A D E D ||| -241.045
-0 ||| A D E D B ||| -241.045
-0 ||| A C E E B ||| -241.045
-0 ||| A D D E B ||| -241.045
-0 ||| A C C D D ||| -241.045
-0 ||| A D D A E ||| -241.045
-0 ||| A D D C D ||| -241.045
-0 ||| A E D E A ||| -241.045
-0 ||| A E A B E ||| -241.045
-0 ||| A E C D B ||| -241.045
-0 ||| A C C B E ||| -241.045
-0 ||| A D B D D ||| -241.045
-0 ||| A A E B E ||| -241.045
-0 ||| A D B B E ||| -241.045
-0 ||| A B C C E ||| -241.045
-0 ||| A E D C C ||| -241.045
-0 ||| A C D E C ||| -241.045
-0 ||| A B D B E ||| -241.045
-0 ||| A E A D D ||| -241.045
-0 ||| A C B E D ||| -241.045
-0 ||| A E B C D ||| -241.045
-0 ||| A B D D D ||| -241.045
-0 ||| A B A E E ||| -241.045
-0 ||| A C E D C ||| -241.045
-0 ||| A E B E B ||| -241.045
-0 ||| A E B D C ||| -241.045
-0 ||| A E E C B ||| -241.045
-0 ||| A D D D C ||| -241.045
-0 ||| A E B A E ||| -241.045
-0 ||| A A E D D ||| -241.045
-0 ||| B C E C D ||| -242.045
-0 ||| D E C B C ||| -242.045
-0 ||| D D D D B ||| -242.045
-0 ||| B C E D C ||| -242.045
-0 ||| B D B D D ||| -242.045
-0 ||| C E C C C ||| -242.045
-0 ||| C B D E C ||| -242.045
-0 ||| B E D C C ||| -242.045
-0 ||| E D C C C ||| -242.045
-0 ||| C A C E D ||| -242.045
-0 ||| C B E E B ||| -242.045
-0 ||| B D E D B ||| -242.045
-0 ||| D A D D D ||| -242.045
-0 ||| E B A E D ||| -242.045
-0 ||| E D B B D ||| -242.045
-0 ||| E A A D E ||| -242.045
-0 ||| C C A D E ||| -242.045
-0 ||| B A D E D ||| -242.045
-0 ||| C B C B E ||| -242.045
-0 ||| B E A B E ||| -242.045
-0 ||| C E B B D ||| -242.045
-0 ||| D C D A E ||| -242.045
-0 ||| D A C C E ||| -242.045
-0 ||| E D A E C ||| -242.045
-0 ||| E B B E C ||| -242.045
-0 ||| D C D E B ||| -242.045
-0 ||| D C B B E ||| -242.045
-0 ||| C D A E D ||| -242.045
-0 ||| B C B E D ||| -242.045
-0 ||| C A D C E ||| -242.045
-0 ||| E C C B D ||| -242.045
-0 ||| B C D E C ||| -242.045
-0 ||| C C E B D ||| -242.045
-0 ||| C D D B D ||| -242.045
-0 ||| E C E A D ||| -242.045
-0 ||| E B C C D ||| -242.045
-0 ||| D D C B D ||| -242.045
-0 ||| D C D C D ||| -242.045
-0 ||| C D C C D ||| -242.045
-0 ||| E D E B B ||| -242.045
-0 ||| E B D B D ||| -242.045
-0 ||| C B B E D ||| -242.045
-0 ||| D B E B D ||| -242.045
-0 ||| B E C D B ||| -242.045
-0 ||| B D B B E ||| -242.045
-0 ||| C B C D D ||| -242.045
-0 ||| D D E A D ||| -242.045
-0 ||| E E A B D ||| -242.045
-0 ||| C B E C D ||| -242.045
-0 ||| E E B A D ||| -242.045
-0 ||| D C B D D ||| -242.045
-0 ||| B B D D D ||| -242.045
-0 ||| C E D A D ||| -242.045
-0 ||| B E B A E ||| -242.045
-0 ||| B D D C D ||| -242.045
-0 ||| B B C C E ||| -242.045
-0 ||| E E D A C ||| -242.045
-0 ||| B E A D D ||| -242.045
-0 ||| D E C A D ||| -242.045
-0 ||| E C A C E ||| -242.045
-0 ||| B E B C D ||| -242.045
-0 ||| D E B D B ||| -242.045
-0 ||| D D A C E ||| -242.045
-0 ||| B A E D D ||| -242.045
-0 ||| B C C D D ||| -242.045
-0 ||| E D D A D ||| -242.045
-0 ||| C E A E C ||| -242.045
-0 ||| C D C A E ||| -242.045
-0 ||| D A A E E ||| -242.045
-0 ||| C B E A E ||| -242.045
-0 ||| C D C E B ||| -242.045
-0 ||| E E B B C ||| -242.045
-0 ||| E B E C C ||| -242.045
-0 ||| B A E B E ||| -242.045
-0 ||| D B B C E ||| -242.045
-0 ||| D B A D E ||| -242.045
-0 ||| B D D A E ||| -242.045
-0 ||| E B C A E ||| -242.045
-0 ||| C A E E C ||| -242.045
-0 ||| C E E B B ||| -242.045
-0 ||| D E E A C ||| -242.045
-0 ||| B B D B E ||| -242.045
-0 ||| B C E A E ||| -242.045
-0 ||| E B C D C ||| -242.045
-0 ||| E E C B B ||| -242.045
-0 ||| C C B C E ||| -242.045
-0 ||| D D E B C ||| -242.045
-0 ||| D C E D B ||| -242.045
-0 ||| B E B D C ||| -242.045
-0 ||| E B C E B ||| -242.045
-0 ||| C C C E C ||| -242.045
-0 ||| D E D C B ||| -242.045
-0 ||| E C D D B ||| -242.045
-0 ||| C D C D C ||| -242.045
-0 ||| B C E E B ||| -242.045
-0 ||| C D E C C ||| -242.045
-0 ||| D C D D C ||| -242.045
-0 ||| B C C B E ||| -242.045
-0 ||| B E E C B ||| -242.045
-0 ||| C E D B C ||| -242.045
-0 ||| C B E D C ||| -242.045
-0 ||| E A E B D ||| -242.045
-0 ||| E A C E C ||| -242.045
-0 ||| E A B C E ||| -242.045
-0 ||| C D B E C ||| -242.045
-0 ||| B B A E E ||| -242.045
-0 ||| D B C E C ||| -242.045
-0 ||| E C E B C ||| -242.045
-0 ||| B E B E B ||| -242.045
-0 ||| D E D D A ||| -242.045
-0 ||| B D D D C ||| -242.045
-0 ||| E D D B C ||| -242.045
-0 ||| B E D E A ||| -242.045
-0 ||| E E E A B ||| -242.045
-0 ||| C A B D E ||| -242.045
-0 ||| B E E D A ||| -242.045
-0 ||| D A D B E ||| -242.045
-0 ||| B D D E B ||| -242.045
-0 ||| E D C E A ||| -242.045
-0 ||| C E C E A ||| -242.045
-0 ||| C D E E A ||| -242.045
-0 ||| E E E B A ||| -242.045
-0 ||| E B E E A ||| -242.045
-0 ||| A E A C E ||| -243.045
-0 ||| A B D C E ||| -243.045
-0 ||| A C D B E ||| -243.045
-0 ||| A D A D E ||| -243.045
-0 ||| A E C B D ||| -243.045
-0 ||| A C C C E ||| -243.045
-0 ||| A D B C E ||| -243.045
-0 ||| A E D D B ||| -243.045
-0 ||| A C A E E ||| -243.045
-0 ||| A A C D E ||| -243.045
-0 ||| A D E B D ||| -243.045
-0 ||| A B C E D ||| -243.045
-0 ||| A B B D E ||| -243.045
-0 ||| A C D D D ||| -243.045
-0 ||| A D C E C ||| -243.045
-0 ||| A E E B C ||| -243.045
-0 ||| A B E E C ||| -243.045
-0 ||| A A E C E ||| -243.045
-0 ||| A A B E E ||| -243.045
-0 ||| A E E A D ||| -243.045
-0 ||| D E C C C ||| -244.045
-0 ||| C C E A E ||| -244.045
-0 ||| D D E C C ||| -244.045
-0 ||| E B D C D ||| -244.045
-0 ||| C E B E B ||| -244.045
-0 ||| C C E E B ||| -244.045
-0 ||| D A D C E ||| -244.045
-0 ||| E E A D C ||| -244.045
-0 ||| C C B E D ||| -244.045
-0 ||| D E D B C ||| -244.045
-0 ||| E A D E C ||| -244.045
-0 ||| C E E C B ||| -244.045
-0 ||| D B D E C ||| -244.045
-0 ||| E C D B D ||| -244.045
-0 ||| C B D B E ||| -244.045
-0 ||| C C E C D ||| -244.045
-0 ||| D B B E D ||| -244.045
-0 ||| D C B C E ||| -244.045
-0 ||| C D B D D ||| -244.045
-0 ||| E B E D B ||| -244.045
-0 ||| E C E C C ||| -244.045
-0 ||| D E D A D ||| -244.045
-0 ||| E E A A E ||| -244.045
-0 ||| E C A E D ||| -244.045
-0 ||| B E C B D ||| -244.045
-0 ||| E B B D D ||| -244.045
-0 ||| C D D E B ||| -244.045
-0 ||| E E C C B ||| -244.045
-0 ||| E C C E B ||| -244.045
-0 ||| D E E B B ||| -244.045
-0 ||| E A E E B ||| -244.045
-0 ||| E E D B B ||| -244.045
-0 ||| C D E D B ||| -244.045
-0 ||| B B D C E ||| -244.045
-0 ||| D A B D E ||| -244.045
-0 ||| B A E C E ||| -244.045
-0 ||| D D C D C ||| -244.045
-0 ||| E A B E D ||| -244.045
-0 ||| C B D D D ||| -244.045
-0 ||| C E C D B ||| -244.045
-0 ||| E C B E C ||| -244.045
-0 ||| B C C C E ||| -244.045
-0 ||| B E E A D ||| -244.045
-0 ||| C B C C E ||| -244.045
-0 ||| E A E C D ||| -244.045
-0 ||| E D B E B ||| -244.045
-0 ||| C A E D D ||| -244.045
-0 ||| E C C D C ||| -244.045
-0 ||| C A E B E ||| -244.045
-0 ||| C B A E E ||| -244.045
-0 ||| C A D E D ||| -244.045
-0 ||| B B B D E ||| -244.045
-0 ||| C E B C D ||| -244.045
-0 ||| E E A C D ||| -244.045
-0 ||| E A C D D ||| -244.045
-0 ||| C D D A E ||| -244.045
-0 ||| C C C B E ||| -244.045
-0 ||| D D D B D ||| -244.045
-0 ||| C E A D D ||| -244.045
-0 ||| C E B D C ||| -244.045
-0 ||| C D B B E ||| -244.045
-0 ||| E B D A E ||| -244.045
-0 ||| D B E A E ||| -244.045
-0 ||| D A C E D ||| -244.045
-0 ||| C E B A E ||| -244.045
-0 ||| D D A E D ||| -244.045
-0 ||| B E A C E ||| -244.045
-0 ||| D B E C D ||| -244.045
-0 ||| D D C A E ||| -244.045
-0 ||| E D D C C ||| -244.045
-0 ||| E D B A E ||| -244.045
-0 ||| C C C D D ||| -244.045
-0 ||| E D A D D ||| -244.045
-0 ||| D C E B D ||| -244.045
-0 ||| D B E D C ||| -244.045
-0 ||| E A E D C ||| -244.045
-0 ||| E C C C D ||| -244.045
-0 ||| B C D B E ||| -244.045
-0 ||| D B C D D ||| -244.045
-0 ||| E D B C D ||| -244.045
-0 ||| D E B B D ||| -244.045
-0 ||| D D C C D ||| -244.045
-0 ||| E B D E B ||| -244.045
-0 ||| B D E B D ||| -244.045
-0 ||| C D D C D ||| -244.045
-0 ||| B A B E E ||| -244.045
-0 ||| E A C B E ||| -244.045
-0 ||| B A C D E ||| -244.045
-0 ||| D C A D E ||| -244.045
-0 ||| B C D D D ||| -244.045
-0 ||| C C E D C ||| -244.045
-0 ||| D E A E C ||| -244.045
-0 ||| C C D E C ||| -244.045
-0 ||| D B E E B ||| -244.045
-0 ||| D E C E A ||| -244.045
-0 ||| E B D D C ||| -244.045
-0 ||| E D E D A ||| -244.045
-0 ||| E D B D C ||| -244.045
-0 ||| D D E E A ||| -244.045
-0 ||| D A E E C ||| -244.045
-0 ||| E E B E A ||| -244.045
-0 ||| B D A D E ||| -244.045
-0 ||| E D D E A ||| -244.045
-0 ||| E D C D B ||| -244.045
-0 ||| E E C D A ||| -244.045
-0 ||| C D D D C ||| -244.045
-0 ||| C E E D A ||| -244.045
-0 ||| D D C E B ||| -244.045
-0 ||| C E D E A ||| -244.045
-0 ||| E E A E B ||| -244.045
-0 ||| E E E C A ||| -244.045
-0 ||| E E B C C ||| -244.045
-0 ||| E C E E A ||| -244.045
-0 ||| E D E C B ||| -244.045
-0 ||| B E D D B ||| -244.045
-0 ||| D C C E C ||| -244.045
-0 ||| D D B E C ||| -244.045
-0 ||| B E E B C ||| -244.045
-0 ||| B D C E C ||| -244.045
-0 ||| B B E E C ||| -244.045
-0 ||| E A E A E ||| -244.045
-0 ||| E D A B E ||| -244.045
-0 ||| E C C A E ||| -244.045
-0 ||| E B B B E ||| -244.045
-0 ||| B D B C E ||| -244.045
-0 ||| C E D C C ||| -244.045
-0 ||| D B C B E ||| -244.045
-0 ||| B C A E E ||| -244.045
-0 ||| B B C E D ||| -244.045
-0 ||| C E A B E ||| -244.045
-0 ||| A A E E D ||| -245.045
-0 ||| A E C A E ||| -245.045
-0 ||| A D D E C ||| -245.045
-0 ||| A C B D E ||| -245.045
-0 ||| A B D E D ||| -245.045
-0 ||| A A D D E ||| -245.045
-0 ||| A C D C E ||| -245.045
-0 ||| A C C E D ||| -245.045
-0 ||| A B E B E ||| -245.045
-0 ||| A D C B E ||| -245.045
-0 ||| A C E E C ||| -245.045
-0 ||| A D E D C ||| -245.045
-0 ||| A E C D C ||| -245.045
-0 ||| A E E E A ||| -245.045
-0 ||| A E E C C ||| -245.045
-0 ||| A B E D D ||| -245.045
-0 ||| A E C E B ||| -245.045
-0 ||| A E D B D ||| -245.045
-0 ||| A D E A E ||| -245.045
-0 ||| A D E C D ||| -245.045
-0 ||| A D B E D ||| -245.045
-0 ||| A E C C D ||| -245.045
-0 ||| A D C D D ||| -245.045
-0 ||| A E B E C ||| -245.045
-0 ||| A E A E D ||| -245.045
-0 ||| A D E E B ||| -245.045
-0 ||| E D D D B ||| -246.045
-0 ||| B D D E C ||| -246.045
-0 ||| E C D E B ||| -246.045
-0 ||| E E C B C ||| -246.045
-0 ||| D C B E D ||| -246.045
-0 ||| D D D D C ||| -246.045
-0 ||| B E A E D ||| -246.045
-0 ||| C E D D B ||| -246.045
-0 ||| C A B E E ||| -246.045
-0 ||| B C B D E ||| -246.045
-0 ||| E C D A E ||| -246.045
-0 ||| C A E C E ||| -246.045
-0 ||| D C E A E ||| -246.045
-0 ||| E B B C E ||| -246.045
-0 ||| C D B C E ||| -246.045
-0 ||| E B A D E ||| -246.045
-0 ||| E C B B E ||| -246.045
-0 ||| D C E E B ||| -246.045
-0 ||| E D A C E ||| -246.045
-0 ||| B E C A E ||| -246.045
-0 ||| C B D C E ||| -246.045
-0 ||| B D E A E ||| -246.045
-0 ||| D A E B E ||| -246.045
-0 ||| B B E B E ||| -246.045
-0 ||| C D A D E ||| -246.045
-0 ||| E A A E E ||| -246.045
-0 ||| C C A E E ||| -246.045
-0 ||| B D E C D ||| -246.045
-0 ||| D B D B E ||| -246.045
-0 ||| D C C D D ||| -246.045
-0 ||| C B E E C ||| -246.045
-0 ||| D A E D D ||| -246.045
-0 ||| C E A C E ||| -246.045
-0 ||| C E E B C ||| -246.045
-0 ||| D D D A E ||| -246.045
-0 ||| D C E C D ||| -246.045
-0 ||| B C D C E ||| -246.045
-0 ||| E A C C E ||| -246.045
-0 ||| D D B D D ||| -246.045
-0 ||| D B C C E ||| -246.045
-0 ||| D D B B E ||| -246.045
-0 ||| D B D D D ||| -246.045
-0 ||| B B D E D ||| -246.045
-0 ||| B D E D C ||| -246.045
-0 ||| C A C D E ||| -246.045
-0 ||| D B A E E ||| -246.045
-0 ||| D E B A E ||| -246.045
-0 ||| B B E D D ||| -246.045
-0 ||| E A D D D ||| -246.045
-0 ||| C C D D D ||| -246.045
-0 ||| D E A D D ||| -246.045
-0 ||| E C E D B ||| -246.045
-0 ||| D E B E B ||| -246.045
-0 ||| C B B D E ||| -246.045
-0 ||| B A D D E ||| -246.045
-0 ||| B C C E D ||| -246.045
-0 ||| D C D E C ||| -246.045
-0 ||| D D D E B ||| -246.045
-0 ||| C C C C E ||| -246.045
-0 ||| E D C B D ||| -246.045
-0 ||| E E D C B ||| -246.045
-0 ||| D D E D B ||| -246.045
-0 ||| B D C B E ||| -246.045
-0 ||| B E C E B ||| -246.045
-0 ||| D C E D C ||| -246.045
-0 ||| C E E A D ||| -246.045
-0 ||| B E C D C ||| -246.045
-0 ||| E D E B C ||| -246.045
-0 ||| D E D E A ||| -246.045
-0 ||| B E C C D ||| -246.045
-0 ||| C C D B E ||| -246.045
-0 ||| C D E B D ||| -246.045
-0 ||| D E E D A ||| -246.045
-0 ||| C D C E C ||| -246.045
-0 ||| D C C B E ||| -246.045
-0 ||| B E E E A ||| -246.045
-0 ||| D A D E D ||| -246.045
-0 ||| E E D D A ||| -246.045
-0 ||| B D E E B ||| -246.045
-0 ||| B D B E D ||| -246.045
-0 ||| E C D C D ||| -246.045
-0 ||| B E E C C ||| -246.045
-0 ||| E B C E C ||| -246.045
-0 ||| E C D D C ||| -246.045
-0 ||| D E D C C ||| -246.045
-0 ||| B C E E C ||| -246.045
-0 ||| E C B D D ||| -246.045
-0 ||| C B C E D ||| -246.045
-0 ||| E B E B D ||| -246.045
-0 ||| D D D C D ||| -246.045
-0 ||| B A E E D ||| -246.045
-0 ||| B E B E C ||| -246.045
-0 ||| B E D B D ||| -246.045
-0 ||| D E B C D ||| -246.045
-0 ||| E A D B E ||| -246.045
-0 ||| D E A B E ||| -246.045
-0 ||| D E E C B ||| -246.045
-0 ||| E E C A D ||| -246.045
-0 ||| E E E A C ||| -246.045
-0 ||| D E B D C ||| -246.045
-0 ||| B D C D D ||| -246.045
-0 ||| E E B D B ||| -246.045
-0 ||| C E C B D ||| -246.045
-0 ||| E D E A D ||| -246.045
-0 ||| D E C D B ||| -246.045
-0 ||| A C E B E ||| -247.045
-0 ||| A E B B E ||| -247.045
-0 ||| A B E C E ||| -247.045
-0 ||| A D C C E ||| -247.045
-0 ||| A B B E E ||| -247.045
-0 ||| A D D D D ||| -247.045
-0 ||| A E D D C ||| -247.045
-0 ||| A E D E B ||| -247.045
-0 ||| A E E D B ||| -247.045
-0 ||| A D A E E ||| -247.045
-0 ||| A E D A E ||| -247.045
-0 ||| A B C D E ||| -247.045
-0 ||| A A C E E ||| -247.045
-0 ||| A E B D D ||| -247.045
-0 ||| A C D E D ||| -247.045
-0 ||| A E D C D ||| -247.045
-0 ||| A D D B E ||| -247.045
-0 ||| A C E D D ||| -247.045
-0 ||| B C D E D ||| -248.045
-0 ||| B C E D D ||| -248.045
-0 ||| C D E D C ||| -248.045
-0 ||| B E D C D ||| -248.045
-0 ||| C C E E C ||| -248.045
-0 ||| D D E B D ||| -248.045
-0 ||| C E B E C ||| -248.045
-0 ||| D E C B D ||| -248.045
-0 ||| D E A C E ||| -248.045
-0 ||| C B D E D ||| -248.045
-0 ||| B B E C E ||| -248.045
-0 ||| C E C C D ||| -248.045
-0 ||| C E E C C ||| -248.045
-0 ||| E E D B C ||| -248.045
-0 ||| E B E D C ||| -248.045
-0 ||| D D A D E ||| -248.045
-0 ||| E D C C D ||| -248.045
-0 ||| E C A D E ||| -248.045
-0 ||| C D E E B ||| -248.045
-0 ||| D C C C E ||| -248.045
-0 ||| C D E A E ||| -248.045
-0 ||| C C D C E ||| -248.045
-0 ||| C D C B E ||| -248.045
-0 ||| B B B E E ||| -248.045
-0 ||| E B E C D ||| -248.045
-0 ||| E C B C E ||| -248.045
-0 ||| B B C D E ||| -248.045
-0 ||| C E C A E ||| -248.045
-0 ||| C D D E C ||| -248.045
-0 ||| E B C B E ||| -248.045
-0 ||| B D C C E ||| -248.045
-0 ||| D C D B E ||| -248.045
-0 ||| E A E E C ||| -248.045
-0 ||| E E C C C ||| -248.045
-0 ||| B D A E E ||| -248.045
-0 ||| D E E B C ||| -248.045
-0 ||| E C C E C ||| -248.045
-0 ||| C B E B E ||| -248.045
-0 ||| D A E C E ||| -248.045
-0 ||| D E D D B ||| -248.045
-0 ||| E A D C E ||| -248.045
-0 ||| D B D C E ||| -248.045
-0 ||| E D C E B ||| -248.045
-0 ||| B E E D B ||| -248.045
-0 ||| B D D B E ||| -248.045
-0 ||| E E E B B ||| -248.045
-0 ||| E B B E D ||| -248.045
-0 ||| C E C D C ||| -248.045
-0 ||| B E D A E ||| -248.045
-0 ||| B E B B E ||| -248.045
-0 ||| D B B D E ||| -248.045
-0 ||| B C E B E ||| -248.045
-0 ||| D C A E E ||| -248.045
-0 ||| E C E B D ||| -248.045
-0 ||| C E C E B ||| -248.045
-0 ||| E D B E C ||| -248.045
-0 ||| D A B E E ||| -248.045
-0 ||| E D A E D ||| -248.045
-0 ||| E B E E B ||| -248.045
-0 ||| C A D D E ||| -248.045
-0 ||| B A C E E ||| -248.045
-0 ||| D D B C E ||| -248.045
-0 ||| C E A E D ||| -248.045
-0 ||| E D E C C ||| -248.045
-0 ||| B E D D C ||| -248.045
-0 ||| E A B D E ||| -248.045
-0 ||| E B D E C ||| -248.045
-0 ||| D C D D D ||| -248.045
-0 ||| C D E C D ||| -248.045
-0 ||| C D C D D ||| -248.045
-0 ||| D B C E D ||| -248.045
-0 ||| E D C A E ||| -248.045
-0 ||| C C C E D ||| -248.045
-0 ||| C E D B D ||| -248.045
-0 ||| E A C E D ||| -248.045
-0 ||| C B E D D ||| -248.045
-0 ||| D B E E C ||| -248.045
-0 ||| B E B D D ||| -248.045
-0 ||| D E E A D ||| -248.045
-0 ||| C D B E D ||| -248.045
-0 ||| D D C E C ||| -248.045
-0 ||| E D C D C ||| -248.045
-0 ||| E B E A E ||| -248.045
-0 ||| E E D A D ||| -248.045
-0 ||| C C B D E ||| -248.045
-0 ||| D A C D E ||| -248.045
-0 ||| B E D E B ||| -248.045
-0 ||| E B C D D ||| -248.045
-0 ||| C A E E D ||| -248.045
-0 ||| E E A E C ||| -248.045
-0 ||| B D D D D ||| -248.045
-0 ||| E D E E A ||| -248.045
-0 ||| E E B B D ||| -248.045
-0 ||| E E C E A ||| -248.045
-0 ||| E D D B D ||| -248.045
-0 ||| C E E E A ||| -248.045
-0 ||| A D D C E ||| -249.045
-0 ||| A A E D E ||| -249.045
-0 ||| A D E E C ||| -249.045
-0 ||| A C E C E ||| -249.045
-0 ||| A C C D E ||| -249.045
-0 ||| A D B D E ||| -249.045
-0 ||| A B E E D ||| -249.045
-0 ||| A A D E E ||| -249.045
-0 ||| A E E B D ||| -249.045
-0 ||| A E A D E ||| -249.045
-0 ||| A E C E C ||| -249.045
-0 ||| A D C E D ||| -249.045
-0 ||| A C B E E ||| -249.045
-0 ||| A E B C E ||| -249.045
-0 ||| A B D D E ||| -249.045
-0 ||| D C E E C ||| -250.045
-0 ||| C C E B E ||| -250.045
-0 ||| C E E D B ||| -250.045
-0 ||| C E D D C ||| -250.045
-0 ||| E A E D D ||| -250.045
-0 ||| D E C C D ||| -250.045
-0 ||| E E B A E ||| -250.045
-0 ||| E E C D B ||| -250.045
-0 ||| E D E D B ||| -250.045
-0 ||| E D D D C ||| -250.045
-0 ||| D D E C D ||| -250.045
-0 ||| E C D E C ||| -250.045
-0 ||| B C E C E ||| -250.045
-0 ||| E E A D D ||| -250.045
-0 ||| E A D E D ||| -250.045
-0 ||| C B E C E ||| -250.045
-0 ||| D E D B D ||| -250.045
-0 ||| D B E B E ||| -250.045
-0 ||| D E C E B ||| -250.045
-0 ||| E B D B E ||| -250.045
-0 ||| D B D E D ||| -250.045
-0 ||| C E B D D ||| -250.045
-0 ||| B D B D E ||| -250.045
-0 ||| C D D B E ||| -250.045
-0 ||| E C C B E ||| -250.045
-0 ||| E E E D A ||| -250.045
-0 ||| E D D E B ||| -250.045
-0 ||| E B A E E ||| -250.045
-0 ||| C A C E E ||| -250.045
-0 ||| E E D E A ||| -250.045
-0 ||| D E C D C ||| -250.045
-0 ||| D A D D E ||| -250.045
-0 ||| D C D C E ||| -250.045
-0 ||| D E E E A ||| -250.045
-0 ||| B C B E E ||| -250.045
-0 ||| E E B E B ||| -250.045
-0 ||| B A D E E ||| -250.045
-0 ||| E C E C D ||| -250.045
-0 ||| E D B B E ||| -250.045
-0 ||| D D E E B ||| -250.045
-0 ||| D D D E C ||| -250.045
-0 ||| D D C D D ||| -250.045
-0 ||| D B E D D ||| -250.045
-0 ||| C D C C E ||| -250.045
-0 ||| E C E D C ||| -250.045
-0 ||| C D A E E ||| -250.045
-0 ||| D E B E C ||| -250.045
-0 ||| E C B E D ||| -250.045
-0 ||| E B C C E ||| -250.045
-0 ||| E C C D D ||| -250.045
-0 ||| C B C D E ||| -250.045
-0 ||| E E D C C ||| -250.045
-0 ||| C B B E E ||| -250.045
-0 ||| B D D C E ||| -250.045
-0 ||| D D E D C ||| -250.045
-0 ||| B E C E C ||| -250.045
-0 ||| B B D D E ||| -250.045
-0 ||| C E D A E ||| -250.045
-0 ||| B C C D E ||| -250.045
-0 ||| E D D C D ||| -250.045
-0 ||| D D C B E ||| -250.045
-0 ||| C E B B E ||| -250.045
-0 ||| D D E A E ||| -250.045
-0 ||| B E A D E ||| -250.045
-0 ||| C C D E D ||| -250.045
-0 ||| E D D A E ||| -250.045
-0 ||| D E C A E ||| -250.045
-0 ||| D E A E D ||| -250.045
-0 ||| C C E D D ||| -250.045
-0 ||| B D E E C ||| -250.045
-0 ||| E E A B E ||| -250.045
-0 ||| E E B C D ||| -250.045
-0 ||| E A E B E ||| -250.045
-0 ||| E D B D D ||| -250.045
-0 ||| E B D D D ||| -250.045
-0 ||| D A E E D ||| -250.045
-0 ||| C E D E B ||| -250.045
-0 ||| C D D D D ||| -250.045
-0 ||| E E B D C ||| -250.045
-0 ||| E C E E B ||| -250.045
-0 ||| E E E C B ||| -250.045
-0 ||| B A E D E ||| -250.045
-0 ||| B D C E D ||| -250.045
-0 ||| B B E E D ||| -250.045
-0 ||| B E E B D ||| -250.045
-0 ||| D C C E D ||| -250.045
-0 ||| D D B E D ||| -250.045
-0 ||| B E B C E ||| -250.045
-0 ||| D C B D E ||| -250.045
-0 ||| E C E A E ||| -250.045
-0 ||| C E D C D ||| -250.045
-0 ||| D E E C C ||| -250.045
-0 ||| A E C B E ||| -251.045
-0 ||| A E E A E ||| -251.045
-0 ||| A B C E E ||| -251.045
-0 ||| A D D E D ||| -251.045
-0 ||| A E B E D ||| -251.045
-0 ||| A D E B E ||| -251.045
-0 ||| A E D E C ||| -251.045
-0 ||| A D E D D ||| -251.045
-0 ||| A C D D E ||| -251.045
-0 ||| A C E E D ||| -251.045
-0 ||| A E C D D ||| -251.045
-0 ||| A E E E B ||| -251.045
-0 ||| A E E D C ||| -251.045
-0 ||| A E E C D ||| -251.045
-0 ||| E A E C E ||| -252.045
-0 ||| B E E E B ||| -252.045
-0 ||| D D D D D ||| -252.045
-0 ||| D D D B E ||| -252.045
-0 ||| E B D C E ||| -252.045
-0 ||| E E C B D ||| -252.045
-0 ||| B D D E D ||| -252.045
-0 ||| E E A C E ||| -252.045
-0 ||| C C B E E ||| -252.045
-0 ||| C D C E D ||| -252.045
-0 ||| C C E C E ||| -252.045
-0 ||| C D E E C ||| -252.045
-0 ||| C B E E D ||| -252.045
-0 ||| C D B D E ||| -252.045
-0 ||| B D E D D ||| -252.045
-0 ||| D B B E E ||| -252.045
-0 ||| E C A E E ||| -252.045
-0 ||| E B B D E ||| -252.045
-0 ||| B E C B E ||| -252.045
-0 ||| D E D A E ||| -252.045
-0 ||| C E B C E ||| -252.045
-0 ||| C E E B D ||| -252.045
-0 ||| D E E D B ||| -252.045
-0 ||| B E E D C ||| -252.045
-0 ||| D E D D C ||| -252.045
-0 ||| E D C E C ||| -252.045
-0 ||| D C D E D ||| -252.045
-0 ||| E E E B C ||| -252.045
-0 ||| E A B E E ||| -252.045
-0 ||| D C E D D ||| -252.045
-0 ||| C E C E C ||| -252.045
-0 ||| C B D D E ||| -252.045
-0 ||| E D E B D ||| -252.045
-0 ||| B E C D D ||| -252.045
-0 ||| B B C E E ||| -252.045
-0 ||| C C C D E ||| -252.045
-0 ||| D A C E E ||| -252.045
-0 ||| E B E E C ||| -252.045
-0 ||| E C D B E ||| -252.045
-0 ||| D B E C E ||| -252.045
-0 ||| C A E D E ||| -252.045
-0 ||| E C C C E ||| -252.045
-0 ||| D B C D E ||| -252.045
-0 ||| D D C C E ||| -252.045
-0 ||| E D B C E ||| -252.045
-0 ||| D E B B E ||| -252.045
-0 ||| B D E B E ||| -252.045
-0 ||| C D D C E ||| -252.045
-0 ||| E E E A D ||| -252.045
-0 ||| B E E C D ||| -252.045
-0 ||| C E A D E ||| -252.045
-0 ||| D D A E E ||| -252.045
-0 ||| E E D D B ||| -252.045
-0 ||| B C D D E ||| -252.045
-0 ||| E C D D D ||| -252.045
-0 ||| E B C E D ||| -252.045
-0 ||| D E D C D ||| -252.045
-0 ||| B C E E D ||| -252.045
-0 ||| B E B E D ||| -252.045
-0 ||| E A C D E ||| -252.045
-0 ||| B E D E C ||| -252.045
-0 ||| D C E B E ||| -252.045
-0 ||| E D A D E ||| -252.045
-0 ||| B E E A E ||| -252.045
-0 ||| D E B D D ||| -252.045
-0 ||| D E D E B ||| -252.045
-0 ||| C A D E E ||| -252.045
-0 ||| A B D E E ||| -253.045
-0 ||| A E A E E ||| -253.045
-0 ||| A A E E E ||| -253.045
-0 ||| A D B E E ||| -253.045
-0 ||| A C C E E ||| -253.045
-0 ||| A D C D E ||| -253.045
-0 ||| A B E D E ||| -253.045
-0 ||| A E D D D ||| -253.045
-0 ||| A E D B E ||| -253.045
-0 ||| A E C C E ||| -253.045
-0 ||| A D E C E ||| -253.045
-0 ||| D C B E E ||| -254.045
-0 ||| D E A D E ||| -254.045
-0 ||| E E C D C ||| -254.045
-0 ||| C C D D E ||| -254.045
-0 ||| D E E B D ||| -254.045
-0 ||| E E C E B ||| -254.045
-0 ||| E D E D C ||| -254.045
-0 ||| D E C E C ||| -254.045
-0 ||| C E B E D ||| -254.045
-0 ||| B E A E E ||| -254.045
-0 ||| E D E E B ||| -254.045
-0 ||| C E E E B ||| -254.045
-0 ||| B E D B E ||| -254.045
-0 ||| E B E D D ||| -254.045
-0 ||| E D D E C ||| -254.045
-0 ||| E E B E C ||| -254.045
-0 ||| E E C C D ||| -254.045
-0 ||| E E E E A ||| -254.045
-0 ||| C D E D D ||| -254.045
-0 ||| E A E E D ||| -254.045
-0 ||| C D D E D ||| -254.045
-0 ||| B B D E E ||| -254.045
-0 ||| D D E E C ||| -254.045
-0 ||| D C C D E ||| -254.045
-0 ||| E D E A E ||| -254.045
-0 ||| D B D D E ||| -254.045
-0 ||| D D B D E ||| -254.045
-0 ||| E C C E D ||| -254.045
-0 ||| C B C E E ||| -254.045
-0 ||| E E D B D ||| -254.045
-0 ||| B B E D E ||| -254.045
-0 ||| E A D D E ||| -254.045
-0 ||| C E C D D ||| -254.045
-0 ||| D C E C E ||| -254.045
-0 ||| B C C E E ||| -254.045
-0 ||| C E E C D ||| -254.045
-0 ||| E D B E D ||| -254.045
-0 ||| C E E A E ||| -254.045
-0 ||| E D C B E ||| -254.045
-0 ||| B D E C E ||| -254.045
-0 ||| B E C C E ||| -254.045
-0 ||| C E E D C ||| -254.045
-0 ||| D D C E D ||| -254.045
-0 ||| E E A E D ||| -254.045
-0 ||| E E C A E ||| -254.045
-0 ||| E C B D E ||| -254.045
-0 ||| D A D E E ||| -254.045
-0 ||| B E D D D ||| -254.045
-0 ||| E C D C E ||| -254.045
-0 ||| C E C B E ||| -254.045
-0 ||| E D E C D ||| -254.045
-0 ||| E D C D D ||| -254.045
-0 ||| D A E D E ||| -254.045
-0 ||| E B D E D ||| -254.045
-0 ||| D B E E D ||| -254.045
-0 ||| C C E E D ||| -254.045
-0 ||| D E B C E ||| -254.045
-0 ||| E B E B E ||| -254.045
-0 ||| B A E E E ||| -254.045
-0 ||| D D D C E ||| -254.045
-0 ||| E E E C C ||| -254.045
-0 ||| C E D E C ||| -254.045
-0 ||| E C E E C ||| -254.045
-0 ||| B D C D E ||| -254.045
-0 ||| C D E B E ||| -254.045
-0 ||| B D B E E ||| -254.045
-0 ||| A C E D E ||| -255.045
-0 ||| A D D D E ||| -255.045
-0 ||| A E B D E ||| -255.045
-0 ||| A D E E D ||| -255.045
-0 ||| A E E E C ||| -255.045
-0 ||| A E D C E ||| -255.045
-0 ||| A C D E E ||| -255.045
-0 ||| A E C E D ||| -255.045
-0 ||| D E E A E ||| -256.045
-0 ||| C E A E E ||| -256.045
-0 ||| D E E C D ||| -256.045
-0 ||| B E E E C ||| -256.045
-0 ||| E E B D D ||| -256.045
-0 ||| E C D E D ||| -256.045
-0 ||| E D D D D ||| -256.045
-0 ||| E D A E E ||| -256.045
-0 ||| B C D E E ||| -256.045
-0 ||| B C E D E ||| -256.045
-0 ||| E E E D B ||| -256.045
-0 ||| B D D D E ||| -256.045
-0 ||| C B D E E ||| -256.045
-0 ||| D E C D D ||| -256.045
-0 ||| D E E E B ||| -256.045
-0 ||| E E D E B ||| -256.045
-0 ||| E B E C E ||| -256.045
-0 ||| D E C B E ||| -256.045
-0 ||| D D E D D ||| -256.045
-0 ||| D E E D C ||| -256.045
-0 ||| D D D E D ||| -256.045
-0 ||| E B B E E ||| -256.045
-0 ||| C E C C E ||| -256.045
-0 ||| C E D D D ||| -256.045
-0 ||| D E B E D ||| -256.045
-0 ||| E E D C D ||| -256.045
-0 ||| E C E B E ||| -256.045
-0 ||| D E D E C ||| -256.045
-0 ||| D C E E D ||| -256.045
-0 ||| E D C C E ||| -256.045
-0 ||| B E B D E ||| -256.045
-0 ||| B E C E D ||| -256.045
-0 ||| E D D B E ||| -256.045
-0 ||| B E D C E ||| -256.045
-0 ||| C B E D E ||| -256.045
-0 ||| C E D B E ||| -256.045
-0 ||| C C C E E ||| -256.045
-0 ||| D B C E E ||| -256.045
-0 ||| E C E D D ||| -256.045
-0 ||| D C D D E ||| -256.045
-0 ||| C D E C E ||| -256.045
-0 ||| C D C D E ||| -256.045
-0 ||| E E D D C ||| -256.045
-0 ||| B D E E D ||| -256.045
-0 ||| C A E E E ||| -256.045
-0 ||| E A C E E ||| -256.045
-0 ||| C D B E E ||| -256.045
-0 ||| E B C D E ||| -256.045
-0 ||| E E D A E ||| -256.045
-0 ||| E E B B E ||| -256.045
-0 ||| D D E B E ||| -256.045
-0 ||| A E E D D ||| -257.045
-0 ||| A D C E E ||| -257.045
-0 ||| A B E E E ||| -257.045
-0 ||| A E D E D ||| -257.045
-0 ||| A E E B E ||| -257.045
-0 ||| C C E D E ||| -258.045
-0 ||| D E D B E ||| -258.045
-0 ||| D C C E E ||| -258.045
-0 ||| E B D D E ||| 

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kenlm/oilers.kenlm
----------------------------------------------------------------------
diff --git a/resources/kenlm/oilers.kenlm b/resources/kenlm/oilers.kenlm
deleted file mode 100644
index e343d7d..0000000
Binary files a/resources/kenlm/oilers.kenlm and /dev/null differ



[47/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/lm_oov/joshua.config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/lm_oov/joshua.config b/joshua-core/src/test/resources/lm_oov/joshua.config
new file mode 100644
index 0000000..9cbd603
--- /dev/null
+++ b/joshua-core/src/test/resources/lm_oov/joshua.config
@@ -0,0 +1,17 @@
+feature-function = LanguageModel -lm_type berkeleylm -lm_order 5 -lm_file src/test/resources/berkeley_lm/lm -oov_feature
+
+tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
+tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
+
+top-n = 0
+
+#feature_function = WordPenalty
+feature_function = OOVPenalty
+
+# Model Weights ####
+
+lm_0 0
+lm_0_oov 1
+OOVPenalty 1
+tm_pt_0 0
+tm_glue 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/config b/joshua-core/src/test/resources/phrase_decoder/config
new file mode 100644
index 0000000..11e0108
--- /dev/null
+++ b/joshua-core/src/test/resources/phrase_decoder/config
@@ -0,0 +1,29 @@
+tm = moses -owner pt -maxspan 0 -path src/test/resources/phrase_decoder/rules.1.gz -max-source-len 5
+feature-function = StateMinimizingLanguageModel -lm_order 5 -lm_file src/test/resources/phrase_decoder/lm.1.gz
+
+search = stack
+
+mark-oovs = false
+pop-limit = 10
+top-n = 1
+
+output-format = %i ||| %s ||| %f ||| %c
+
+include-align-index = true
+reordering-limit = 6
+
+# And these are the feature functions to activate.
+feature-function = OOVPenalty
+feature-function = WordPenalty
+feature-function = Distortion
+feature-function = PhrasePenalty -owner pt
+
+OOVPenalty 1.0
+Distortion 0.114849
+WordPenalty -0.201544
+PhrasePenalty -0.236965
+tm_pt_0 0.0370068
+tm_pt_1 0.0495759
+tm_pt_2 0.196742
+tm_pt_3 0.0745423
+lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/constrained.config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/constrained.config b/joshua-core/src/test/resources/phrase_decoder/constrained.config
new file mode 100644
index 0000000..ffa988c
--- /dev/null
+++ b/joshua-core/src/test/resources/phrase_decoder/constrained.config
@@ -0,0 +1,28 @@
+tm = moses pt 0 src/test/resources/phrase_decoder/rules.1.gz
+
+lm = kenlm 5 true false 100 src/test/resources/phrase_decoder/lm.1.gz
+
+mark-oovs = false
+pop-limit = 10
+top-n = 5
+
+output-format = %i ||| %s ||| %f ||| %c
+
+include-align-index = true
+reordering-limit = 10
+
+# And these are the feature functions to activate.
+feature-function = OOVPenalty
+feature-function = WordPenalty
+feature-function = Distortion
+feature-function = PhrasePenalty -owner pt
+
+OOVPenalty 1.0
+Distortion 0.114849
+WordPenalty -0.201544
+PhrasePenalty -0.236965
+tm_pt_0 0.0370068
+tm_pt_1 0.0495759
+tm_pt_2 0.196742
+tm_pt_3 0.0745423
+lm_0 0.204412452147565

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/constrained.output.gold
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/constrained.output.gold b/joshua-core/src/test/resources/phrase_decoder/constrained.output.gold
new file mode 100644
index 0000000..238387c
--- /dev/null
+++ b/joshua-core/src/test/resources/phrase_decoder/constrained.output.gold
@@ -0,0 +1,5 @@
+0 ||| President Obama |8-8| to |7-7| hinder |4-4| a strategy |0-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-15.792 tm_pt_1=-17.550 tm_pt_2=-14.599 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=7.000 ||| -15.163
+0 ||| President Obama |8-8| to |7-7| hinder |4-4| a |0-0| strategy |1-1| for |3-3| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.919 tm_pt_1=-17.550 tm_pt_2=-14.917 tm_pt_3=-18.298 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-24.000 PhrasePenalty=8.000 ||| -15.505
+0 ||| President Obama |8-8| to hinder |3-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-14.986 tm_pt_1=-17.951 tm_pt_2=-14.075 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=6.000 ||| -15.762
+0 ||| President Obama |8-8| to hinder |3-4| a |0-0| strategy |1-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.112 tm_pt_1=-17.951 tm_pt_2=-14.393 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.103
+0 ||| President Obama |8-8| to |3-3| hinder |4-4| a strategy |0-1| for |7-7| Republican |2-2| re @-@ election |5-6| ||| tm_pt_0=-16.329 tm_pt_1=-17.951 tm_pt_2=-15.136 tm_pt_3=-18.699 lm_0=-29.452 OOVPenalty=0.000 WordPenalty=-4.777 Distortion=-32.000 PhrasePenalty=7.000 ||| -16.257

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/lm.1.gz
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/lm.1.gz b/joshua-core/src/test/resources/phrase_decoder/lm.1.gz
new file mode 100644
index 0000000..3f4c453
Binary files /dev/null and b/joshua-core/src/test/resources/phrase_decoder/lm.1.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/output.gold
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/output.gold b/joshua-core/src/test/resources/phrase_decoder/output.gold
new file mode 100644
index 0000000..509a3de
--- /dev/null
+++ b/joshua-core/src/test/resources/phrase_decoder/output.gold
@@ -0,0 +1 @@
+0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/phrase_decoder/rules.1.gz
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/phrase_decoder/rules.1.gz b/joshua-core/src/test/resources/phrase_decoder/rules.1.gz
new file mode 100644
index 0000000..14466e9
Binary files /dev/null and b/joshua-core/src/test/resources/phrase_decoder/rules.1.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar b/joshua-core/src/test/resources/wa_grammar
new file mode 100644
index 0000000..82d0052
--- /dev/null
+++ b/joshua-core/src/test/resources/wa_grammar
@@ -0,0 +1,3 @@
+[X] ||| A [X,1] B1 [X,2] B2 C ||| a b [X,2] c1 [X,1] c2 ||| 1 1 1 1 1 1 OOV=1 ||| 0-0 2-1 4-1 5-3 5-5
+[X] ||| U Z1 Z2 ||| n1 u z ||| 1 1 1 1 1 1 OOV=2 ||| 0-1 1-2 2-2
+[X] ||| K ||| k1 k2 k3 n1 n2 n3 ||| 1 1 1 1 1 1 OOV=4 ||| 0-0 0-1 0-2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/config b/joshua-core/src/test/resources/wa_grammar.packed/config
new file mode 100644
index 0000000..fbc07d0
--- /dev/null
+++ b/joshua-core/src/test/resources/wa_grammar.packed/config
@@ -0,0 +1,2 @@
+max-source-len = 6
+version = 3

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/encoding
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/encoding b/joshua-core/src/test/resources/wa_grammar.packed/encoding
new file mode 100644
index 0000000..630f69f
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/encoding differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.alignments
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.alignments b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.alignments
new file mode 100644
index 0000000..f1425eb
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.alignments differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.features
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.features b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.features
new file mode 100644
index 0000000..5a4c774
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.features differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.source
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.source b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.source
new file mode 100644
index 0000000..4607b89
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.source differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target
new file mode 100644
index 0000000..fe11a38
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target.lookup b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target.lookup
new file mode 100644
index 0000000..7d82179
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/slice_00000.target.lookup differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/wa_grammar.packed/vocabulary
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/wa_grammar.packed/vocabulary b/joshua-core/src/test/resources/wa_grammar.packed/vocabulary
new file mode 100644
index 0000000..637651e
Binary files /dev/null and b/joshua-core/src/test/resources/wa_grammar.packed/vocabulary differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/berkeley_lm/lm
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm b/src/test/resources/berkeley_lm/lm
deleted file mode 100644
index 05b4e6b..0000000
--- a/src/test/resources/berkeley_lm/lm
+++ /dev/null
@@ -1,16 +0,0 @@
-
-\data\
-ngram 1=5
-ngram 2=3
-
-\1-grams:
--99.000000	<unk>
--99.000000	<s>	-1.752754
--2.034158	the	-0.800943
--5.318589	chat-rooms	-0.151088
--1.495702	</s>
-
-\2-grams:
--1.773970	<s> the
--4.878868	the chat-rooms
--0.499794	chat-rooms </s>

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/berkeley_lm/lm.berkeleylm
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.berkeleylm b/src/test/resources/berkeley_lm/lm.berkeleylm
deleted file mode 100644
index c048464..0000000
Binary files a/src/test/resources/berkeley_lm/lm.berkeleylm and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/berkeley_lm/lm.berkeleylm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.berkeleylm.gz b/src/test/resources/berkeley_lm/lm.berkeleylm.gz
deleted file mode 100644
index f9f8d16..0000000
Binary files a/src/test/resources/berkeley_lm/lm.berkeleylm.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/berkeley_lm/lm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/berkeley_lm/lm.gz b/src/test/resources/berkeley_lm/lm.gz
deleted file mode 100644
index ae47266..0000000
Binary files a/src/test/resources/berkeley_lm/lm.gz and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/grammar.glue
----------------------------------------------------------------------
diff --git a/src/test/resources/grammar.glue b/src/test/resources/grammar.glue
deleted file mode 100644
index 69e1520..0000000
--- a/src/test/resources/grammar.glue
+++ /dev/null
@@ -1,4 +0,0 @@
-[GOAL] ||| <s> ||| <s> ||| 0
-[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
-[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0
-[GOAL] ||| <s> [X,1] </s> ||| <s> [X,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/glue-grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/glue-grammar b/src/test/resources/kbest_extraction/glue-grammar
deleted file mode 100644
index 6a1162f..0000000
--- a/src/test/resources/kbest_extraction/glue-grammar
+++ /dev/null
@@ -1,3 +0,0 @@
-[GOAL] ||| <s> ||| <s> ||| 0
-[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] ||| -1
-[GOAL] ||| [GOAL,1] </s> ||| [GOAL,1] </s> ||| 0

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/grammar
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/grammar b/src/test/resources/kbest_extraction/grammar
deleted file mode 100644
index a03b2d9..0000000
--- a/src/test/resources/kbest_extraction/grammar
+++ /dev/null
@@ -1,25 +0,0 @@
-[X] ||| a ||| A ||| 2 
-[X] ||| a ||| B ||| 3
-[X] ||| a ||| C ||| 5
-[X] ||| a ||| D ||| 7
-[X] ||| a ||| E ||| 11
-[X] ||| b ||| A ||| 13
-[X] ||| b ||| B ||| 17
-[X] ||| b ||| C ||| 19
-[X] ||| b ||| D ||| 23
-[X] ||| b ||| E ||| 29
-[X] ||| c ||| A ||| 31
-[X] ||| c ||| B ||| 37
-[X] ||| c ||| C ||| 41
-[X] ||| c ||| D ||| 43
-[X] ||| c ||| E ||| 47
-[X] ||| d ||| A ||| 53
-[X] ||| d ||| B ||| 59
-[X] ||| d ||| C ||| 61
-[X] ||| d ||| D ||| 67
-[X] ||| d ||| E ||| 71
-[X] ||| e ||| A ||| 73
-[X] ||| e ||| B ||| 79
-[X] ||| e ||| C ||| 83
-[X] ||| e ||| D ||| 89
-[X] ||| e ||| E ||| 97

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/joshua.config
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/joshua.config b/src/test/resources/kbest_extraction/joshua.config
deleted file mode 100644
index 69ec9c9..0000000
--- a/src/test/resources/kbest_extraction/joshua.config
+++ /dev/null
@@ -1,27 +0,0 @@
-feature-function = StateMinimizingLanguageModel -lm_type kenlm -lm_order 5 -lm_file src/test/resources/kbest_extraction/lm.gz
-
-tm = thrax -owner pt -maxspan 12 -path src/test/resources/kbest_extraction/grammar
-tm = thrax -owner glue -maxspan -1 -path src/test/resources/kbest_extraction/glue-grammar
-
-mark_oovs=false
-
-#tm config
-default_non_terminal=X
-goalSymbol=GOAL
-
-#pruning config
-pop-limit=100
-
-#nbest config
-use_unique_nbest=true
-top-n = 3126
-
-#feature_function = WordPenalty
-feature_function = OOVPenalty
-
-# Model Weights ####
-
-lm_0 1
-tm_pt_0 1
-tm_glue_0 1
-OOVPenalty 10000

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/lm.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/lm.gz b/src/test/resources/kbest_extraction/lm.gz
deleted file mode 100644
index a26335e..0000000
Binary files a/src/test/resources/kbest_extraction/lm.gz and /dev/null differ


[46/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/output.gold b/src/test/resources/kbest_extraction/output.gold
deleted file mode 100644
index e75bb9e..0000000
--- a/src/test/resources/kbest_extraction/output.gold
+++ /dev/null
@@ -1,3126 +0,0 @@
-0 ||| A A A A A ||| lm_0=-28.045 tm_pt_0=-172.000 tm_glue_0=5.000 ||| -195.045
-0 ||| B A A A A ||| lm_0=-28.045 tm_pt_0=-173.000 tm_glue_0=5.000 ||| -196.045
-0 ||| C A A A A ||| lm_0=-28.045 tm_pt_0=-175.000 tm_glue_0=5.000 ||| -198.045
-0 ||| A B A A A ||| lm_0=-28.045 tm_pt_0=-176.000 tm_glue_0=5.000 ||| -199.045
-0 ||| B B A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
-0 ||| D A A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
-0 ||| A A A A B ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A A A B A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A A B A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A C A A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| B A A A B ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B A A B A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B A B A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B C A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| C B A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| A A A C A ||| lm_0=-28.045 tm_pt_0=-180.000 tm_glue_0=5.000 ||| -203.045
-0 ||| C A A A B ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C A A B A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| B A A C A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C A B A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| E A A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C C A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| D B A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| A A A A C ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B A B A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B A A B ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A A C A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B B A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A D A A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| B A A A C ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B A C A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| C A A C A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B D A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D C A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| A A B A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A B B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A A B B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A B A C A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C A A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C A B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C B A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A D A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| C A A A C ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A A B B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A B A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A B B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| D A A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C A C A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B B A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| E B A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C D A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A D A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| A B A A C ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A A C B ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A B C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A B C A A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A C A C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A A D A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| C A A B B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D A A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A B A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A A C B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B B A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D A C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A A D A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D D A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B C A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A D A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A B B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C B A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E C A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B B C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A B C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| A B A B B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B B B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A A B C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D A B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A C A A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A C B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A C A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A C C A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A B A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B D A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A A A D ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A E A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B B A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A E A A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D A A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D B A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| B D A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C B A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A C A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| E A A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A A D A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A A B C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B C A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D B A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A A A D ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A C B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B D A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A A C B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A E A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A B A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C C A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B C C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A B C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B E A A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C B C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B D B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| A C B A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A D A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A B B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A A C C ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B A C B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C A B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B B C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A A E A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C B B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A D B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B A D A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A D A C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A C C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C D A A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| B C A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A B B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A A B C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A C A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A B A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A D A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E A A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D B A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A A A D ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C C A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A A C C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A D B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A C C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D C A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A C B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A A E A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C C C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B D A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A E A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E D A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D B C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C E A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E A C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| A B C A B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B B A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A D A A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A C A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B A B C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A B C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C A C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B A A D ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A A D B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B C B A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C A D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A D C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C B C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A B D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B E A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A D C A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| B B C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A B C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A C A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B D A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A B D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A A D B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A D B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D C C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A D A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B D C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A B B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C D A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A A C C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A D C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A A E A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D C A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D E A A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A C C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E B A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| A D B A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A C B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C A B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B B B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B A C C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B D A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A E A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C C A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E A A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D A B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A B B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B D B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A D A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C B A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B C C A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A A B D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C C B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A B A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D D A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C A A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D B B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E A B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C E A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A E B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E B A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B A E A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| B B B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E A A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A E A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A C B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A B C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A A D B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A B B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E C A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A E B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E B A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A B D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A D A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A D C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C D C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A C A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D D A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C D A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A B A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E B C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A A B D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E A B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E B A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| A B B C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A C D ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B A D B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A D C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C D A B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C A C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A E B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C B B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A D B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A C C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D A C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A B E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A A E ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B C A C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D B C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A B C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A E A C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B D C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C C C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C D B A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A C D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D A D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B B D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A E C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C A E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| E A A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A C C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A D B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A B C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A C D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A B A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A A B D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E C A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A D C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A D A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A C B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A C D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A E B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A E C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A E A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A B E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D D A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A B B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A A E ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B E A C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A E B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E E A A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D D C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E C C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| A E A A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B B A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A B D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B B B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A E A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D B A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A C B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C B C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B D A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D A B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C C A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B E A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A D C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C A D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B C B B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A C A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D C A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B A B D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D C B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D A A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B E B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C D C A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A E C A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C B D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D E A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A D D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| D C B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A B D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A D B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A E B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A D C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E A A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A C C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A B C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A E A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B E A A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A C B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A D C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A C A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A A E ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A C D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A D D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E A B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A B E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A E C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B E C A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E B A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E D A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C E A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A C D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| A C A B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D B B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D D A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B C C B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E B B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C C B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A B B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D C C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B D B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A E B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C E B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C E A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E B A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D D B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A E B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B E C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A D A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E D A A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A A E ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A C E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C B B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B B E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C D A C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D A E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A D C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B C D A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A A E C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A C D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E A B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C B A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A D B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B B C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D A C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A C C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| B B B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A E B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A D C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A B D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A B B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E A B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E B A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D E A C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A C A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A D A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A C C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E D C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C E C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A D B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E D A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E B B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A C E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A C B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A D D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C E A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A A E C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E D A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A E A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| A C D B B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C C C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A C D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D A D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E A C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B D C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B B D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A E D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A E C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C E C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A A D D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D D C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A D E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C C D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B C A D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D B D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D B C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E A D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C B E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D C A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B D D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A A B E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E B C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C B C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A D C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B E A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B C B C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| C C E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A D C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A A E C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A C C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E A A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D E A A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A E B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A D B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A A B E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A C D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A D E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A C E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A E C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A D A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E A B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E A C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E B C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D E C A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E A D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A A D D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E B A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A E D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A B B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| A C E A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B D B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E B A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A E B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D D A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B C C C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E C A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A D D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D E A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D B B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C D C B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B E B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D E B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D C B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B C E A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B A E C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E C B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A A C E ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E E A A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A C B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C D D A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D B A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E A A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C C B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A E A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B B B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D A B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B D A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C C A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E A B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C B D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| E C B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A E C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E C A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E B A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A C D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A D D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E B A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A E A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A C B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E A A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E A B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A E B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E A B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A A D D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E C B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E B B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A A C E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A A B E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E D A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E E A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A D C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A E D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E E A C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A D E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| A B E C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C B B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C D B C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D C C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C C C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D D B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C E B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E A C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B D C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A B E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C D A D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A E C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E B B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E D A B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B D E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C A E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B A B E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D E C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D B C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C C E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A D B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A E E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D B E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B A D D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A A E D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B E D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B C D B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E C C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E A E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D C D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E D B A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| B A C A E ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E E A A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E B C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C C D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B C D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C C E A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B C D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B C C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E A D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E C A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C E C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E C B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D E A C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E A B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D D A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D A E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E D C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B C E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D E A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C A E B C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D B A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B D C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D D B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B E D A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B A C E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D A B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B D A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B E B B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B A E C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D D A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B E 

<TRUNCATED>


[27/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
----------------------------------------------------------------------
diff --cc joshua-core/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
index 3a5a939,0000000..5a4f128
mode 100644,000000..100644
--- a/joshua-core/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/system/StructuredTranslationTest.java
@@@ -1,272 -1,0 +1,272 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.system;
 +
 +import static java.util.Arrays.asList;
 +import static org.testng.Assert.assertEquals;
 +import static org.testng.Assert.assertTrue;
 +
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map;
 +
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.StructuredTranslation;
 +import org.apache.joshua.decoder.Translation;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.testng.annotations.AfterMethod;
 +import org.testng.annotations.BeforeMethod;
 +import org.testng.annotations.Test;
 +
 +/**
 + * Integration test for the complete Joshua decoder using a toy grammar that translates
 + * a bunch of capital letters to lowercase letters. Rules in the test grammar
 + * drop and generate additional words and simulate reordering of rules, so that
 + * proper extraction of word alignments and other information from the decoder
 + * can be tested.
 + *
 + * @author fhieber
 + */
 +public class StructuredTranslationTest {
 +
 +  private JoshuaConfiguration joshuaConfig = null;
 +  private Decoder decoder = null;
 +  private static final String INPUT = "A K B1 U Z1 Z2 B2 C";
 +  private static final String EXPECTED_TRANSLATION = "a b n1 u z c1 k1 k2 k3 n1 n2 n3 c2";
 +  private static final List<String> EXPECTED_TRANSLATED_TOKENS = asList(EXPECTED_TRANSLATION.split("\\s+"));
 +  private static final String EXPECTED_WORD_ALIGNMENT_STRING = "0-0 2-1 6-1 3-3 4-4 5-4 7-5 1-6 1-7 1-8 7-12";
 +  private static final List<List<Integer>> EXPECTED_WORD_ALIGNMENT = asList(
 +      asList(0), asList(2, 6), asList(), asList(3),
 +      asList(4, 5), asList(7), asList(1),
 +      asList(1), asList(1), asList(), asList(),
 +      asList(), asList(7));
 +  private static final double EXPECTED_SCORE = -17.0;
 +  private static final Map<String,Float> EXPECTED_FEATURES = new HashMap<>();
 +  private static final int EXPECTED_NBEST_LIST_SIZE = 8;
 +  static {
 +    EXPECTED_FEATURES.put("glue_0", -1.0f);
 +    EXPECTED_FEATURES.put("pt_0", 3.0f);
 +    EXPECTED_FEATURES.put("pt_1", 3.0f);
 +    EXPECTED_FEATURES.put("pt_2", 3.0f);
 +    EXPECTED_FEATURES.put("pt_3", 3.0f);
 +    EXPECTED_FEATURES.put("pt_4", 3.0f);
 +    EXPECTED_FEATURES.put("pt_5", 3.0f);
 +    EXPECTED_FEATURES.put("pt_OOV", 7.0f);
 +  }
 +
 +  @BeforeMethod
 +  public void setUp() throws Exception {
 +    joshuaConfig = new JoshuaConfiguration();
 +    joshuaConfig.search_algorithm = "cky";
 +    joshuaConfig.mark_oovs = false;
 +    joshuaConfig.pop_limit = 100;
 +    joshuaConfig.use_unique_nbest = false;
 +    joshuaConfig.include_align_index = false;
 +    joshuaConfig.topN = 0;
-     joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path resources/wa_grammar");
-     joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path resources/grammar.glue");
++    joshuaConfig.tms.add("thrax -owner pt -maxspan 20 -path src/test/resources/wa_grammar");
++    joshuaConfig.tms.add("thrax -owner glue -maxspan -1 -path src/test/resources/grammar.glue");
 +    joshuaConfig.goal_symbol = "[GOAL]";
 +    joshuaConfig.default_non_terminal = "[X]";
 +    joshuaConfig.features.add("OOVPenalty");
 +    joshuaConfig.weights.add("pt_0 -1");
 +    joshuaConfig.weights.add("pt_1 -1");
 +    joshuaConfig.weights.add("pt_2 -1");
 +    joshuaConfig.weights.add("pt_3 -1");
 +    joshuaConfig.weights.add("pt_4 -1");
 +    joshuaConfig.weights.add("pt_5 -1");
 +    joshuaConfig.weights.add("glue_0 -1");
 +    joshuaConfig.weights.add("OOVPenalty 1");
 +    decoder = new Decoder(joshuaConfig, ""); // second argument (configFile
 +                                             // is not even used by the
 +                                             // constructor/initialize)
 +  }
 +
 +  @AfterMethod
 +  public void tearDown() throws Exception {
 +    decoder.cleanUp();
 +    decoder = null;
 +  }
 +
 +  private Translation decode(String input) {
 +    Sentence sentence = new Sentence(input, 0, joshuaConfig);
 +    return decoder.decode(sentence);
 +  }
 +
 +  @Test
 +  public void givenInput_whenRegularOutputFormat_thenExpectedOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = false;
 +    joshuaConfig.outputFormat = "%s | %a ";
 +
 +    // WHEN
 +    final String translation = decode(INPUT).toString().trim();
 +
 +    // THEN
 +    assertEquals(translation, EXPECTED_TRANSLATION + " | " + EXPECTED_WORD_ALIGNMENT_STRING);
 +  }
 +
 +  @Test
 +  public void givenInput_whenRegularOutputFormatWithTopN1_thenExpectedOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = false;
 +    joshuaConfig.outputFormat = "%s | %e | %a | %c";
 +    joshuaConfig.topN = 1;
 +
 +    // WHEN
 +    final String translation = decode(INPUT).toString().trim();
 +
 +    // THEN
 +    assertEquals(translation,
 +        EXPECTED_TRANSLATION + " | " + INPUT + " | " + EXPECTED_WORD_ALIGNMENT_STRING + String.format(" | %.3f", EXPECTED_SCORE));
 +  }
 +
 +  @Test
 +  public void givenInput_whenStructuredOutputFormatWithTopN0_thenExpectedOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = true;
 +    joshuaConfig.topN = 0;
 +
 +    // WHEN
 +    final Translation translation = decode(INPUT);
 +    final StructuredTranslation structuredTranslation = translation.getStructuredTranslations().get(0);
 +    final String translationString = structuredTranslation.getTranslationString();
 +    final List<String> translatedTokens = structuredTranslation.getTranslationTokens();
 +    final float translationScore = structuredTranslation.getTranslationScore();
 +    final List<List<Integer>> wordAlignment = structuredTranslation.getTranslationWordAlignments();
 +    final Map<String,Float> translationFeatures = structuredTranslation.getTranslationFeatures();
 +
 +    // THEN
 +    assertTrue(translation.getStructuredTranslations().size() == 1);
 +    assertEquals(translationString, EXPECTED_TRANSLATION);
 +    assertEquals(translatedTokens, EXPECTED_TRANSLATED_TOKENS);
 +    assertEquals(translationScore, EXPECTED_SCORE, 0.00001);
 +    assertEquals(wordAlignment, EXPECTED_WORD_ALIGNMENT);
 +    assertEquals(translatedTokens.size(), wordAlignment.size());
 +    assertEquals(translationFeatures.entrySet(), EXPECTED_FEATURES.entrySet());
 +  }
 +
 +  @Test
 +  public void givenInput_whenStructuredOutputFormatWithTopN1_thenExpectedOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = true;
 +    joshuaConfig.topN = 1;
 +
 +    // WHEN
 +    final Translation translation = decode(INPUT);
 +    final List<StructuredTranslation> structuredTranslations = translation.getStructuredTranslations();
 +    final StructuredTranslation structuredTranslation = structuredTranslations.get(0);
 +    final String translationString = structuredTranslation.getTranslationString();
 +    final List<String> translatedTokens = structuredTranslation.getTranslationTokens();
 +    final float translationScore = structuredTranslation.getTranslationScore();
 +    final List<List<Integer>> wordAlignment = structuredTranslation.getTranslationWordAlignments();
 +    final Map<String,Float> translationFeatures = structuredTranslation.getTranslationFeatures();
 +
 +    // THEN   
 +    assertTrue(structuredTranslations.size() == 1);
 +    assertEquals(translationString, EXPECTED_TRANSLATION);
 +    assertEquals(translatedTokens, EXPECTED_TRANSLATED_TOKENS);
 +    assertEquals(translationScore, EXPECTED_SCORE, 0.00001);
 +    assertEquals(wordAlignment, EXPECTED_WORD_ALIGNMENT);
 +    assertEquals(translatedTokens.size(), wordAlignment.size());
 +    assertEquals(translationFeatures.entrySet(), EXPECTED_FEATURES.entrySet());
 +  }
 +
 +  @Test
 +  public void givenInput_whenStructuredOutputFormatWithKBest_thenExpectedOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = true;
 +    joshuaConfig.topN = 100;
 +
 +    // WHEN
 +    final Translation translation = decode(INPUT);
 +    final List<StructuredTranslation> structuredTranslations = translation.getStructuredTranslations();
 +    final StructuredTranslation viterbiTranslation = structuredTranslations.get(0);
 +    final StructuredTranslation lastKBest = structuredTranslations.get(structuredTranslations.size() - 1);
 +
 +    // THEN
 +    assertEquals(structuredTranslations.size(), EXPECTED_NBEST_LIST_SIZE);
 +    assertTrue(structuredTranslations.size() > 1);
 +    assertEquals(viterbiTranslation.getTranslationString(), EXPECTED_TRANSLATION);
 +    assertEquals(viterbiTranslation.getTranslationTokens(), EXPECTED_TRANSLATED_TOKENS);
 +    assertEquals(viterbiTranslation.getTranslationScore(), EXPECTED_SCORE, 0.00001);
 +    assertEquals(viterbiTranslation.getTranslationWordAlignments(), EXPECTED_WORD_ALIGNMENT);
 +    assertEquals(viterbiTranslation.getTranslationFeatures().entrySet(), EXPECTED_FEATURES.entrySet());
 +    // last entry in KBEST is all input words untranslated, should have 8 OOVs.
 +    assertEquals(lastKBest.getTranslationString(), INPUT);
 +    assertEquals(lastKBest.getTranslationFeatures().get("OOVPenalty"), -800.0, 0.0001);
 +
 +  }
 +
 +  @Test
 +  public void givenEmptyInput_whenStructuredOutputFormat_thenEmptyOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = true;
 +
 +    // WHEN
 +    final Translation translation = decode("");
 +    final StructuredTranslation structuredTranslation = translation.getStructuredTranslations().get(0);
 +    final String translationString = structuredTranslation.getTranslationString();
 +    final List<String> translatedTokens = structuredTranslation.getTranslationTokens();
 +    final float translationScore = structuredTranslation.getTranslationScore();
 +    final List<List<Integer>> wordAlignment = structuredTranslation.getTranslationWordAlignments();
 +
 +    // THEN
 +    assertEquals("", translationString);
 +    assertTrue(translatedTokens.isEmpty());
 +    assertEquals(0, translationScore, 0.00001);
 +    assertTrue(wordAlignment.isEmpty());
 +  }
 +
 +  @Test
 +  public void givenOOVInput_whenStructuredOutputFormat_thenOOVOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = true;
 +    final String input = "gabarbl";
 +
 +    // WHEN
 +    final Translation translation = decode(input);
 +    final StructuredTranslation structuredTranslation = translation.getStructuredTranslations().get(0);
 +    final String translationString = structuredTranslation.getTranslationString();
 +    final List<String> translatedTokens = structuredTranslation.getTranslationTokens();
 +    final float translationScore = structuredTranslation.getTranslationScore();
 +    final List<List<Integer>> wordAlignment = structuredTranslation.getTranslationWordAlignments();
 +
 +    // THEN
 +    assertEquals(input, translationString);
 +    assertTrue(translatedTokens.contains(input));
 +    assertEquals(-99.0, translationScore, 0.00001);
 +    assertTrue(wordAlignment.contains(asList(0)));
 +  }
 +
 +  @Test
 +  public void givenEmptyInput_whenRegularOutputFormat_thenNewlineOutput() {
 +    // GIVEN
 +    joshuaConfig.use_structured_output = false;
 +    joshuaConfig.outputFormat = "%s";
 +
 +    // WHEN
 +    final Translation translation = decode("");
 +    final String translationString = translation.toString();
 +
 +    // THEN
 +    assertEquals("\n", translationString);
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/config
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/config
index 7bdb804,0000000..2251fe6
mode 100644,000000..100644
--- a/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/config
+++ b/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/config
@@@ -1,2 -1,0 +1,2 @@@
- version = 3
- max-source-len = 4
++version = 4
++max-source-len = 3

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.features
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.features
index c4127ff,0000000..27fa07d
mode 100644,000000..100644
Binary files differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.source
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.source
index 83d47dc,0000000..cdc98f6
mode 100644,000000..100644
Binary files differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.target
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.target
index 8094eef,0000000..fa82c0d
mode 100644,000000..100644
Binary files differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.target.lookup
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/slice_00000.target.lookup
index 1c6db18,0000000..3e8c294
mode 100644,000000..100644
Binary files differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/vocabulary
----------------------------------------------------------------------
diff --cc joshua-core/src/test/resources/decoder/phrase/decode/rules.packed/vocabulary
index e9b0900,0000000..ff62042
mode 100644,000000..100644
Binary files differ

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/pom.xml
----------------------------------------------------------------------
diff --cc pom.xml
index 879512c,36a14f0..9863027
--- a/pom.xml
+++ b/pom.xml
@@@ -132,34 -119,161 +134,33 @@@
      <pluginManagement>
        <plugins>
          <plugin>
 -          <groupId>org.codehaus.mojo</groupId>
 -          <artifactId>findbugs-maven-plugin</artifactId>
 -          <version>${findbugs.version}</version>
 +          <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
 -            <xmlOutput>true</xmlOutput>
 -            <effort>Max</effort>
 -            <failOnError>true</failOnError>
 -            <includeTests>true</includeTests>
 -            <maxRank>16</maxRank>
 +            <source>1.8</source>
 +            <target>1.8</target>
            </configuration>
          </plugin>
 +        <plugin>
 +          <groupId>org.apache.rat</groupId>
 +          <artifactId>apache-rat-plugin</artifactId>
 +          <executions>
 +            <execution>
 +              <phase>test</phase>
 +              <goals>
 +                <goal>check</goal>
 +              </goals>
 +              <configuration>
 +                <includes>
 +                  <include>src/main/java</include>
 +                  <include>src/main/resources</include>
 +                  <include>src/test/java</include>
 +                  <include>pom.xml</include>
 +                </includes>
 +              </configuration>
 +            </execution>
 +          </executions>
 +        </plugin>
        </plugins>
      </pluginManagement>
 -
 -    <plugins>
 -      <plugin>
 -        <artifactId>maven-compiler-plugin</artifactId>
 -        <configuration>
 -          <source>1.8</source>
 -          <target>1.8</target>
 -        </configuration>
 -      </plugin>
 -      <plugin>
 -        <artifactId>maven-assembly-plugin</artifactId>
 -        <configuration>
 -          <archive>
 -            <manifest>
 -              <mainClass>org.apache.joshua.decoder.JoshuaDecoder</mainClass>
 -            </manifest>
 -          </archive>
 -          <descriptorRefs>
 -            <descriptorRef>jar-with-dependencies</descriptorRef>
 -          </descriptorRefs>
 -        </configuration>
 -      </plugin>
 -      <plugin>
 -        <artifactId>maven-surefire-plugin</artifactId>
 -        <version>2.19.1</version>
 -        <configuration>
 -          <forkMode>once</forkMode>
 -          <argLine>-Djava.library.path=${project.basedir}/lib</argLine>
 -        </configuration>
 -      </plugin>
 -      <plugin>
 -        <groupId>org.apache.rat</groupId>
 -        <artifactId>apache-rat-plugin</artifactId>
 -        <executions>
 -          <execution>
 -            <phase>test</phase>
 -            <goals>
 -              <goal>check</goal>
 -            </goals>
 -            <configuration>
 -              <includes>
 -                <include>src/main/java</include>
 -                <include>src/main/resources</include>
 -                <include>src/test/java</include>
 -                <include>pom.xml</include>
 -              </includes>
 -            </configuration>
 -          </execution>
 -        </executions>
 -      </plugin>
 -      <plugin>
 -        <groupId>org.codehaus.mojo</groupId>
 -        <artifactId>findbugs-maven-plugin</artifactId>
 -        <version>${findbugs.version}</version>
 -      </plugin>
 -    </plugins>
    </build>
 -  <dependencies>
 -    <dependency>
 -      <groupId>edu.berkeley.nlp</groupId>
 -      <artifactId>berkeleylm</artifactId>
 -      <version>1.1.2</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>commons-cli</groupId>
 -      <artifactId>commons-cli</artifactId>
 -      <version>1.2</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>net.sf.jung</groupId>
 -      <artifactId>jung-algorithms</artifactId>
 -      <version>2.0</version>
 -      <optional>true</optional>
 -    </dependency>
 -    <dependency>
 -      <groupId>net.sf.jung</groupId>
 -      <artifactId>jung-api</artifactId>
 -      <version>2.0</version>
 -      <optional>true</optional>
 -    </dependency>
 -    <dependency>
 -      <groupId>net.sf.jung</groupId>
 -      <artifactId>jung-graph-impl</artifactId>
 -      <version>2.0</version>
 -      <optional>true</optional>
 -    </dependency>
 -    <dependency>
 -      <groupId>net.sf.jung</groupId>
 -      <artifactId>jung-visualization</artifactId>
 -      <version>2.0</version>
 -      <optional>true</optional>
 -    </dependency>
 -    <dependency>
 -      <groupId>com.google.guava</groupId>
 -      <artifactId>guava</artifactId>
 -      <version>19.0</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>com.google.code.gson</groupId>
 -      <artifactId>gson</artifactId>
 -      <version>2.5</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>args4j</groupId>
 -      <artifactId>args4j</artifactId>
 -      <version>2.0.29</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>slf4j-api</artifactId>
 -      <version>${slf4j.version}</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>org.slf4j</groupId>
 -      <artifactId>slf4j-log4j12</artifactId>
 -      <version>${slf4j.version}</version>
 -    </dependency>
--
 -    <!-- Test Dependencies -->
 -    <dependency>
 -      <groupId>org.testng</groupId>
 -      <artifactId>testng</artifactId>
 -      <version>6.9.10</version>
 -      <scope>test</scope>
 -    </dependency>
 -    <dependency>
 -      <groupId>org.hamcrest</groupId>
 -      <artifactId>hamcrest-all</artifactId>
 -      <version>1.3</version>
 -    </dependency>
 -    <dependency>
 -      <groupId>org.mockito</groupId>
 -      <artifactId>mockito-core</artifactId>
 -      <version>2.0.52-beta</version>
 -      <scope>test</scope>
 -    </dependency>
 -  </dependencies>
  </project>


[45/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kbest_extraction/output.scores.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/output.scores.gold b/src/test/resources/kbest_extraction/output.scores.gold
deleted file mode 100644
index 2f8b814..0000000
--- a/src/test/resources/kbest_extraction/output.scores.gold
+++ /dev/null
@@ -1,3126 +0,0 @@
-0 ||| A A A A A ||| -195.045
-0 ||| B A A A A ||| -196.045
-0 ||| C A A A A ||| -198.045
-0 ||| A B A A A ||| -199.045
-0 ||| B B A A A ||| -200.045
-0 ||| D A A A A ||| -200.045
-0 ||| A A A A B ||| -201.045
-0 ||| A A A B A ||| -201.045
-0 ||| A A B A A ||| -201.045
-0 ||| A C A A A ||| -201.045
-0 ||| B A A A B ||| -202.045
-0 ||| B A A B A ||| -202.045
-0 ||| B A B A A ||| -202.045
-0 ||| B C A A A ||| -202.045
-0 ||| C B A A A ||| -202.045
-0 ||| A A A C A ||| -203.045
-0 ||| C A A A B ||| -204.045
-0 ||| C A A B A ||| -204.045
-0 ||| B A A C A ||| -204.045
-0 ||| C A B A A ||| -204.045
-0 ||| E A A A A ||| -204.045
-0 ||| C C A A A ||| -204.045
-0 ||| D B A A A ||| -204.045
-0 ||| A A A A C ||| -205.045
-0 ||| A B A B A ||| -205.045
-0 ||| A B A A B ||| -205.045
-0 ||| A A C A A ||| -205.045
-0 ||| A B B A A ||| -205.045
-0 ||| A D A A A ||| -205.045
-0 ||| B A A A C ||| -206.045
-0 ||| B B A A B ||| -206.045
-0 ||| B B A B A ||| -206.045
-0 ||| D A A A B ||| -206.045
-0 ||| B A C A A ||| -206.045
-0 ||| D A A B A ||| -206.045
-0 ||| B B B A A ||| -206.045
-0 ||| C A A C A ||| -206.045
-0 ||| D A B A A ||| -206.045
-0 ||| B D A A A ||| -206.045
-0 ||| D C A A A ||| -206.045
-0 ||| A A B A B ||| -207.045
-0 ||| A A B B A ||| -207.045
-0 ||| A A A B B ||| -207.045
-0 ||| A B A C A ||| -207.045
-0 ||| A C A A B ||| -207.045
-0 ||| A C A B A ||| -207.045
-0 ||| A C B A A ||| -207.045
-0 ||| A A D A A ||| -207.045
-0 ||| C A A A C ||| -208.045
-0 ||| B A A B B ||| -208.045
-0 ||| C B A B A ||| -208.045
-0 ||| B A B A B ||| -208.045
-0 ||| B C A B A ||| -208.045
-0 ||| B C A A B ||| -208.045
-0 ||| B A B B A ||| -208.045
-0 ||| C B A A B ||| -208.045
-0 ||| D A A C A ||| -208.045
-0 ||| C A C A A ||| -208.045
-0 ||| B B A C A ||| -208.045
-0 ||| E B A A A ||| -208.045
-0 ||| B C B A A ||| -208.045
-0 ||| C B B A A ||| -208.045
-0 ||| C D A A A ||| -208.045
-0 ||| B A D A A ||| -208.045
-0 ||| A B A A C ||| -209.045
-0 ||| A A A C B ||| -209.045
-0 ||| A A B C A ||| -209.045
-0 ||| A B C A A ||| -209.045
-0 ||| A C A C A ||| -209.045
-0 ||| A A A D A ||| -209.045
-0 ||| C A A B B ||| -210.045
-0 ||| D A A A C ||| -210.045
-0 ||| C A B A B ||| -210.045
-0 ||| B A A C B ||| -210.045
-0 ||| C C A A B ||| -210.045
-0 ||| D B A A B ||| -210.045
-0 ||| B B A A C ||| -210.045
-0 ||| E A A A B ||| -210.045
-0 ||| D B A B A ||| -210.045
-0 ||| D A C A A ||| -210.045
-0 ||| E A A B A ||| -210.045
-0 ||| B A A D A ||| -210.045
-0 ||| D D A A A ||| -210.045
-0 ||| B C A C A ||| -210.045
-0 ||| C A D A A ||| -210.045
-0 ||| C A B B A ||| -210.045
-0 ||| E A B A A ||| -210.045
-0 ||| C B A C A ||| -210.045
-0 ||| E C A A A ||| -210.045
-0 ||| C C A B A ||| -210.045
-0 ||| B B C A A ||| -210.045
-0 ||| B A B C A ||| -210.045
-0 ||| C C B A A ||| -210.045
-0 ||| D B B A A ||| -210.045
-0 ||| A B A B B ||| -211.045
-0 ||| A B B B A ||| -211.045
-0 ||| A A A B C ||| -211.045
-0 ||| A D A B A ||| -211.045
-0 ||| A C A A C ||| -211.045
-0 ||| A A C B A ||| -211.045
-0 ||| A A C A B ||| -211.045
-0 ||| A C C A A ||| -211.045
-0 ||| A A B A C ||| -211.045
-0 ||| A B D A A ||| -211.045
-0 ||| A A A A D ||| -211.045
-0 ||| A A E A A ||| -211.045
-0 ||| A B B A B ||| -211.045
-0 ||| A E A A A ||| -211.045
-0 ||| A D A A B ||| -211.045
-0 ||| A D B A A ||| -211.045
-0 ||| B D A A B ||| -212.045
-0 ||| C B A A C ||| -212.045
-0 ||| B B B B A ||| -212.045
-0 ||| B A C A B ||| -212.045
-0 ||| D A A B B ||| -212.045
-0 ||| E A A C A ||| -212.045
-0 ||| B B A B B ||| -212.045
-0 ||| C A A D A ||| -212.045
-0 ||| B A A B C ||| -212.045
-0 ||| D C A B A ||| -212.045
-0 ||| B C A A C ||| -212.045
-0 ||| D B A C A ||| -212.045
-0 ||| B A A A D ||| -212.045
-0 ||| B A C B A ||| -212.045
-0 ||| D C A A B ||| -212.045
-0 ||| D A B B A ||| -212.045
-0 ||| B B B A B ||| -212.045
-0 ||| B D A B A ||| -212.045
-0 ||| C A A C B ||| -212.045
-0 ||| B A E A A ||| -212.045
-0 ||| B A B A C ||| -212.045
-0 ||| C C A C A ||| -212.045
-0 ||| D A B A B ||| -212.045
-0 ||| B C C A A ||| -212.045
-0 ||| C A B C A ||| -212.045
-0 ||| B E A A A ||| -212.045
-0 ||| D A D A A ||| -212.045
-0 ||| C B C A A ||| -212.045
-0 ||| B B D A A ||| -212.045
-0 ||| D C B A A ||| -212.045
-0 ||| B D B A A ||| -212.045
-0 ||| A C B A B ||| -213.045
-0 ||| A A D A B ||| -213.045
-0 ||| A A B B B ||| -213.045
-0 ||| A A A C C ||| -213.045
-0 ||| A B A C B ||| -213.045
-0 ||| A C A B B ||| -213.045
-0 ||| A B B C A ||| -213.045
-0 ||| A A A E A ||| -213.045
-0 ||| A C B B A ||| -213.045
-0 ||| A A D B A ||| -213.045
-0 ||| A B A D A ||| -213.045
-0 ||| A D A C A ||| -213.045
-0 ||| A A C C A ||| -213.045
-0 ||| A C D A A ||| -213.045
-0 ||| B C A B B ||| -214.045
-0 ||| B A B B B ||| -214.045
-0 ||| B C B A B ||| -214.045
-0 ||| C B B A B ||| -214.045
-0 ||| E B A A B ||| -214.045
-0 ||| C A A B C ||| -214.045
-0 ||| D A A C B ||| -214.045
-0 ||| C A C A B ||| -214.045
-0 ||| B B A C B ||| -214.045
-0 ||| C A B A C ||| -214.045
-0 ||| C D A A B ||| -214.045
-0 ||| B A D A B ||| -214.045
-0 ||| C B A B B ||| -214.045
-0 ||| E A A A C ||| -214.045
-0 ||| D B A A C ||| -214.045
-0 ||| C A A A D ||| -214.045
-0 ||| D A B C A ||| -214.045
-0 ||| C C A A C ||| -214.045
-0 ||| B A A C C ||| -214.045
-0 ||| B A D B A ||| -214.045
-0 ||| B A C C A ||| -214.045
-0 ||| B B B C A ||| -214.045
-0 ||| D C A C A ||| -214.045
-0 ||| D A A D A ||| -214.045
-0 ||| B B A D A ||| -214.045
-0 ||| C A C B A ||| -214.045
-0 ||| B A A E A ||| -214.045
-0 ||| C C C A A ||| -214.045
-0 ||| B D A C A ||| -214.045
-0 ||| E B A B A ||| -214.045
-0 ||| E B B A A ||| -214.045
-0 ||| B C B B A ||| -214.045
-0 ||| C B B B A ||| -214.045
-0 ||| C A E A A ||| -214.045
-0 ||| C D A B A ||| -214.045
-0 ||| C D B A A ||| -214.045
-0 ||| B C D A A ||| -214.045
-0 ||| E D A A A ||| -214.045
-0 ||| D B C A A ||| -214.045
-0 ||| C E A A A ||| -214.045
-0 ||| E A C A A ||| -214.045
-0 ||| C B D A A ||| -214.045
-0 ||| A B C A B ||| -215.045
-0 ||| A B B A C ||| -215.045
-0 ||| A D A A C ||| -215.045
-0 ||| A A C A C ||| -215.045
-0 ||| A B A B C ||| -215.045
-0 ||| A A B C B ||| -215.045
-0 ||| A C A C B ||| -215.045
-0 ||| A B A A D ||| -215.045
-0 ||| A A A D B ||| -215.045
-0 ||| A B C B A ||| -215.045
-0 ||| A C A D A ||| -215.045
-0 ||| A A D C A ||| -215.045
-0 ||| A C B C A ||| -215.045
-0 ||| A A B D A ||| -215.045
-0 ||| A B E A A ||| -215.045
-0 ||| A D C A A ||| -215.045
-0 ||| B B C A B ||| -216.045
-0 ||| E C A A B ||| -216.045
-0 ||| C C A B B ||| -216.045
-0 ||| B A B C B ||| -216.045
-0 ||| C C B B A ||| -216.045
-0 ||| C C B A B ||| -216.045
-0 ||| D B B A B ||| -216.045
-0 ||| E A A B B ||| -216.045
-0 ||| D A C B A ||| -216.045
-0 ||| B A C A C ||| -216.045
-0 ||| D A C A B ||| -216.045
-0 ||| D D A B A ||| -216.045
-0 ||| D A B A C ||| -216.045
-0 ||| B D A A C ||| -216.045
-0 ||| C C D A A ||| -216.045
-0 ||| D B A B B ||| -216.045
-0 ||| B A B D A ||| -216.045
-0 ||| B A A D B ||| -216.045
-0 ||| C A D B A ||| -216.045
-0 ||| B B A A D ||| -216.045
-0 ||| E A B B A ||| -216.045
-0 ||| D A A A D ||| -216.045
-0 ||| D C C A A ||| -216.045
-0 ||| D A A B C ||| -216.045
-0 ||| E C A B A ||| -216.045
-0 ||| C A D A B ||| -216.045
-0 ||| B B C B A ||| -216.045
-0 ||| B C A C B ||| -216.045
-0 ||| B D C A A ||| -216.045
-0 ||| C A B B B ||| -216.045
-0 ||| C D A C A ||| -216.045
-0 ||| D D A A B ||| -216.045
-0 ||| D B B B A ||| -216.045
-0 ||| C A A C C ||| -216.045
-0 ||| D D B A A ||| -216.045
-0 ||| B B A B C ||| -216.045
-0 ||| B A D C A ||| -216.045
-0 ||| C B A C B ||| -216.045
-0 ||| C A A E A ||| -216.045
-0 ||| E A B A B ||| -216.045
-0 ||| D B D A A ||| -216.045
-0 ||| D C A A C ||| -216.045
-0 ||| B C A D A ||| -216.045
-0 ||| B B B A C ||| -216.045
-0 ||| D E A A A ||| -216.045
-0 ||| C A C C A ||| -216.045
-0 ||| E A D A A ||| -216.045
-0 ||| C B B C A ||| -216.045
-0 ||| E C B A A ||| -216.045
-0 ||| B C B C A ||| -216.045
-0 ||| B B E A A ||| -216.045
-0 ||| C B A D A ||| -216.045
-0 ||| D A E A A ||| -216.045
-0 ||| E B A C A ||| -216.045
-0 ||| A D B A B ||| -217.045
-0 ||| A A C B B ||| -217.045
-0 ||| A C A B C ||| -217.045
-0 ||| A B B B B ||| -217.045
-0 ||| A B A C C ||| -217.045
-0 ||| A B D A B ||| -217.045
-0 ||| A A E A B ||| -217.045
-0 ||| A C C A B ||| -217.045
-0 ||| A E A A B ||| -217.045
-0 ||| A D A B B ||| -217.045
-0 ||| A A B B C ||| -217.045
-0 ||| A B D B A ||| -217.045
-0 ||| A A D A C ||| -217.045
-0 ||| A C B A C ||| -217.045
-0 ||| A B C C A ||| -217.045
-0 ||| A A A B D ||| -217.045
-0 ||| A C C B A ||| -217.045
-0 ||| A A B A D ||| -217.045
-0 ||| A D D A A ||| -217.045
-0 ||| A C A A D ||| -217.045
-0 ||| A D B B A ||| -217.045
-0 ||| A E A B A ||| -217.045
-0 ||| A C E A A ||| -217.045
-0 ||| A A E B A ||| -217.045
-0 ||| A E B A A ||| -217.045
-0 ||| A B A E A ||| -217.045
-0 ||| B B B B B ||| -218.045
-0 ||| E A A C B ||| -218.045
-0 ||| D C A B B ||| -218.045
-0 ||| B C A B C ||| -218.045
-0 ||| B D A B B ||| -218.045
-0 ||| B E A A B ||| -218.045
-0 ||| D A B B B ||| -218.045
-0 ||| B A E A B ||| -218.045
-0 ||| B A C B B ||| -218.045
-0 ||| B C B A C ||| -218.045
-0 ||| C C A C B ||| -218.045
-0 ||| C A B C B ||| -218.045
-0 ||| C A A D B ||| -218.045
-0 ||| D B A C B ||| -218.045
-0 ||| B C C A B ||| -218.045
-0 ||| B B C C A ||| -218.045
-0 ||| B A B B C ||| -218.045
-0 ||| B B D A B ||| -218.045
-0 ||| C B C A B ||| -218.045
-0 ||| C B E A A ||| -218.045
-0 ||| C B A A D ||| -218.045
-0 ||| D A D A B ||| -218.045
-0 ||| D C B A B ||| -218.045
-0 ||| E A B C A ||| -218.045
-0 ||| B D B A B ||| -218.045
-0 ||| E C A C A ||| -218.045
-0 ||| C B A B C ||| -218.045
-0 ||| B A E B A ||| -218.045
-0 ||| D A A C C ||| -218.045
-0 ||| D A C C A ||| -218.045
-0 ||| C B B A C ||| -218.045
-0 ||| C C B C A ||| -218.045
-0 ||| E B A A C ||| -218.045
-0 ||| C A B D A ||| -218.045
-0 ||| B A D A C ||| -218.045
-0 ||| C A D C A ||| -218.045
-0 ||| B B A C C ||| -218.045
-0 ||| C D C A A ||| -218.045
-0 ||| C A C A C ||| -218.045
-0 ||| D D A C A ||| -218.045
-0 ||| C D A A C ||| -218.045
-0 ||| B B D B A ||| -218.045
-0 ||| B A B A D ||| -218.045
-0 ||| E B C A A ||| -218.045
-0 ||| B C A A D ||| -218.045
-0 ||| D A D B A ||| -218.045
-0 ||| B A A B D ||| -218.045
-0 ||| B E A B A ||| -218.045
-0 ||| D C D A A ||| -218.045
-0 ||| D B B C A ||| -218.045
-0 ||| D B A D A ||| -218.045
-0 ||| E A A D A ||| -218.045
-0 ||| B D D A A ||| -218.045
-0 ||| C B C B A ||| -218.045
-0 ||| B C E A A ||| -218.045
-0 ||| B C C B A ||| -218.045
-0 ||| B E B A A ||| -218.045
-0 ||| C C A D A ||| -218.045
-0 ||| B D B B A ||| -218.045
-0 ||| D A A E A ||| -218.045
-0 ||| D C B B A ||| -218.045
-0 ||| B B A E A ||| -218.045
-0 ||| A B B C B ||| -219.045
-0 ||| A A A C D ||| -219.045
-0 ||| A B A D B ||| -219.045
-0 ||| A A A D C ||| -219.045
-0 ||| A C D A B ||| -219.045
-0 ||| A C A C C ||| -219.045
-0 ||| A A A E B ||| -219.045
-0 ||| A C B B B ||| -219.045
-0 ||| A A D B B ||| -219.045
-0 ||| A A C C B ||| -219.045
-0 ||| A D A C B ||| -219.045
-0 ||| A A B E A ||| -219.045
-0 ||| A A A A E ||| -219.045
-0 ||| A B C A C ||| -219.045
-0 ||| A D B C A ||| -219.045
-0 ||| A A B C C ||| -219.045
-0 ||| A E A C A ||| -219.045
-0 ||| A B D C A ||| -219.045
-0 ||| A C C C A ||| -219.045
-0 ||| A C D B A ||| -219.045
-0 ||| A A C D A ||| -219.045
-0 ||| A D A D A ||| -219.045
-0 ||| A B B D A ||| -219.045
-0 ||| A A E C A ||| -219.045
-0 ||| A C A E A ||| -219.045
-0 ||| E A A B C ||| -220.045
-0 ||| D C A C B ||| -220.045
-0 ||| D A C A C ||| -220.045
-0 ||| B B B C B ||| -220.045
-0 ||| B A C C B ||| -220.045
-0 ||| B A D B B ||| -220.045
-0 ||| B A B C C ||| -220.045
-0 ||| C C B A C ||| -220.045
-0 ||| B A A C D ||| -220.045
-0 ||| D A A D B ||| -220.045
-0 ||| E B B A B ||| -220.045
-0 ||| C C A B C ||| -220.045
-0 ||| B C A C C ||| -220.045
-0 ||| C A B A D ||| -220.045
-0 ||| C A A B D ||| -220.045
-0 ||| C C A A D ||| -220.045
-0 ||| D B B A C ||| -220.045
-0 ||| E C A A C ||| -220.045
-0 ||| B B C A C ||| -220.045
-0 ||| B A A D C ||| -220.045
-0 ||| E A A A D ||| -220.045
-0 ||| B B A D B ||| -220.045
-0 ||| C A D A C ||| -220.045
-0 ||| D A B C B ||| -220.045
-0 ||| D C B C A ||| -220.045
-0 ||| D B A B C ||| -220.045
-0 ||| D B A A D ||| -220.045
-0 ||| E B A B B ||| -220.045
-0 ||| C A C B B ||| -220.045
-0 ||| B A C D A ||| -220.045
-0 ||| B D A C B ||| -220.045
-0 ||| C C C A B ||| -220.045
-0 ||| B A A E B ||| -220.045
-0 ||| B A E C A ||| -220.045
-0 ||| D B C A B ||| -220.045
-0 ||| C A E A B ||| -220.045
-0 ||| B A B E A ||| -220.045
-0 ||| C B B B B ||| -220.045
-0 ||| B C B B B ||| -220.045
-0 ||| C D B B A ||| -220.045
-0 ||| D D A A C ||| -220.045
-0 ||| E D A A B ||| -220.045
-0 ||| B B D C A ||| -220.045
-0 ||| C D A B B ||| -220.045
-0 ||| C A B B C ||| -220.045
-0 ||| B D B C A ||| -220.045
-0 ||| B C D A B ||| -220.045
-0 ||| C D B A B ||| -220.045
-0 ||| D A D C A ||| -220.045
-0 ||| E A B A C ||| -220.045
-0 ||| B A A A E ||| -220.045
-0 ||| D A B D A ||| -220.045
-0 ||| C E A A B ||| -220.045
-0 ||| C B A C C ||| -220.045
-0 ||| B E A C A ||| -220.045
-0 ||| C B D A B ||| -220.045
-0 ||| E A C A B ||| -220.045
-0 ||| C B C C A ||| -220.045
-0 ||| E B D A A ||| -220.045
-0 ||| C A E B A ||| -220.045
-0 ||| E D B A A ||| -220.045
-0 ||| C B A E A ||| -220.045
-0 ||| E E A A A ||| -220.045
-0 ||| B C C C A ||| -220.045
-0 ||| D B E A A ||| -220.045
-0 ||| B B B D A ||| -220.045
-0 ||| C D D A A ||| -220.045
-0 ||| D C A D A ||| -220.045
-0 ||| D D C A A ||| -220.045
-0 ||| C C C B A ||| -220.045
-0 ||| C C E A A ||| -220.045
-0 ||| E B B B A ||| -220.045
-0 ||| C E B A A ||| -220.045
-0 ||| B C D B A ||| -220.045
-0 ||| E C C A A ||| -220.045
-0 ||| C E A B A ||| -220.045
-0 ||| E A E A A ||| -220.045
-0 ||| B C A E A ||| -220.045
-0 ||| D B C B A ||| -220.045
-0 ||| E D A B A ||| -220.045
-0 ||| E A C B A ||| -220.045
-0 ||| C B D B A ||| -220.045
-0 ||| B D A D A ||| -220.045
-0 ||| A E A A C ||| -221.045
-0 ||| A B B A D ||| -221.045
-0 ||| A A B D B ||| -221.045
-0 ||| A B B B C ||| -221.045
-0 ||| A A E A C ||| -221.045
-0 ||| A D B A C ||| -221.045
-0 ||| A A C B C ||| -221.045
-0 ||| A C B C B ||| -221.045
-0 ||| A B D A C ||| -221.045
-0 ||| A D A B C ||| -221.045
-0 ||| A C C A C ||| -221.045
-0 ||| A B E A B ||| -221.045
-0 ||| A A D C B ||| -221.045
-0 ||| A C A D B ||| -221.045
-0 ||| A B C B B ||| -221.045
-0 ||| A A C A D ||| -221.045
-0 ||| A D C A B ||| -221.045
-0 ||| A B A B D ||| -221.045
-0 ||| A D C B A ||| -221.045
-0 ||| A D A A D ||| -221.045
-0 ||| A B E B A ||| -221.045
-0 ||| A C D C A ||| -221.045
-0 ||| A E C A A ||| -221.045
-0 ||| A C B D A ||| -221.045
-0 ||| A D E A A ||| -221.045
-0 ||| A A D D A ||| -221.045
-0 ||| D C B A C ||| -222.045
-0 ||| C C D A B ||| -222.045
-0 ||| B A B D B ||| -222.045
-0 ||| B B C B B ||| -222.045
-0 ||| C A D B B ||| -222.045
-0 ||| E A B B B ||| -222.045
-0 ||| E C A B B ||| -222.045
-0 ||| B D A A D ||| -222.045
-0 ||| D C C A B ||| -222.045
-0 ||| D B D A B ||| -222.045
-0 ||| D D B A B ||| -222.045
-0 ||| D B B B B ||| -222.045
-0 ||| E C B A B ||| -222.045
-0 ||| C A A E B ||| -222.045
-0 ||| B A D C B ||| -222.045
-0 ||| C B B C B ||| -222.045
-0 ||| B B B A D ||| -222.045
-0 ||| B C A D B ||| -222.045
-0 ||| E A D A B ||| -222.045
-0 ||| D E A A B ||| -222.045
-0 ||| C A C C B ||| -222.045
-0 ||| C B A D B ||| -222.045
-0 ||| B B E A B ||| -222.045
-0 ||| B C B C B ||| -222.045
-0 ||| D A E A B ||| -222.045
-0 ||| E B A C B ||| -222.045
-0 ||| D C A B C ||| -222.045
-0 ||| C A B C C ||| -222.045
-0 ||| E A A C C ||| -222.045
-0 ||| B B B B C ||| -222.045
-0 ||| B A E A C ||| -222.045
-0 ||| B D A B C ||| -222.045
-0 ||| C C A C C ||| -222.045
-0 ||| D A B B C ||| -222.045
-0 ||| B E A A C ||| -222.045
-0 ||| B A C B C ||| -222.045
-0 ||| D A D A C ||| -222.045
-0 ||| B D B A C ||| -222.045
-0 ||| C A A D C ||| -222.045
-0 ||| B C C A C ||| -222.045
-0 ||| D B A C C ||| -222.045
-0 ||| C B C A C ||| -222.045
-0 ||| B A C A D ||| -222.045
-0 ||| B B D A C ||| -222.045
-0 ||| D A B A D ||| -222.045
-0 ||| D D A B B ||| -222.045
-0 ||| D A C B B ||| -222.045
-0 ||| B D C A B ||| -222.045
-0 ||| D C A A D ||| -222.045
-0 ||| C C B B B ||| -222.045
-0 ||| D A A B D ||| -222.045
-0 ||| B B A B D ||| -222.045
-0 ||| C A A A E ||| -222.045
-0 ||| C A A C D ||| -222.045
-0 ||| C D A C B ||| -222.045
-0 ||| B A D D A ||| -222.045
-0 ||| C C D B A ||| -222.045
-0 ||| D C C B A ||| -222.045
-0 ||| E A D B A ||| -222.045
-0 ||| B D C B A ||| -222.045
-0 ||| D E A B A ||| -222.045
-0 ||| E C B B A ||| -222.045
-0 ||| B B E B A ||| -222.045
-0 ||| E B A D A ||| -222.045
-0 ||| D A E B A ||| -222.045
-0 ||| C A B E A ||| -222.045
-0 ||| E A A E A ||| -222.045
-0 ||| D B D B A ||| -222.045
-0 ||| C A E C A ||| -222.045
-0 ||| C C A E A ||| -222.045
-0 ||| C B D C A ||| -222.045
-0 ||| B C D C A ||| -222.045
-0 ||| E B B C A ||| -222.045
-0 ||| C D A D A ||| -222.045
-0 ||| D D D A A ||| -222.045
-0 ||| C D B C A ||| -222.045
-0 ||| E C D A A ||| -222.045
-0 ||| E A C C A ||| -222.045
-0 ||| B E C A A ||| -222.045
-0 ||| D B A E A ||| -222.045
-0 ||| D E B A A ||| -222.045
-0 ||| D D B B A ||| -222.045
-0 ||| B D E A A ||| -222.045
-0 ||| E D A C A ||| -222.045
-0 ||| D C E A A ||| -222.045
-0 ||| C E A C A ||| -222.045
-0 ||| B C B D A ||| -222.045
-0 ||| D B C C A ||| -222.045
-0 ||| C B B D A ||| -222.045
-0 ||| C A C D A ||| -222.045
-0 ||| C C C C A ||| -222.045
-0 ||| A C A B D ||| -223.045
-0 ||| A D B B B ||| -223.045
-0 ||| A D D A B ||| -223.045
-0 ||| A B C C B ||| -223.045
-0 ||| A E B B A ||| -223.045
-0 ||| A C C B B ||| -223.045
-0 ||| A A B B D ||| -223.045
-0 ||| A D C C A ||| -223.045
-0 ||| A B D B B ||| -223.045
-0 ||| A A E B B ||| -223.045
-0 ||| A C E B A ||| -223.045
-0 ||| A C E A B ||| -223.045
-0 ||| A E B A B ||| -223.045
-0 ||| A D D B A ||| -223.045
-0 ||| A B A E B ||| -223.045
-0 ||| A B E C A ||| -223.045
-0 ||| A A D A D ||| -223.045
-0 ||| A E D A A ||| -223.045
-0 ||| A B A A E ||| -223.045
-0 ||| A A C E A ||| -223.045
-0 ||| A C B B C ||| -223.045
-0 ||| A B B E A ||| -223.045
-0 ||| A C D A C ||| -223.045
-0 ||| A D A E A ||| -223.045
-0 ||| A B A D C ||| -223.045
-0 ||| A B C D A ||| -223.045
-0 ||| A A A E C ||| -223.045
-0 ||| A B A C D ||| -223.045
-0 ||| A E A B B ||| -223.045
-0 ||| A C B A D ||| -223.045
-0 ||| A A D B C ||| -223.045
-0 ||| A B B C C ||| -223.045
-0 ||| A D A C C ||| -223.045
-0 ||| A A C C C ||| -223.045
-0 ||| B B B C C ||| -224.045
-0 ||| D A C C B ||| -224.045
-0 ||| D C B B B ||| -224.045
-0 ||| B A E B B ||| -224.045
-0 ||| E A C A C ||| -224.045
-0 ||| D C D B A ||| -224.045
-0 ||| E C A C B ||| -224.045
-0 ||| D D A C B ||| -224.045
-0 ||| C C D C A ||| -224.045
-0 ||| B B C C B ||| -224.045
-0 ||| D A A E B ||| -224.045
-0 ||| E B C B A ||| -224.045
-0 ||| C D C A B ||| -224.045
-0 ||| B C A B D ||| -224.045
-0 ||| C C B D A ||| -224.045
-0 ||| C A D C B ||| -224.045
-0 ||| B C B A D ||| -224.045
-0 ||| C D C B A ||| -224.045
-0 ||| C B E A B ||| -224.045
-0 ||| C A B D B ||| -224.045
-0 ||| B B E C A ||| -224.045
-0 ||| C C B C B ||| -224.045
-0 ||| D C A C C ||| -224.045
-0 ||| C B E B A ||| -224.045
-0 ||| B D B B B ||| -224.045
-0 ||| E B C A B ||| -224.045
-0 ||| E A D C A ||| -224.045
-0 ||| D B B C B ||| -224.045
-0 ||| B A B B D ||| -224.045
-0 ||| B B C D A ||| -224.045
-0 ||| B B D B B ||| -224.045
-0 ||| D A D B B ||| -224.045
-0 ||| D C C C A ||| -224.045
-0 ||| D C D A B ||| -224.045
-0 ||| B E A B B ||| -224.045
-0 ||| E C B C A ||| -224.045
-0 ||| C C A D B ||| -224.045
-0 ||| B D D A B ||| -224.045
-0 ||| D A C D A ||| -224.045
-0 ||| E A A D B ||| -224.045
-0 ||| D B A D B ||| -224.045
-0 ||| E C A D A ||| -224.045
-0 ||| B E B A B ||| -224.045
-0 ||| C B C B B ||| -224.045
-0 ||| E A B D A ||| -224.045
-0 ||| B C E A B ||| -224.045
-0 ||| D E A C A ||| -224.045
-0 ||| E A B C B ||| -224.045
-0 ||| B D D B A ||| -224.045
-0 ||| B B A E B ||| -224.045
-0 ||| B D C C A ||| -224.045
-0 ||| B B A C D ||| -224.045
-0 ||| B B B E A ||| -224.045
-0 ||| B C C B B ||| -224.045
-0 ||| B D A E A ||| -224.045
-0 ||| C B A B D ||| -224.045
-0 ||| D A E C A ||| -224.045
-0 ||| C A C A D ||| -224.045
-0 ||| D B D C A ||| -224.045
-0 ||| E B B A C ||| -224.045
-0 ||| B C E B A ||| -224.045
-0 ||| D A A C D ||| -224.045
-0 ||| C D E A A ||| -224.045
-0 ||| B A D A D ||| -224.045
-0 ||| D B B D A ||| -224.045
-0 ||| B A C C C ||| -224.045
-0 ||| E D C A A ||| -224.045
-0 ||| D A A D C ||| -224.045
-0 ||| D D A D A ||| -224.045
-0 ||| C B B A D ||| -224.045
-0 ||| C E C A A ||| -224.045
-0 ||| B A D B C ||| -224.045
-0 ||| D A B E A ||| -224.045
-0 ||| E B A A D ||| -224.045
-0 ||| E B E A A ||| -224.045
-0 ||| B B A D C ||| -224.045
-0 ||| D C A E A ||| -224.045
-0 ||| E B A B C ||| -224.045
-0 ||| B E D A A ||| -224.045
-0 ||| B D A C C ||| -224.045
-0 ||| B E B B A ||| -224.045
-0 ||| D A B C C ||| -224.045
-0 ||| B A C E A ||| -224.045
-0 ||| C D A B C ||| -224.045
-0 ||| D D B C A ||| -224.045
-0 ||| C A C B C ||| -224.045
-0 ||| C A D D A ||| -224.045
-0 ||| C E A A C ||| -224.045
-0 ||| D A A A E ||| -224.045
-0 ||| C B B B C ||| -224.045
-0 ||| B A A E C ||| -224.045
-0 ||| C D A A D ||| -224.045
-0 ||| C C C A C ||| -224.045
-0 ||| E D A A C ||| -224.045
-0 ||| C A E A C ||| -224.045
-0 ||| D B C A C ||| -224.045
-0 ||| B C B B C ||| -224.045
-0 ||| B B A A E ||| -224.045
-0 ||| B C D A C ||| -224.045
-0 ||| C D B A C ||| -224.045
-0 ||| C B D A C ||| -224.045
-0 ||| A C D B B ||| -225.045
-0 ||| A A B C D ||| -225.045
-0 ||| A C C C B ||| -225.045
-0 ||| A A C D B ||| -225.045
-0 ||| A D A D B ||| -225.045
-0 ||| A E A C B ||| -225.045
-0 ||| A B D C B ||| -225.045
-0 ||| A B B D B ||| -225.045
-0 ||| A A E D A ||| -225.045
-0 ||| A A E C B ||| -225.045
-0 ||| A C A E B ||| -225.045
-0 ||| A A B A E ||| -225.045
-0 ||| A C E C A ||| -225.045
-0 ||| A A A D D ||| -225.045
-0 ||| A D D C A ||| -225.045
-0 ||| A A B E B ||| -225.045
-0 ||| A A D E A ||| -225.045
-0 ||| A C A C D ||| -225.045
-0 ||| A C C D A ||| -225.045
-0 ||| A B C A D ||| -225.045
-0 ||| A D B D A ||| -225.045
-0 ||| A D B C B ||| -225.045
-0 ||| A E A D A ||| -225.045
-0 ||| A C A A E ||| -225.045
-0 ||| A C B E A ||| -225.045
-0 ||| A D C A C ||| -225.045
-0 ||| A B D D A ||| -225.045
-0 ||| A A A B E ||| -225.045
-0 ||| A E B C A ||| -225.045
-0 ||| A A B D C ||| -225.045
-0 ||| A C A D C ||| -225.045
-0 ||| A C B C C ||| -225.045
-0 ||| A A D C C ||| -225.045
-0 ||| A B E A C ||| -225.045
-0 ||| A B C B C ||| -225.045
-0 ||| C C E A B ||| -226.045
-0 ||| B B C B C ||| -226.045
-0 ||| B A B D C ||| -226.045
-0 ||| C C D A C ||| -226.045
-0 ||| D C C A C ||| -226.045
-0 ||| C B B C C ||| -226.045
-0 ||| E A B B C ||| -226.045
-0 ||| E C A B C ||| -226.045
-0 ||| B C C C B ||| -226.045
-0 ||| B A D C C ||| -226.045
-0 ||| C B A D C ||| -226.045
-0 ||| D B D A C ||| -226.045
-0 ||| D D B A C ||| -226.045
-0 ||| D B B B C ||| -226.045
-0 ||| C A A E C ||| -226.045
-0 ||| E C B A C ||| -226.045
-0 ||| C D A C C ||| -226.045
-0 ||| C A C C C ||| -226.045
-0 ||| B C A D C ||| -226.045
-0 ||| E E A A B ||| -226.045
-0 ||| C B A E B ||| -226.045
-0 ||| D E A A C ||| -226.045
-0 ||| E A D A C ||| -226.045
-0 ||| C B C C B ||| -226.045
-0 ||| E B D A B ||| -226.045
-0 ||| B B E A C ||| -226.045
-0 ||| D B E A B ||| -226.045
-0 ||| C D D A B ||| -226.045
-0 ||| B C B C C ||| -226.045
-0 ||| C A E B B ||| -226.045
-0 ||| B B B D B ||| -226.045
-0 ||| C C C B B ||| -226.045
-0 ||| D A C A D ||| -226.045
-0 ||| D A E A C ||| -226.045
-0 ||| C B A A E ||| -226.045
-0 ||| C A D B C ||| -226.045
-0 ||| E D B A B ||| -226.045
-0 ||| E B A C C ||| -226.045
-0 ||| D C D C A ||| -226.045
-0 ||| D D C A B ||| -226.045
-0 ||| B A A B E ||| -226.045
-0 ||| E A A B D ||| -226.045
-0 ||| E B A E A ||| -226.045
-0 ||| D C A D B ||| -226.045
-0 ||| D A D D A ||| -226.045
-0 ||| C C A B D ||| -226.045
-0 ||| E D B B A ||| -226.045
-0 ||| B A C D B ||| -226.045
-0 ||| B C E C A ||| -226.045
-0 ||| B A B C D ||| -226.045
-0 ||| C D A E A ||| -226.045
-0 ||| C C B A D ||| -226.045
-0 ||| B A D E A ||| -226.045
-0 ||| B B C A D ||| -226.045
-0 ||| C E B B A ||| -226.045
-0 ||| B C A C D ||| -226.045
-0 ||| C A C E A ||| -226.045
-0 ||| E C A A D ||| -226.045
-0 ||| C D C C A ||| -226.045
-0 ||| D B B A D ||| -226.045
-0 ||| E B D B A ||| -226.045
-0 ||| B A E C B ||| -226.045
-0 ||| E B C C A ||| -226.045
-0 ||| C A D A D ||| -226.045
-0 ||| C B E C A ||| -226.045
-0 ||| B A B E B ||| -226.045
-0 ||| E E A B A ||| -226.045
-0 ||| B C D B B ||| -226.045
-0 ||| D B E B A ||| -226.045
-0 ||| B D B C B ||| -226.045
-0 ||| D D C B A ||| -226.045
-0 ||| C D B B B ||| -226.045
-0 ||| C D D B A ||| -226.045
-0 ||| B B D C B ||| -226.045
-0 ||| C C E B A ||| -226.045
-0 ||| B E A C B ||| -226.045
-0 ||| E C C B A ||| -226.045
-0 ||| D A B D B ||| -226.045
-0 ||| B E B C A ||| -226.045
-0 ||| C E B A B ||| -226.045
-0 ||| B D D C A ||| -226.045
-0 ||| D B A B D ||| -226.045
-0 ||| D E C A A ||| -226.045
-0 ||| E B B B B ||| -226.045
-0 ||| B E A D A ||| -226.045
-0 ||| B C A A E ||| -226.045
-0 ||| D D E A A ||| -226.045
-0 ||| E A C B B ||| -226.045
-0 ||| C B B E A ||| -226.045
-0 ||| C E A B B ||| -226.045
-0 ||| E C E A A ||| -226.045
-0 ||| B A B A E ||| -226.045
-0 ||| B B D D A ||| -226.045
-0 ||| E C C A B ||| -226.045
-0 ||| C E D A A ||| -226.045
-0 ||| E D A B B ||| -226.045
-0 ||| C B C D A ||| -226.045
-0 ||| B A A D D ||| -226.045
-0 ||| E E B A A ||| -226.045
-0 ||| E A E A B ||| -226.045
-0 ||| B A E D A ||| -226.045
-0 ||| D B C B B ||| -226.045
-0 ||| E D D A A ||| -226.045
-0 ||| B C A E B ||| -226.045
-0 ||| B C C D A ||| -226.045
-0 ||| B D A D B ||| -226.045
-0 ||| D C B D A ||| -226.045
-0 ||| C B D B B ||| -226.045
-0 ||| B D B D A ||| -226.045
-0 ||| D C B C B ||| -226.045
-0 ||| B C B E A ||| -226.045
-0 ||| D D A A D ||| -226.045
-0 ||| E A E B A ||| -226.045
-0 ||| C A B B D ||| -226.045
-0 ||| E A B A D ||| -226.045
-0 ||| B D C A C ||| -226.045
-0 ||| D A D C B ||| -226.045
-0 ||| D A C B C ||| -226.045
-0 ||| D D A B C ||| -226.045
-0 ||| C C B B C ||| -226.045
-0 ||| C B A C D ||| -226.045
-0 ||| A C E A C ||| -227.045
-0 ||| A B D B C ||| -227.045
-0 ||| A E B A C ||| -227.045
-0 ||| A A E B C ||| -227.045
-0 ||| A D D A C ||| -227.045
-0 ||| A B C C C ||| -227.045
-0 ||| A E C A B ||| -227.045
-0 ||| A A D D B ||| -227.045
-0 ||| A D E A B ||| -227.045
-0 ||| A D B B C ||| -227.045
-0 ||| A C D C B ||| -227.045
-0 ||| A B E B B ||| -227.045
-0 ||| A D E B A ||| -227.045
-0 ||| A D C B B ||| -227.045
-0 ||| A B C E A ||| -227.045
-0 ||| A B A E C ||| -227.045
-0 ||| A E C B A ||| -227.045
-0 ||| A A A C E ||| -227.045
-0 ||| A E E A A ||| -227.045
-0 ||| A A C B D ||| -227.045
-0 ||| A C D D A ||| -227.045
-0 ||| A D B A D ||| -227.045
-0 ||| A E A A D ||| -227.045
-0 ||| A C C B C ||| -227.045
-0 ||| A A E A D ||| -227.045
-0 ||| A B B B D ||| -227.045
-0 ||| A D A B D ||| -227.045
-0 ||| A B D A D ||| -227.045
-0 ||| A C C A D ||| -227.045
-0 ||| A E A B C ||| -227.045
-0 ||| A C B D B ||| -227.045
-0 ||| E C B B B ||| -228.045
-0 ||| E C D A B ||| -228.045
-0 ||| B B E B B ||| -228.045
-0 ||| C A B E B ||| -228.045
-0 ||| E B A D B ||| -228.045
-0 ||| D A E B B ||| -228.045
-0 ||| C B D C B ||| -228.045
-0 ||| E A A E B ||| -228.045
-0 ||| D B D B B ||| -228.045
-0 ||| C D B C B ||| -228.045
-0 ||| C A E C B ||| -228.045
-0 ||| C C A E B ||| -228.045
-0 ||| B C D C B ||| -228.045
-0 ||| D D D A B ||| -228.045
-0 ||| E B B C B ||| -228.045
-0 ||| C D A D B ||| -228.045
-0 ||| B E C A B ||| -228.045
-0 ||| B D E A B ||| -228.045
-0 ||| E A C C B ||| -228.045
-0 ||| D B A E B ||| -228.045
-0 ||| D E B A B ||| -228.045
-0 ||| D D B B B ||| -228.045
-0 ||| B C B D B ||| -228.045
-0 ||| C E A C B ||| -228.045
-0 ||| E D A C B ||| -228.045
-0 ||| D C E A B ||| -228.045
-0 ||| D B C C B ||| -228.045
-0 ||| C A C D B ||| -228.045
-0 ||| D C B A D ||| -228.045
-0 ||| C B B D B ||| -228.045
-0 ||| C C C C B ||| -228.045
-0 ||| D C B B C ||| -228.045
-0 ||| D A C C C ||| -228.045
-0 ||| D C D A C ||| -228.045
-0 ||| C B C B C ||| -228.045
-0 ||| E A A D C ||| -228.045
-0 ||| B A D D B ||| -228.045
-0 ||| D C C B B ||| -228.045
-0 ||| C C D B B ||| -228.045
-0 ||| B D C B B ||| -228.045
-0 ||| B E B A C ||| -228.045
-0 ||| C B C A D ||| -228.045
-0 ||| B D A B D ||| -228.045
-0 ||| E A A C D ||| -228.045
-0 ||| C A B C D ||| -228.045
-0 ||| E C A C C ||| -228.045
-0 ||| D C A B D ||| -228.045
-0 ||| B B C C C ||| -228.045
-0 ||| B A E A D ||| -228.045
-0 ||| D D A C C ||| -228.045
-0 ||| B B B B D ||| -228.045
-0 ||| C D C A C ||| -228.045
-0 ||| D A A E C ||| -228.045
-0 ||| E A D B B ||| -228.045
-0 ||| D B A C D ||| -228.045
-0 ||| B A C B D ||| -228.045
-0 ||| C B E A C ||| -228.045
-0 ||| B D B B C ||| -228.045
-0 ||| D B B C C ||| -228.045
-0 ||| B E A A D ||| -228.045
-0 ||| D A B B D ||| -228.045
-0 ||| D B A D C ||| -228.045
-0 ||| E B C A C ||| -228.045
-0 ||| D E A B B ||| -228.045
-0 ||| B A E B C ||| -228.045
-0 ||| B C C A D ||| -228.045
-0 ||| C C A C D ||| -228.045
-0 ||| C C B C C ||| -228.045
-0 ||| D A D A D ||| -228.045
-0 ||| B B D B C ||| -228.045
-0 ||| E D B C A ||| -228.045
-0 ||| B D D A C ||| -228.045
-0 ||| B E A B C ||| -228.045
-0 ||| C A A D D ||| -228.045
-0 ||| C C A D C ||| -228.045
-0 ||| B D B A D ||| -228.045
-0 ||| B E C B A ||| -228.045
-0 ||| E A B C C ||| -228.045
-0 ||| D D D B A ||| -228.045
-0 ||| B C E A C ||| -228.045
-0 ||| C C E C A ||| -228.045
-0 ||| B B A E C ||| -228.045
-0 ||| D E B B A ||| -228.045
-0 ||| B C C B C ||| -228.045
-0 ||| E A B E A ||| -228.045
-0 ||| B A A C E ||| -228.045
-0 ||| E B B D A ||| -228.045
-0 ||| C A A B E ||| -228.045
-0 ||| D E D A A ||| -228.045
-0 ||| C A B A E ||| -228.045
-0 ||| E C A E A ||| -228.045
-0 ||| C C A A E ||| -228.045
-0 ||| E C D B A ||| -228.045
-0 ||| E A A A E ||| -228.045
-0 ||| B E E A A ||| -228.045
-0 ||| D B A A E ||| -228.045
-0 ||| C C B E A ||| -228.045
-0 ||| C A B D C ||| -228.045
-0 ||| C E B C A ||| -228.045
-0 ||| D A D B C ||| -228.045
-0 ||| D A C E A ||| -228.045
-0 ||| B B D A D ||| -228.045
-0 ||| B B C E A ||| -228.045
-0 ||| C A D C C ||| -228.045
-0 ||| E A E C A ||| -228.045
-0 ||| D B E C A ||| -228.045
-0 ||| B D E B A ||| -228.045
-0 ||| E B D C A ||| -228.045
-0 ||| C A E D A ||| -228.045
-0 ||| C D D C A ||| -228.045
-0 ||| E E A C A ||| -228.045
-0 ||| D D C C A ||| -228.045
-0 ||| D B B E A ||| -228.045
-0 ||| C A D E A ||| -228.045
-0 ||| C B D D A ||| -228.045
-0 ||| E C C C A ||| -228.045
-0 ||| C C C D A ||| -228.045
-0 ||| E A C D A ||| -228.045
-0 ||| C D B D A ||| -228.045
-0 ||| D D A E A ||| -228.045
-0 ||| B C D D A ||| -228.045
-0 ||| D B C D A ||| -228.045
-0 ||| D C E B A ||| -228.045
-0 ||| E D A D A ||| -228.045
-0 ||| C E A D A ||| -228.045
-0 ||| A B E C B ||| -229.045
-0 ||| A A C E B ||| -229.045
-0 ||| A D A E B ||| -229.045
-0 ||| A C B B D ||| -229.045
-0 ||| A C D B C ||| -229.045
-0 ||| A D C C B ||| -229.045
-0 ||| A C C C C ||| -229.045
-0 ||| A A C C D ||| -229.045
-0 ||| A D D B B ||| -229.045
-0 ||| A D A C D ||| -229.045
-0 ||| A B B C D ||| -229.045
-0 ||| A C E B B ||| -229.045
-0 ||| A A C D C ||| -229.045
-0 ||| A B B E B ||| -229.045
-0 ||| A D A D C ||| -229.045
-0 ||| A E A C C ||| -229.045
-0 ||| A B D C C ||| -229.045
-0 ||| A A B E C ||| -229.045
-0 ||| A C D A D ||| -229.045
-0 ||| A A E C C ||| -229.045
-0 ||| A E B B B ||| -229.045
-0 ||| A E D A B ||| -229.045
-0 ||| A B D E A ||| -229.045
-0 ||| A C A E C ||| -229.045
-0 ||| A B A B E ||| -229.045
-0 ||| A D E C A ||| -229.045
-0 ||| A A C A E ||| -229.045
-0 ||| A D B C C ||| -229.045
-0 ||| A C C E A ||| -229.045
-0 ||| A A D B D ||| -229.045
-0 ||| A B B D C ||| -229.045
-0 ||| A A E E A ||| -229.045
-0 ||| A B B A E ||| -229.045
-0 ||| A D A A E ||| -229.045
-0 ||| A D B E A ||| -229.045
-0 ||| A B A D D ||| -229.045
-0 ||| A A A E D ||| -229.045
-0 ||| A B E D A ||| -229.045
-0 ||| A B C D B ||| -229.045
-0 ||| A E C C A ||| -229.045
-0 ||| A E A E A ||| -229.045
-0 ||| A D C D A ||| -229.045
-0 ||| A E D B A ||| -229.045
-0 ||| B A C A E ||| -230.045
-0 ||| E E A A C ||| -230.045
-0 ||| D C D B B ||| -230.045
-0 ||| E B C B B ||| -230.045
-0 ||| C C D C B ||| -230.045
-0 ||| D C C C B ||| -230.045
-0 ||| B B B C D ||| -230.045
-0 ||| C C E A C ||| -230.045
-0 ||| B B C D B ||| -230.045
-0 ||| B C C C C ||| -230.045
-0 ||| C D C B B ||| -230.045
-0 ||| E A D C B ||| -230.045
-0 ||| C B E B B ||| -230.045
-0 ||| B B E C B ||| -230.045
-0 ||| B D C C B ||| -230.045
-0 ||| E C A D B ||| -230.045
-0 ||| C E C A B ||| -230.045
-0 ||| E C B C B ||| -230.045
-0 ||| B D D B B ||| -230.045
-0 ||| D E A C B ||| -230.045
-0 ||| E A B D B ||| -230.045
-0 ||| D B D C B ||| -230.045
-0 ||| B B B E B ||| -230.045
-0 ||| D D A D B ||| -230.045
-0 ||| D A E C B ||| -230.045
-0 ||| B D A E B ||| -230.045
-0 ||| E D C A B ||| -230.045
-0 ||| B C E B B ||| -230.045
-0 ||| D B B D B ||| -230.045
-0 ||| C D E A B ||| -230.045
-0 ||| C A E B C ||| -230.045
-0 ||| D C A E B ||| -230.045
-0 ||| C D B A D ||| -230.045
-0 ||| B B B D C ||| -230.045
-0 ||| D D B C B ||| -230.045
-0 ||| B E D A B ||| -230.045
-0 ||| B A C E B ||| -230.045
-0 ||| D A B E B ||| -230.045
-0 ||| C B D A D ||| -230.045
-0 ||| B E B B B ||| -230.045
-0 ||| C B A E C ||| -230.045
-0 ||| C D D A C ||| -230.045
-0 ||| C B C C C ||| -230.045
-0 ||| D B E A C ||| -230.045
-0 ||| E B D A C ||| -230.045
-0 ||| C C C B C ||| -230.045
-0 ||| D D C A C ||| -230.045
-0 ||| C D B B C ||| -230.045
-0 ||| D C A C D ||| -230.045
-0 ||| B E A C C ||| -230.045
-0 ||| C E B A C ||| -230.045
-0 ||| B B B A E ||| -230.045
-0 ||| C B D B C ||| -230.045
-0 ||| E D B A C ||| -230.045
-0 ||| D A C D B ||| -230.045
-0 ||| C C B D B ||| -230.045
-0 ||| B D A A E ||| -230.045
-0 ||| E B E A B ||| -230.045
-0 ||| C A A C E ||| -230.045
-0 ||| D C A D C ||| -230.045
-0 ||| B A C C D ||| -230.045
-0 ||| B C D A D ||| -230.045
-0 ||| D A A D D ||| -230.045
-0 ||| C A D D B ||| -230.045
-0 ||| E B B A D ||| -230.045
-0 ||| E D E A A ||| -230.045
-0 ||| D A B D C ||| -230.045
-0 ||| B A C D C ||| -230.045
-0 ||| C A C B D ||| -230.045
-0 ||| B E C C A ||| -230.045
-0 ||| B A D B D ||| -230.045
-0 ||| B A E C C ||| -230.045
-0 ||| C D A B D ||| -230.045
-0 ||| C B C E A ||| -230.045
-0 ||| B C D B C ||| -230.045
-0 ||| B A B E C ||| -230.045
-0 ||| B B D C C ||| -230.045
-0 ||| C D E B A ||| -230.045
-0 ||| D A B C D ||| -230.045
-0 ||| E B A B D ||| -230.045
-0 ||| B B A D D ||| -230.045
-0 ||| C E E A A ||| -230.045
-0 ||| B D A C D ||| -230.045
-0 ||| B D B C C ||| -230.045
-0 ||| C E C B A ||| -230.045
-0 ||| E B B B C ||| -230.045
-0 ||| C C C A D ||| -230.045
-0 ||| D A D E A ||| -230.045
-0 ||| C E A A D ||| -230.045
-0 ||| E D A B C ||| -230.045
-0 ||| D E B C A ||| -230.045
-0 ||| B D A D C ||| -230.045
-0 ||| E C C A C ||| -230.045
-0 ||| E E C A A ||| -230.045
-0 ||| E A C B C ||| -230.045
-0 ||| D C A A E ||| -230.045
-0 ||| D D D C A ||| -230.045
-0 ||| C E A B C ||| -230.045
-0 ||| B C A E C ||| -230.045
-0 ||| E D C B A ||| -230.045
-0 ||| C B B B D ||| -230.045
-0 ||| E A C A D ||| -230.045
-0 ||| B D C D A ||| -230.045
-0 ||| D B C B C ||| -230.045
-0 ||| B A A E D ||| -230.045
-0 ||| C C D D A ||| -230.045
-0 ||| E A E A C ||| -230.045
-0 ||| B C B B D ||| -230.045
-0 ||| E C D C A ||| -230.045
-0 ||| D A D C C ||| -230.045
-0 ||| C A E A D ||| -230.045
-0 ||| B B E D A ||| -230.045
-0 ||| E D A A D ||| -230.045
-0 ||| B B A B E ||| -230.045
-0 ||| E C B D A ||| -230.045
-0 ||| D B C A D ||| -230.045
-0 ||| D A B A E ||| -230.045
-0 ||| E B E B A ||| -230.045
-0 ||| D A A B E ||| -230.045
-0 ||| D C B C C ||| -230.045
-0 ||| D B D D A ||| -230.045
-0 ||| D C E C A ||| -230.045
-0 ||| B D E C A ||| -230.045
-0 ||| D E A D A ||| -230.045
-0 ||| D C C D A ||| -230.045
-0 ||| D D B D A ||| -230.045
-0 ||| D A E D A ||| -230.045
-0 ||| B B D E A ||| -230.045
-0 ||| B E A E A ||| -230.045
-0 ||| E A D D A ||| -230.045
-0 ||| B D B E A ||| -230.045
-0 ||| B A E E A ||| -230.045
-0 ||| D C B E A ||| -230.045
-0 ||| B E D B A ||| -230.045
-0 ||| B C C E A ||| -230.045
-0 ||| A D E A C ||| -231.045
-0 ||| A A D D C ||| -231.045
-0 ||| A E C A C ||| -231.045
-0 ||| A A B B E ||| -231.045
-0 ||| A C A B E ||| -231.045
-0 ||| A C B E B ||| -231.045
-0 ||| A B C B D ||| -231.045
-0 ||| A A D A E ||| -231.045
-0 ||| A D C B C ||| -231.045
-0 ||| A A D C D ||| -231.045
-0 ||| A B E B C ||| -231.045
-0 ||| A E A D B ||| -231.045
-0 ||| A C B D C ||| -231.045
-0 ||| A D B D B ||| -231.045
-0 ||| A C D C C ||| -231.045
-0 ||| A D D C B ||| -231.045
-0 ||| A C C D B ||| -231.045
-0 ||| A A D E B ||| -231.045
-0 ||| A C E C B ||| -231.045
-0 ||| A B D D B ||| -231.045
-0 ||| A B E A D ||| -231.045
-0 ||| A E D C A ||| -231.045
-0 ||| A A E D B ||| -231.045
-0 ||| A C B C D ||| -231.045
-0 ||| A C E D A ||| -231.045
-0 ||| A E B C B ||| -231.045
-0 ||| A C A D D ||| -231.045
-0 ||| A E B D A ||| -231.045
-0 ||| A C B A E ||| -231.045
-0 ||| A D C A D ||| -231.045
-0 ||| A C D E A ||| -231.045
-0 ||| A A B D D ||| -231.045
-0 ||| A B A C E ||| -231.045
-0 ||| A D D D A ||| -231.045
-0 ||| B A B B E ||| -232.045
-0 ||| C A C A E ||| -232.045
-0 ||| D E C B A ||| -232.045
-0 ||| D C E A C ||| -232.045
-0 ||| C A C E B ||| -232.045
-0 ||| B C E C B ||| -232.045
-0 ||| C A E C C ||| -232.045
-0 ||| C D B C C ||| -232.045
-0 ||| E C B B C ||| -232.045
-0 ||| E B A D C ||| -232.045
-0 ||| C A B E C ||| -232.045
-0 ||| E C D A C ||| -232.045
-0 ||| B B E B C ||| -232.045
-0 ||| D A E B C ||| -232.045
-0 ||| D B D B C ||| -232.045
-0 ||| E A A E C ||| -232.045
-0 ||| C B D C C ||| -232.045
-0 ||| E D A C C ||| -232.045
-0 ||| C D A D C ||| -232.045
-0 ||| E B B C C ||| -232.045
-0 ||| C C A E C ||| -232.045
-0 ||| E D B B B ||| -232.045
-0 ||| D D D A C ||| -232.045
-0 ||| B C D C C ||| -232.045
-0 ||| C E A C C ||| -232.045
-0 ||| E A C C C ||| -232.045
-0 ||| B D E A C ||| -232.045
-0 ||| D A D D B ||| -232.045
-0 ||| B E C A C ||| -232.045
-0 ||| B C B D C ||| -232.045
-0 ||| E B A E B ||| -232.045
-0 ||| D D B B C ||| -232.045
-0 ||| D B A E C ||| -232.045
-0 ||| D E B A C ||| -232.045
-0 ||| C E B B B ||| -232.045
-0 ||| B A D E B ||| -232.045
-0 ||| C B A D D ||| -232.045
-0 ||| B B C B D ||| -232.045
-0 ||| C D A E B ||| -232.045
-0 ||| D B C C C ||| -232.045
-0 ||| B C A D D ||| -232.045
-0 ||| B C B A E ||| -232.045
-0 ||| B A D C D ||| -232.045
-0 ||| C B B C D ||| -232.045
-0 ||| D C C A D ||| -232.045
-0 ||| B A B D D ||| -232.045
-0 ||| C C D A D ||| -232.045
-0 ||| E A B B D ||| -232.045
-0 ||| E C A B D ||| -232.045
-0 ||| C B B D C ||| -232.045
-0 ||| D B D A D ||| -232.045
-0 ||| D B B B D ||| -232.045
-0 ||| C A C C D ||| -232.045
-0 ||| D D B A D ||| -232.045
-0 ||| C A C D C ||| -232.045
-0 ||| C A A E D ||| -232.045
-0 ||| C D A C D ||| -232.045
-0 ||| E C B A D ||| -232.045
-0 ||| C C C C C ||| -232.045
-0 ||| B A D A E ||| -232.045
-0 ||| E C E A B ||| -232.045
-0 ||| B A D D C ||| -232.045
-0 ||| B C B C D ||| -232.045
-0 ||| D E A A D ||| -232.045
-0 ||| D C D C B ||| -232.045
-0 ||| E A D A D ||| -232.045
-0 ||| B B E A D ||| -232.045
-0 ||| C B B E B ||| -232.045
-0 ||| E B D B B ||| -232.045
-0 ||| D D C B B ||| -232.045
-0 ||| C D C C B ||| -232.045
-0 ||| B D C B C ||| -232.045
-0 ||| D C C B C ||| -232.045
-0 ||| E B C C B ||| -232.045
-0 ||| D B E B B ||| -232.045
-0 ||| C C D B C ||| -232.045
-0 ||| E E A B B ||| -232.045
-0 ||| C B E C B ||| -232.045
-0 ||| D D E A B ||| -232.045
-0 ||| B C A B E ||| -232.045
-0 ||| E C C B B ||| -232.045
-0 ||| C C E B B ||| -232.045
-0 ||| C D D B B ||| -232.045
-0 ||| B E B C B ||| -232.045
-0 ||| B E A D B ||| -232.045
-0 ||| D E C A B ||| -232.045
-0 ||| B D D C B ||| -232.045
-0 ||| B B D D B ||| -232.045
-0 ||| B C C D B ||| -232.045
-0 ||| E D D A B ||| -232.045
-0 ||| C E D A B ||| -232.045
-0 ||| B A E D B ||| -232.045
-0 ||| C B C D B ||| -232.045
-0 ||| E E B A B ||| -232.045
-0 ||| D C B D B ||| -232.045
-0 ||| C C B B D ||| -232.045
-0 ||| B C B E B ||| -232.045
-0 ||| B D B D B ||| -232.045
-0 ||| E A D B C ||| -232.045
-0 ||| D E A B C ||| -232.045
-0 ||| D A A C E ||| -232.045
-0 ||| B B A C E ||| -232.045
-0 ||| E B A A E ||| -232.045
-0 ||| C B A B E ||| -232.045
-0 ||| D D A B D ||| -232.045
-0 ||| D A E A D ||| -232.045
-0 ||| D D E B A ||| -232.045
-0 ||| C B B A E ||| -232.045
-0 ||| C A D B D ||| -232.045
-0 ||| C D C D A ||| -232.045
-0 ||| D A C B D ||| -232.045
-0 ||| C D A A E ||| -232.045
-0 ||| D C D D A ||| -232.045
-0 ||| E B A C D ||| -232.045
-0 ||| E A E B B ||| -232.045
-0 ||| C D E C A ||| -232.045
-0 ||| B D C A D ||| -232.045
-0 ||| C E C C A ||| -232.045
-0 ||| B E D C A ||| -232.045
-0 ||| B C E D A ||| -232.045
-0 ||| E D C C A ||| -232.045
-0 ||| D E E A A ||| -232.045
-0 ||| E E B B A ||| -232.045
-0 ||| E B E C A ||| -232.045
-0 ||| E E D A A ||| -232.045
-0 ||| C A E E A ||| -232.045
-0 ||| C E A E A ||| -232.045
-0 ||| E D A E A ||| -232.045
-0 ||| C B D E A ||| -232.045
-0 ||| B E B D A ||| -232.045
-0 ||| C B E D A ||| -232.045
-0 ||| E C E B A ||| -232.045
-0 ||| C E D B A ||| -232.045
-0 ||| C C C E A ||| -232.045
-0 ||| E B B E A ||| -232.045
-0 ||| B D D D A ||| -232.045
-0 ||| E B C D A ||| -232.045
-0 ||| D B C E A ||| -232.045
-0 ||| E A C E A ||| -232.045
-0 ||| C D B E A ||| -232.045
-0 ||| B C D E A ||| -232.045
-0 ||| E D D B A ||| -232.045
-0 ||| A B C C D ||| -233.045
-0 ||| A A C E C ||| -233.045
-0 ||| A C E B C ||| -233.045
-0 ||| A C A C E ||| -233.045
-0 ||| A B E C C ||| -233.045
-0 ||| A D B B D ||| -233.045
-0 ||| A E A B D ||| -233.045
-0 ||| A D E B B ||| -233.045
-0 ||| A A B C E ||| -233.045
-0 ||| A E E A B ||| -233.045
-0 ||| A E C B B ||| -233.045
-0 ||| A B C E B ||| -233.045
-0 ||| A B C D C ||| -233.045
-0 ||| A E B A D ||| -233.045
-0 ||| A A E B D ||| -233.045
-0 ||| A D D A D ||| -233.045
-0 ||| A B B E C ||| -233.045
-0 ||| A B D B D ||| -233.045
-0 ||| A D D B C ||| -233.045
-0 ||| A D A E C ||| -233.045
-0 ||| A E D A C ||| -233.045
-0 ||| A E B B C ||| -233.045
-0 ||| A D C C C ||| -233.045
-0 ||| A A A D E ||| -233.045
-0 ||| A B A E D ||| -233.045
-0 ||| A B C A E ||| -233.045
-0 ||| A C E A D ||| -233.045
-0 ||| A D C E A ||| -233.045
-0 ||| A C D D B ||| -233.045
-0 ||| A C C B D ||| -233.045
-0 ||| A E E B A ||| -233.045
-0 ||| A B E E A ||| -233.045
-0 ||| C D B D B ||| -234.045
-0 ||| C C E C B ||| -234.045
-0 ||| C C B E B ||| -234.045
-0 ||| E A A D D ||| -234.045
-0 ||| C C A D D ||| -234.045
-0 ||| B E C B B ||| -234.045
-0 ||| E A A B E ||| -234.045
-0 ||| B B C D C ||| -234.045
-0 ||| E C D B B ||| -234.045
-0 ||| E B B D B ||| -234.045
-0 ||| E A B E B ||| -234.045
-0 ||| B E E A B ||| -234.045
-0 ||| C B C B D ||| -234.045
-0 ||| D E D A B ||| -234.045
-0 ||| E C A E B ||| -234.045
-0 ||| B E A B D ||| -234.045
-0 ||| E B C B C ||| -234.045
-0 ||| D C D B C ||| -234.045
-0 ||| D C C C C ||| -234.045
-0 ||| C C D C C ||| -234.045
-0 ||| B D A E C ||| -234.045
-0 ||| B D C C C ||| -234.045
-0 ||| D A E C C ||| -234.045
-0 ||| C D C B C ||| -234.045
-0 ||| D C D A D ||| -234.045
-0 ||| B B E C C ||| -234.045
-0 ||| C B E B C ||| -234.045
-0 ||| E A D C C ||| -234.045
-0 ||| D D A D C ||| -234.045
-0 ||| D A C C D ||| -234.045
-0 ||| B D D B C ||| -234.045
-0 ||| E C B C C ||| -234.045
-0 ||| E C A D C ||| -234.045
-0 ||| C E C A C ||| -234.045
-0 ||| B B B E C ||| -234.045
-0 ||| D E A C C ||| -234.045
-0 ||| D C B B D ||| -234.045
-0 ||| D B D C C ||| -234.045
-0 ||| E A B D C ||| -234.045
-0 ||| E A E C B ||| -234.045
-0 ||| B E B B C ||| -234.045
-0 ||| C A D C D ||| -234.045
-0 ||| D C A E C ||| -234.045
-0 ||| B C E B C ||| -234.045
-0 ||| E A C D B ||| -234.045
-0 ||| D B B D C ||| -234.045
-0 ||| C D E A C ||| -234.045
-0 ||| C E B C B ||| -234.045
-0 ||| D A B E C ||| -234.045
-0 ||| D A C E B ||| -234.045
-0 ||| D D B C C ||| -234.045
-0 ||| B A C E C ||| -234.045
-0 ||| B E D A C ||| -234.045
-0 ||| D A C A E ||| -234.045
-0 ||| B B C C D ||| -234.045
-0 ||| B E B A D ||| -234.045
-0 ||| E C A C D ||| -234.045
-0 ||| C C C D B ||| -234.045
-0 ||| B D B B D ||| -234.045
-0 ||| D D A C D ||| -234.045
-0 ||| C B E A D ||| -234.045
-0 ||| D A A E D ||| -234.045
-0 ||| C D C A D ||| -234.045
-0 ||| C B A C E ||| -234.045
-0 ||| D B B C D ||| -234.045
-0 ||| E C C C B ||| -234.045
-0 ||| B D D A D ||| -234.045
-0 ||| E B C A D ||| -234.045
-0 ||| D B A D D ||| -234.045
-0 ||| B A E B D ||| -234.045
-0 ||| C B D D B ||| -234.045
-0 ||| E B D C B ||| -234.045
-0 ||| E D B C B ||| -234.045
-0 ||| B B D B D ||| -234.045
-0 ||| B D E B B ||| -234.045
-0 ||| D D D B B ||| -234.045
-0 ||| D B E C B ||| -234.045
-0 ||| C A D E B ||| -234.045
-0 ||| E E A C B ||| -234.045
-0 ||| C A E D B ||| -234.045
-0 ||| D B B E B ||| -234.045
-0 ||| C C B C D ||| -234.045
-0 ||| D D C C B ||| -234.045
-0 ||| E D C A C ||| -234.045
-0 ||| D B C D B ||| -234.045
-0 ||| B C D D B ||| -234.045
-0 ||| D D A E B ||| -234.045
-0 ||| B C E A D ||| -234.045
-0 ||| D C E B B ||| -234.045
-0 ||| C E A D B ||| -234.045
-0 ||| C D D C B ||| -234.045
-0 ||| E D A D B ||| -234.045
-0 ||| C C A B E ||| -234.045
-0 ||| E A B C D ||| -234.045
-0 ||| C C B D C ||| -234.045
-0 ||| D A C D C ||| -234.045
-0 ||| E B E A C ||| -234.045
-0 ||| E C A A E ||| -234.045
-0 ||| B A B C E ||| -234.045
-0 ||| B B A E D ||| -234.045
-0 ||| D B B A E ||| -234.045
-0 ||| D E B B B ||| -234.045
-0 ||| C A D D C ||| -234.045
-0 ||| B C C B D ||| -234.045
-0 ||| B B C A E ||| -234.045
-0 ||| C A D A E ||| -234.045
-0 ||| B B C E B ||| -234.045
-0 ||| D B A B E ||| -234.045
-0 ||| D A D B D ||| -234.045
-0 ||| E D D C A ||| -234.045
-0 ||| B A A D E ||| -234.045
-0 ||| C C B A E ||| -234.045
-0 ||| C C D E A ||| -234.045
-0 ||| B C A C E ||| -234.045
-0 ||| C A B D D ||| -234.045
-0 ||| C E B D A ||| -234.045
-0 ||| D D A A E ||| -234.045
-0 ||| E A B A E ||| -234.045
-0 ||| E D B D A ||| -234.045
-0 ||| C A B B E ||| -234.045
-0 ||| E C E C A ||| -234.045
-0 ||| B E E B A ||| -234.045
-0 ||| D D E C A ||| -234.045
-0 ||| E C B E A ||| -234.045
-0 ||| D D C D A ||| -234.045
-0 ||| D B D E A ||| -234.045
-0 ||| B B E E A ||| -234.045
-0 ||| E A E D A ||| -234.045
-0 ||| E E A D A ||| -234.045
-0 ||| E B D D A ||| -234.045
-0 ||| E E B C A ||| -234.045
-0 ||| C D D D A ||| -234.045
-0 ||| D E D B A ||| -234.045
-0 ||| D D B E A ||| -234.045
-0 ||| D E C C A ||| -234.045
-0 ||| C E D C A ||| -234.045
-0 ||| D C C E A ||| -234.045
-0 ||| E C C D A ||| -234.045
-0 ||| D E A E A ||| -234.045
-0 ||| D A E E A ||| -234.045
-0 ||| B D C E A ||| -234.045
-0 ||| E A D E A ||| -234.045
-0 ||| C C E D A ||| -234.045
-0 ||| D B E D A ||| -234.045
-0 ||| A C C A E ||| -235.045
-0 ||| A C B E C ||| -235.045
-0 ||| A B D E B ||| -235.045
-0 ||| A C C D C ||| -235.045
-0 ||| A D A D D ||| -235.045
-0 ||| A B E D B ||| -235.045
-0 ||| A C C C D ||| -235.045
-0 ||| A C D B D ||| -235.045
-0 ||| A A D E C ||| -235.045
-0 ||| A C E C C ||| -235.045
-0 ||| A A E E B ||| -235.045
-0 ||| A D B C D ||| -235.045
-0 ||| A D B A E ||| -235.045
-0 ||| A C A E D ||| -235.045
-0 ||| A E D B B ||| -235.045
-0 ||| A E A C D ||| -235.045
-0 ||| A D D C C ||| -235.045
-0 ||| A D B E B ||| -235.045
-0 ||| A A C D D ||| -235.045
-0 ||| A B D C D ||| -235.045
-0 ||| A D B D C ||| -235.045
-0 ||| A D C D B ||| -235.045
-0 ||| A E C C B ||| -235.045
-0 ||| A E A E B ||| -235.045
-0 ||| A A E C D ||| -235.045
-0 ||| A E A D C ||| -235.045
-0 ||| A D E C B ||| -235.045
-0 ||| A B D D C ||| -235.045
-0 ||| A D E D A ||| -235.045
-0 ||| A B D A E ||| -235.045
-0 ||| A A C B E ||| -235.045
-0 ||| A E B C C ||| -235.045
-0 ||| A E E C A ||| -235.045
-0 ||| A C C E B ||| -235.045
-0 ||| A A E D C ||| -235.045
-0 ||| A E A A E ||| -235.045
-0 ||| A E B E A ||| -235.045
-0 ||| A D A B E ||| -235.045
-0 ||| A A B E D ||| -235.045
-0 ||| A B B D D ||| -235.045
-0 ||| A C E E A ||| -235.045
-0 ||| A B B B E ||| -235.045
-0 ||| A A E A E ||| -235.045
-0 ||| A E C D A ||| -235.045
-0 ||| A D D E A ||| -235.045
-0 ||| B E A E B ||| -236.045
-0 ||| B D E C B ||| -236.045
-0 ||| B D B D C ||| -236.045
-0 ||| B C E C C ||| -236.045
-0 ||| D C E C B ||| -236.045
-0 ||| C A C E C ||| -236.045
-0 ||| C B D B D ||| -236.045
-0 ||| D B D D B ||| -236.045
-0 ||| D C B C D ||| -236.045
-0 ||| B D B A E ||| -236.045
-0 ||| B B D E B ||| -236.045
-0 ||| B C C A E ||| -236.045
-0 ||| D C C D B ||| -236.045
-0 ||| D A D D C ||| -236.045
-0 ||| D A E D B ||| -236.045
-0 ||| E D B B C ||| -236.045
-0 ||| D D B D B ||| -236.045
-0 ||| B A D E C ||| -236.045
-0 ||| E E A A D ||| -236.045
-0 ||| E B A E C ||| -236.045
-0 ||| E A D D B ||| -236.045
-0 ||| C E B B C ||| -236.045
-0 ||| D A D A E ||| -236.045
-0 ||| C C E A D ||| -236.045
-0 ||| C D A E C ||| -236.045
-0 ||| B C C C D ||| -236.045
-0 ||| D C B A E ||| -236.045
-0 ||| C A A D E ||| -236.045
-0 ||| B A E A E ||| -236.045
-0 ||| B C B E C ||| -236.045
-0 ||| C B C C D ||| -236.045
-0 ||| B C C E B ||| -236.045
-0 ||| C A E B D ||| -236.045
-0 ||| C D D B C ||| -236.045
-0 ||| E C E A C ||| -236.045
-0 ||| B B B D D ||| -236.045
-0 ||| B B D A E ||| -236.045
-0 ||| C B A E D ||| -236.045
-0 ||| C C E B C ||| -236.045
-0 ||| C D D A D ||| -236.045
-0 ||| C D C C C ||| -236.045
-0 ||| D C D C C ||| -236.045
-0 ||| D D C B C ||| -236.045
-0 ||| C B B E C ||| -236.045
-0 ||| E B D B C ||| -236.045
-0 ||| B D A B E ||| -236.045
-0 ||| D C A B E ||| -236.045
-0 ||| D B E B C ||| -236.045
-0 ||| C B C A E ||| -236.045
-0 ||| E B C C C ||| -236.045
-0 ||| E C C B C ||| -236.045
-0 ||| E A A C E ||| -236.045
-0 ||| E E A B C ||| -236.045
-0 ||| D D E A C ||| -236.045
-0 ||| C A B C E ||| -236.045
-0 ||| C B E C C ||| -236.045
-0 ||| B B D D C ||| -236.045
-0 ||| E B D A D ||| -236.045
-0 ||| B B B B E ||| -236.045
-0 ||| E E B A C ||| -236.045
-0 ||| C C C B D ||| -236.045
-0 ||| C E B A D ||| -236.045
-0 ||| B D D C C ||| -236.045
-0 ||| D B E A D ||| -236.045
-0 ||| D E C A C ||| -236.045
-0 ||| B E B C C ||| -236.045
-0 ||| B E A D C ||| -236.045
-0 ||| C E D A C ||| -236.045
-0 ||| C B C D C ||| -236.045
-0 ||| E D D A C ||| -236.045
-0 ||| B C C D C ||| -236.045
-0 ||| B A E D C ||| -236.045
-0 ||| B A C B E ||| -236.045
-0 ||| D B A C E ||| -236.045
-0 ||| D C B E B ||| -236.045
-0 ||| D D C A D ||| -236.045
-0 ||| B E A C D ||| -236.045
-0 ||| C D B B D ||| -236.045
-0 ||| D C B D C ||| -236.045
-0 ||| D A B B E ||| -236.045
-0 ||| B E A A E ||| -236.045
-0 ||| C C A C E ||| -236.045
-0 ||| B D B E B ||| -236.045
-0 ||| C C D D B ||| -236.045
-0 ||| E A E B C ||| -236.045
-0 ||| B E C C B ||| -236.045
-0 ||| C B C E B ||| -236.045
-0 ||| B D C D B ||| -236.045
-0 ||| E D C B B ||| -236.045
-0 ||| E D B A D ||| -236.045
-0 ||| C D E B B ||| -236.045
-0 ||| D A D E B ||| -236.045
-0 ||| C E E A B ||| -236.045
-0 ||| C E C B B ||| -236.045
-0 ||| D D D C B ||| -236.045
-0 ||| D C A D D ||| -236.045
-0 ||| E E C A B ||| -236.045
-0 ||| E C B D B ||| -236.045
-0 ||| E B E B B ||| -236.045
-0 ||| B E D B B ||| -236.045
-0 ||| D E A D B ||| -236.045
-0 ||| B A E E B ||| -236.045
-0 ||| D A B D D ||| -236.045
-0 ||| B D A D D ||| -236.045
-0 ||| B A C D D ||| -236.045
-0 ||| B B D C D ||| -236.045
-0 ||| B A B E D ||| -236.045
-0 ||| B C D B D ||| -236.045
-0 ||| E D E A B ||| -236.045
-0 ||| B B E D B ||| -236.045
-0 ||| B A E C D ||| -236.045
-0 ||| B D B C D ||| -236.045
-0 ||| E B B B D ||| -236.045
-0 ||| E D A B D ||| -236.045
-0 ||| E B C E A ||| -236.045
-0 ||| E C C A D ||| -236.045
-0 ||| E A C B D ||| -236.045
-0 ||| D C E D A ||| -236.045
-0 ||| B C A E D ||| -236.045
-0 ||| C E A B D ||| -236.045
-0 ||| B D D E A ||| -236.045
-0 ||| D E B C B ||| -236.045
-0 ||| D B C B D ||| -236.045
-0 ||| C D C E A ||| -236.045
-0 ||| E A E A D ||| -236.045
-0 ||| E C D C B ||| -236.045
-0 ||| D A D C D ||| -236.045
-0 ||| D C D E A ||| -236.045
-0 ||| D D D D A ||| -236.045
-0 ||| C E E B A ||| -236.045
-0 ||| E C D D A ||| -236.045
-0 ||| B E E C A ||| -236.045
-0 ||| B C E E A ||| -236.045
-0 ||| E E C B A ||| -236.045
-0 ||| B E C D A ||| -236.045
-0 ||| D E B D A ||| -236.045
-0 ||| B E B E A ||| -236.045
-0 ||| E E E A A ||| -236.045
-0 ||| D E D C A ||| -236.045
-0 ||| C B E E A ||| -236.045
-0 ||| E D E B A ||| -236.045
-0 ||| B D E D A ||| -236.045
-0 ||| A C D D C ||| -237.045
-0 ||| A B C E C ||| -237.045
-0 ||| A C D A E ||| -237.045
-0 ||| A E C A D ||| -237.045
-0 ||| A E D D A ||| -237.045
-0 ||| A B E B D ||| -237.045
-0 ||| A C D E B ||| -237.045
-0 ||| A C B D D ||| -237.045
-0 ||| A E C B C ||| -237.045
-0 ||| A D A C E ||| -237.045
-0 ||| A E E A C ||| -237.045
-0 ||| A D D D B ||| -237.045
-0 ||| A B A D E ||| -237.045
-0 ||| A D E A D ||| -237.045
-0 ||| A C B B E ||| -237.045
-0 ||| A A D D D ||| -237.045
-0 ||| A A A E E ||| -237.045
-0 ||| A E D C B ||| -237.045
-0 ||| A A C C E ||| -237.045
-0 ||| A B B C E ||| -237.045
-0 ||| A E B D B ||| -237.045
-0 ||| A C E D B ||| -237.045
-0 ||| A A D B E ||| -237.045
-0 ||| A D C B D ||| -237.045
-0 ||| A C D C D ||| -237.045
-0 ||| A D E B C ||| -237.045
-0 ||| C B D E B ||| -238.045
-0 ||| C E C C B ||| -238.045
-0 ||| B C E D B ||| -238.045
-0 ||| B E D C B ||| -238.045
-0 ||| E C D A D ||| -238.045
-0 ||| B C B D D ||| -238.045
-0 ||| C A B E D ||| -238.045
-0 ||| C C B E C ||| -238.045
-0 ||| D E C B B ||| -238.045
-0 ||| D C E A D ||| -238.045
-0 ||| C A E C D ||| -238.045
-0 ||| E B A D D ||| -238.045
-0 ||| E C B B D ||| -238.045
-0 ||| C D B C D ||| -238.045
-0 ||| C E A A E ||| -238.045
-0 ||| D B B E C ||| -238.045
-0 ||| E D A C D ||| -238.045
-0 ||| B E C A D ||| -238.045
-0 ||| C C E C C ||| -238.045
-0 ||| D A E B D ||| -238.045
-0 ||| E B A B E ||| -238.045
-0 ||| B B E B D ||| -238.045
-0 ||| C B D C D ||| -238.045
-0 ||| E A A E D ||| -238.045
-0 ||| D B D B D ||| -238.045
-0 ||| C D B D C ||| -238.045
-0 ||| B A D B E ||| -238.045
-0 ||| C C A E D ||| -238.045
-0 ||| C D A D D ||| -238.045
-0 ||| E B B C D ||| -238.045
-0 ||| B D E A D ||| -238.045
-0 ||| D D D A D ||| -238.045
-0 ||| E A C C D ||| -238.045
-0 ||| B C D C D ||| -238.045
-0 ||| C E A C D ||| -238.045
-0 ||| D D B B D ||| -238.045
-0 ||| C A C D D ||| -238.045
-0 ||| E C A E C ||| -238.045
-0 ||| B E C B C ||| -238.045
-0 ||| D B A E D ||| -238.045
-0 ||| D E B A D ||| -238.045
-0 ||| D B C C D ||| -238.045
-0 ||| D E D A C ||| -238.045
-0 ||| E B B D C ||| -238.045
-0 ||| B B B C E ||| -238.045
-0 ||| E C D B C ||| -238.045
-0 ||| B E E A C ||| -238.045
-0 ||| E A B E C ||| -238.045
-0 ||| C B B D D ||| -238.045
-0 ||| E D C C B ||| -238.045
-0 ||| C A E D C ||| -238.045
-0 ||| B A D D D ||| -238.045
-0 ||| E A E C C ||| -238.045
-0 ||| E D A E B ||| -238.045
-0 ||| C B D A E ||| -238.045
-0 ||| C E B C C ||| -238.045
-0 ||| C D B A E ||| -238.045
-0 ||| E A C D C ||| -238.045
-0 ||| C C C C D ||| -238.045
-0 ||| B D C B D ||| -238.045
-0 ||| D A C E C ||| -238.045
-0 ||| D C C B D ||| -238.045
-0 ||| C C D B D ||| -238.045
-0 ||| E E D A B ||| -238.045
-0 ||| D A B C E ||| -238.045
-0 ||| C E A E B ||| -238.045
-0 ||| C C C D C ||| -238.045
-0 ||| E B E C B ||| -238.045
-0 ||| E E B B B ||| -238.045
-0 ||| D E E A B ||| -238.045
-0 ||| E E A C C ||| -238.045
-0 ||| C A E E B ||| -238.045
-0 ||| C A C B E ||| -238.045
-0 ||| C A D E C ||| -238.045
-0 ||| E C C C C ||| -238.045
-0 ||| D C A C E ||| -238.045
-0 ||| D B E C C ||| -238.045
-0 ||| D D D B C ||| -238.045
-0 ||| C B D D C ||| -238.045
-0 ||| E B D C C ||| -238.045
-0 ||| B D E B C ||| -238.045
-0 ||| E D B C C ||| -238.045
-0 ||| D D E B B ||| -238.045
-0 ||| B C D D C ||| -238.045
-0 ||| C C C E B ||| -238.045
-0 ||| B E B D B ||| -238.045
-0 ||| D B C D C ||| -238.045
-0 ||| D D C C C ||| -238.045
-0 ||| C D C D B ||| -238.045
-0 ||| D D A E C ||| -238.045
-0 ||| D C D D B ||| -238.045
-0 ||| C D E C B ||| -238.045
-0 ||| B C D A E ||| -238.045
-0 ||| C E A D C ||| -238.045
-0 ||| C E D B B ||| -238.045
-0 ||| E D A D C ||| -238.045
-0 ||| C B E D B ||| -238.045
-0 ||| D C E B C ||| -238.045
-0 ||| E A C A E ||| -238.045
-0 ||| C D D C C ||| -238.045
-0 ||| B B A D E ||| -238.045
-0 ||| E C E B B ||| -238.045
-0 ||| B A C C E ||| -238.045
-0 ||| D A A D E ||| -238.045
-0 ||| B C D E B ||| -238.045
-0 ||| E B B A E ||| -238.045
-0 ||| D E B B C ||| -238.045
-0 ||| C D B E B ||| -238.045
-0 ||| E B B E B ||| -238.045
-0 ||| B D D D B ||| -238.045
-0 ||| E A C E B ||| -238.045
-0 ||| D B C E B ||| -238.045
-0 ||| E B C D B ||| -238.045
-0 ||| E A D B D ||| -238.045
-0 ||| D E A B D ||| -238.045
-0 ||| E D D B B ||| -238.045
-0 ||| B D A C E ||| -238.045
-0 ||| D B E E A ||| -238.045
-0 ||| B B C E C ||| -238.045
-0 ||| C B B B E ||| -238.045
-0 ||| E B D E A ||| -238.045
-0 ||| B C B B E ||| -238.045
-0 ||| C C C A E ||| -238.045
-0 ||| E D B E A ||| -238.045
-0 ||| B A A E E ||| -238.045
-0 ||| D B C A E ||| -238.045
-0 ||| E D C D A ||| -238.045
-0 ||| E D A A E ||| -238.045
-0 ||| C A E A E ||| -238.045
-0 ||| E B E D A ||| -238.045
-0 ||| C D A B E ||| -238.045
-0 ||| C C E E A ||| -238.045
-0 ||| C E C D A ||| -238.045
-0 ||| C E B E A ||| -238.045
-0 ||| C D E D A ||| -238.045
-0 ||| E E D B A ||| -238.045
-0 ||| E E A E A ||| -238.045
-0 ||| D D C E A ||| -238.045
-0 ||| C E E C A ||| -238.045
-0 ||| E A E E A ||| -238.045
-0 ||| E E C C A ||| -238.045
-0 ||| E D E C A ||| -238.045
-0 ||| E C C E A ||| -238.045
-0 ||| D E E B A ||| -238.045
-0 ||| B E D D A ||| -238.045
-0 ||| C D D E A ||| -238.045
-0 ||| A A D C E ||| -239.045
-0 ||| A E B B D ||| -239.045
-0 ||| A B E C D ||| -239.045
-0 ||| A A B D E ||| -239.045
-0 ||| A D C E B ||| -239.045
-0 ||| A A E E C ||| -239.045
-0 ||| A B C B E ||| -239.045
-0 ||| A D C C D ||| -239.045
-0 ||| A B D E C ||| -239.045
-0 ||| A C E B D ||| -239.045
-0 ||| A B B E D ||| -239.045
-0 ||| A A C E D ||| -239.045
-0 ||| A E E B B ||| -239.045
-0 ||| A B E E B ||| -239.045
-0 ||| A D A E D ||| -239.045
-0 ||| A B E D C ||| -239.045
-0 ||| A E D A D ||| -239.045
-0 ||| A B C D D ||| -239.045
-0 ||| A D E E A ||| -239.045
-0 ||| A D E C C ||| -239.045
-0 ||| A E D B C ||| -239.045
-0 ||| A D C D C ||| -239.045
-0 ||| A E C C C ||| -239.045
-0 ||| A E C E A ||| -239.045
-0 ||| A E A E C ||| -239.045
-0 ||| A C B C E ||| -239.045
-0 ||| A D D B D ||| -239.045
-0 ||| A D B E C ||| -239.045
-0 ||| A B E A E ||| -239.045
-0 ||| A D C A E ||| -239.045
-0 ||| A C A D E ||| -239.045
-0 ||| A C C E C ||| -239.045
-0 ||| B E E B B ||| -240.045
-0 ||| B D C A E ||| -240.045
-0 ||| D E A C D ||| -240.045
-0 ||| E A D E B ||| -240.045
-0 ||| D D E C B ||| -240.045
-0 ||| D B D E B ||| -240.045
-0 ||| C A A E E ||| -240.045
-0 ||| D C C D C ||| -240.045
-0 ||| B D E C C ||| -240.045
-0 ||| B E A E C ||| -240.045
-0 ||| D C E C C ||| -240.045
-0 ||| E C E C B ||| -240.045
-0 ||| B B D E C ||| -240.045
-0 ||| D B D D C ||| -240.045
-0 ||| D D B D C ||| -240.045
-0 ||| C B B C E ||| -240.045
-0 ||| B B B E D ||| -240.045
-0 ||| D A E D C ||| -240.045
-0 ||| B A D C E ||| -240.045
-0 ||| B B C D D ||| -240.045
-0 ||| C B A D E ||| -240.045
-0 ||| B B C B E ||| -240.045
-0 ||| B C A D E ||| -240.045
-0 ||| E A D D C ||| -240.045
-0 ||| B D C C D ||| -240.045
-0 ||| D D B A E ||| -240.045
-0 ||| D C C A E ||| -240.045
-0 ||| E C A B E ||| -240.045
-0 ||| D C D B D ||| -240.045
-0 ||| E B C B D ||| -240.045
-0 ||| C E C A D ||| -240.045
-0 ||| B D A E D ||| -240.045
-0 ||| E A B B E ||| -240.045
-0 ||| B A B D E ||| -240.045
-0 ||| C C D C D ||| -240.045
-0 ||| C C D A E ||| -240.045
-0 ||| D C C C D ||| -240.045
-0 ||| E C A D D ||| -240.045
-0 ||| C B E B D ||| -240.045
-0 ||| D A E C D ||| -240.045
-0 ||| C A C C E ||| -240.045
-0 ||| B B E C D ||| -240.045
-0 ||| C D C B D ||| -240.045
-0 ||| E C B C D ||| -240.045
-0 ||| D D A D D ||| -240.045
-0 ||| D B B B E ||| -240.045
-0 ||| E A D C D ||| -240.045
-0 ||| B D D B D ||| -240.045
-0 ||| D B D A E ||| -240.045
-0 ||| D D C D B ||| -240.045
-0 ||| C D A C E ||| -240.045
-0 ||| B E B B D ||| -240.045
-0 ||| E C C D B ||| -240.045
-0 ||| B C C E C ||| -240.045
-0 ||| B E D A D ||| -240.045
-0 ||| E A B D D ||| -240.045
-0 ||| D B D C D ||| -240.045
-0 ||| E C B A E ||| -240.045
-0 ||| D B B D D ||| -240.045
-0 ||| D C A E D ||| -240.045
-0 ||| C D E A D ||| -240.045
-0 ||| B C E B D ||| -240.045
-0 ||| D A B E D ||| -240.045
-0 ||| D E A A E ||| -240.045
-0 ||| B C B C E ||| -240.045
-0 ||| B A C E D ||| -240.045
-0 ||| B B E A E ||| -240.045
-0 ||| E A D A E ||| -240.045
-0 ||| D D B C D ||| -240.045
-0 ||| E C B E B ||| -240.045
-0 ||| E E A D B ||| -240.045
-0 ||| C C B B E ||| -240.045
-0 ||| D C B E C ||| -240.045
-0 ||| D A D E C ||| -240.045
-0 ||| E C D C C ||| -240.045
-0 ||| C C E D B ||| -240.045
-0 ||| D A E A E ||| -240.045
-0 ||| E D C A D ||| -240.045
-0 ||| E D D C B ||| -240.045
-0 ||| C C D E B ||| -240.045
-0 ||| C A D D D ||| -240.045
-0 ||| E E B C B ||| -240.045
-0 ||| E A E D B ||| -240.045
-0 ||| D B E D B ||| -240.045
-0 ||| C E B D B ||| -240.045
-0 ||| E D B D B ||| -240.045
-0 ||| C D E B C ||| -240.045
-0 ||| E B D D B ||| -240.045
-0 ||| C C D D C ||| -240.045
-0 ||| B D B E C ||| -240.045
-0 ||| E D C B C ||| -240.045
-0 ||| B E C C C ||| -240.045
-0 ||| B D C D C ||| -240.045
-0 ||| C B C E C ||| -240.045
-0 ||| B B E D C ||| -240.045
-0 ||| D E A D C ||| -240.045
-0 ||| D E D B B ||| -240.045
-0 ||| D D A B E ||| -240.045
-0 ||| C D D D B ||| -240.045
-0 ||| E E C A C ||| -240.045
-0 ||| C E C B C ||| -240.045
-0 ||| C E E A C ||| -240.045
-0 ||| D D D C C ||| -240.045
-0 ||| C C B D D ||| -240.045
-0 ||| D C C E B ||| -240.045
-0 ||| D A C D D ||| -240.045
-0 ||| E B E A D ||| -240.045
-0 ||| E B E B C ||| -240.045
-0 ||| E C B D C ||| -240.045
-0 ||| D E A E B ||| -240.045
-0 ||| B D C E B ||| -240.045
-0 ||| B A E E C ||| -240.045
-0 ||| B E D B C ||| -240.045
-0 ||| D E B C C ||| -240.045
-0 ||| B B E E B ||| -240.045
-0 ||| D D B E B ||| -240.045
-0 ||| B D E E A ||| -240.045
-0 ||| D E C C B ||| -240.045
-0 ||| E D E A C ||| -240.045
-0 ||| E E B D A ||| -240.045
-0 ||| E B A C E ||| -240.045
-0 ||| C E D C B ||| -240.045
-0 ||| D E E C A ||| -240.045
-0 ||| D A C B E ||| -240.045
-0 ||| D A E E B ||| -240.045
-0 ||| D D E D A ||| -240.045
-0 ||| C A D B E ||| -240.045
-0 ||| D C E E A ||| -240.045
-0 ||| E C D E A ||| -240.045
-0 ||| E D D D A ||| -240.045
-0 ||| E E D C A ||| -240.045
-0 ||| D D D E A ||| -240.045
-0 ||| E C E D A ||| -240.045
-0 ||| B E C E A ||| -240.045
-0 ||| D E B E A ||| -240.045
-0 ||| C E D D A ||| -240.045
-0 ||| D E C D A ||| -240.045
-0 ||| A C E A E ||| -241.045
-0 ||| A C E C D ||| -241.045
-0 ||| A E E D A ||| -241.045
-0 ||| A A D E D ||| -241.045
-0 ||| A D E D B ||| -241.045
-0 ||| A C E E B ||| -241.045
-0 ||| A D D E B ||| -241.045
-0 ||| A C C D D ||| -241.045
-0 ||| A D D A E ||| -241.045
-0 ||| A D D C D ||| -241.045
-0 ||| A E D E A ||| -241.045
-0 ||| A E A B E ||| -241.045
-0 ||| A E C D B ||| -241.045
-0 ||| A C C B E ||| -241.045
-0 ||| A D B D D ||| -241.045
-0 ||| A A E B E ||| -241.045
-0 ||| A D B B E ||| -241.045
-0 ||| A B C C E ||| -241.045
-0 ||| A E D C C ||| -241.045
-0 ||| A C D E C ||| -241.045
-0 ||| A B D B E ||| -241.045
-0 ||| A E A D D ||| -241.045
-0 ||| A C B E D ||| -241.045
-0 ||| A E B C D ||| -241.045
-0 ||| A B D D D ||| -241.045
-0 ||| A B A E E ||| -241.045
-0 ||| A C E D C ||| -241.045
-0 ||| A E B E B ||| -241.045
-0 ||| A E B D C ||| -241.045
-0 ||| A E E C B ||| -241.045
-0 ||| A D D D C ||| -241.045
-0 ||| A E B A E ||| -241.045
-0 ||| A A E D D ||| -241.045
-0 ||| B C E C D ||| -242.045
-0 ||| D E C B C ||| -242.045
-0 ||| D D D D B ||| -242.045
-0 ||| B C E D C ||| -242.045
-0 ||| B D B D D ||| -242.045
-0 ||| C E C C C ||| -242.045
-0 ||| C B D E C ||| -242.045
-0 ||| B E D C C ||| -242.045
-0 ||| E D C C C ||| -242.045
-0 ||| C A C E D ||| -242.045
-0 ||| C B E E B ||| -242.045
-0 ||| B D E D B ||| -242.045
-0 ||| D A D D D ||| -242.045
-0 ||| E B A E D ||| -242.045
-0 ||| E D B B D ||| -242.045
-0 ||| E A A D E ||| -242.045
-0 ||| C C A D E ||| -242.045
-0 ||| B A D E D ||| -242.045
-0 ||| C B C B E ||| -242.045
-0 ||| B E A B E ||| -242.045
-0 ||| C E B B D ||| -242.045
-0 ||| D C D A E ||| -242.045
-0 ||| D A C C E ||| -242.045
-0 ||| E D A E C ||| -242.045
-0 ||| E B B E C ||| -242.045
-0 ||| D C D E B ||| -242.045
-0 ||| D C B B E ||| -242.045
-0 ||| C D A E D ||| -242.045
-0 ||| B C B E D ||| -242.045
-0 ||| C A D C E ||| -242.045
-0 ||| E C C B D ||| -242.045
-0 ||| B C D E C ||| -242.045
-0 ||| C C E B D ||| -242.045
-0 ||| C D D B D ||| -242.045
-0 ||| E C E A D ||| -242.045
-0 ||| E B C C D ||| -242.045
-0 ||| D D C B D ||| -242.045
-0 ||| D C D C D ||| -242.045
-0 ||| C D C C D ||| -242.045
-0 ||| E D E B B ||| -242.045
-0 ||| E B D B D ||| -242.045
-0 ||| C B B E D ||| -242.045
-0 ||| D B E B D ||| -242.045
-0 ||| B E C D B ||| -242.045
-0 ||| B D B B E ||| -242.045
-0 ||| C B C D D ||| -242.045
-0 ||| D D E A D ||| -242.045
-0 ||| E E A B D ||| -242.045
-0 ||| C B E C D ||| -242.045
-0 ||| E E B A D ||| -242.045
-0 ||| D C B D D ||| -242.045
-0 ||| B B D D D ||| -242.045
-0 ||| C E D A D ||| -242.045
-0 ||| B E B A E ||| -242.045
-0 ||| B D D C D ||| -242.045
-0 ||| B B C C E ||| -242.045
-0 ||| E E D A C ||| -242.045
-0 ||| B E A D D ||| -242.045
-0 ||| D E C A D ||| -242.045
-0 ||| E C A C E ||| -242.045
-0 ||| B E B C D ||| -242.045
-0 ||| D E B D B ||| -242.045
-0 ||| D D A C E ||| -242.045
-0 ||| B A E D D ||| -242.045
-0 ||| B C C D D ||| -242.045
-0 ||| E D D A D ||| -242.045
-0 ||| C E A E C ||| -242.045
-0 ||| C D C A E ||| -242.045
-0 ||| D A A E E ||| -242.045
-0 ||| C B E A E ||| -242.045
-0 ||| C D C E B ||| -242.045
-0 ||| E E B B C ||| -242.045
-0 ||| E B E C C ||| -242.045
-0 ||| B A E B E ||| -242.045
-0 ||| D B B C E ||| -242.045
-0 ||| D B A D E ||| -242.045
-0 ||| B D D A E ||| -242.045
-0 ||| E B C A E ||| -242.045
-0 ||| C A E E C ||| -242.045
-0 ||| C E E B B ||| -242.045
-0 ||| D E E A C ||| -242.045
-0 ||| B B D B E ||| -242.045
-0 ||| B C E A E ||| -242.045
-0 ||| E B C D C ||| -242.045
-0 ||| E E C B B ||| -242.045
-0 ||| C C B C E ||| -242.045
-0 ||| D D E B C ||| -242.045
-0 ||| D C E D B ||| -242.045
-0 ||| B E B D C ||| -242.045
-0 ||| E B C E B ||| -242.045
-0 ||| C C C E C ||| -242.045
-0 ||| D E D C B ||| -242.045
-0 ||| E C D D B ||| -242.045
-0 ||| C D C D C ||| -242.045
-0 ||| B C E E B ||| -242.045
-0 ||| C D E C C ||| -242.045
-0 ||| D C D D C ||| -242.045
-0 ||| B C C B E ||| -242.045
-0 ||| B E E C B ||| -242.045
-0 ||| C E D B C ||| -242.045
-0 ||| C B E D C ||| -242.045
-0 ||| E A E B D ||| -242.045
-0 ||| E A C E C ||| -242.045
-0 ||| E A B C E ||| -242.045
-0 ||| C D B E C ||| -242.045
-0 ||| B B A E E ||| -242.045
-0 ||| D B C E C ||| -242.045
-0 ||| E C E B C ||| -242.045
-0 ||| B E B E B ||| -242.045
-0 ||| D E D D A ||| -242.045
-0 ||| B D D D C ||| -242.045
-0 ||| E D D B C ||| -242.045
-0 ||| B E D E A ||| -242.045
-0 ||| E E E A B ||| -242.045
-0 ||| C A B D E ||| -242.045
-0 ||| B E E D A ||| -242.045
-0 ||| D A D B E ||| -242.045
-0 ||| B D D E B ||| -242.045
-0 ||| E D C E A ||| -242.045
-0 ||| C E C E A ||| -242.045
-0 ||| C D E E A ||| -242.045
-0 ||| E E E B A ||| -242.045
-0 ||| E B E E A ||| -242.045
-0 ||| A E A C E ||| -243.045
-0 ||| A B D C E ||| -243.045
-0 ||| A C D B E ||| -243.045
-0 ||| A D A D E ||| -243.045
-0 ||| A E C B D ||| -243.045
-0 ||| A C C C E ||| -243.045
-0 ||| A D B C E ||| -243.045
-0 ||| A E D D B ||| -243.045
-0 ||| A C A E E ||| -243.045
-0 ||| A A C D E ||| -243.045
-0 ||| A D E B D ||| -243.045
-0 ||| A B C E D ||| -243.045
-0 ||| A B B D E ||| -243.045
-0 ||| A C D D D ||| -243.045
-0 ||| A D C E C ||| -243.045
-0 ||| A E E B C ||| -243.045
-0 ||| A B E E C ||| -243.045
-0 ||| A A E C E ||| -243.045
-0 ||| A A B E E ||| -243.045
-0 ||| A E E A D ||| -243.045
-0 ||| D E C C C ||| -244.045
-0 ||| C C E A E ||| -244.045
-0 ||| D D E C C ||| -244.045
-0 ||| E B D C D ||| -244.045
-0 ||| C E B E B ||| -244.045
-0 ||| C C E E B ||| -244.045
-0 ||| D A D C E ||| -244.045
-0 ||| E E A D C ||| -244.045
-0 ||| C C B E D ||| -244.045
-0 ||| D E D B C ||| -244.045
-0 ||| E A D E C ||| -244.045
-0 ||| C E E C B ||| -244.045
-0 ||| D B D E C ||| -244.045
-0 ||| E C D B D ||| -244.045
-0 ||| C B D B E ||| -244.045
-0 ||| C C E C D ||| -244.045
-0 ||| D B B E D ||| -244.045
-0 ||| D C B C E ||| -244.045
-0 ||| C D B D D ||| -244.045
-0 ||| E B E D B ||| -244.045
-0 ||| E C E C C ||| -244.045
-0 ||| D E D A D ||| -244.045
-0 ||| E E A A E ||| -244.045
-0 ||| E C A E D ||| -244.045
-0 ||| B E C B D ||| -244.045
-0 ||| E B B D D ||| -244.045
-0 ||| C D D E B ||| -244.045
-0 ||| E E C C B ||| -244.045
-0 ||| E C C E B ||| -244.045
-0 ||| D E E B B ||| -244.045
-0 ||| E A E E B ||| -244.045
-0 ||| E E D B B ||| -244.045
-0 ||| C D E D B ||| -244.045
-0 ||| B B D C E ||| -244.045
-0 ||| D A B D E ||| -244.045
-0 ||| B A E C E ||| -244.045
-0 ||| D D C D C ||| -244.045
-0 ||| E A B E D ||| -244.045
-0 ||| C B D D D ||| -244.045
-0 ||| C E C D B ||| -244.045
-0 ||| E C B E C ||| -244.045
-0 ||| B C C C E ||| -244.045
-0 ||| B E E A D ||| -244.045
-0 ||| C B C C E ||| -244.045
-0 ||| E A E C D ||| -244.045
-0 ||| E D B E B ||| -244.045
-0 ||| C A E D D ||| -244.045
-0 ||| E C C D C ||| -244.045
-0 ||| C A E B E ||| -244.045
-0 ||| C B A E E ||| -244.045
-0 ||| C A D E D ||| -244.045
-0 ||| B B B D E ||| -244.045
-0 ||| C E B C D ||| -244.045
-0 ||| E E A C D ||| -244.045
-0 ||| E A C D D ||| -244.045
-0 ||| C D D A E ||| -244.045
-0 ||| C C C B E ||| -244.045
-0 ||| D D D B D ||| -244.045
-0 ||| C E A D D ||| -244.045
-0 ||| C E B D C ||| -244.045
-0 ||| C D B B E ||| -244.045
-0 ||| E B D A E ||| -244.045
-0 ||| D B E A E ||| -244.045
-0 ||| D A C E D ||| -244.045
-0 ||| C E B A E ||| -244.045
-0 ||| D D A E D ||| -244.045
-0 ||| B E A C E ||| -244.045
-0 ||| D B E C D ||| -244.045
-0 ||| D D C A E ||| -244.045
-0 ||| E D D C C ||| -244.045
-0 ||| E D B A E ||| -244.045
-0 ||| C C C D D ||| -244.045
-0 ||| E D A D D ||| -244.045
-0 ||| D C E B D ||| -244.045
-0 ||| D B E D C ||| -244.045
-0 ||| E A E D C ||| -244.045
-0 ||| E C C C D ||| -244.045
-0 ||| B C D B E ||| -244.045
-0 ||| D B C D D ||| -244.045
-0 ||| E D B C D ||| -244.045
-0 ||| D E B B D ||| -244.045
-0 ||| D D C C D ||| -244.045
-0 ||| E B D E B ||| -244.045
-0 ||| B D E B D ||| -244.045
-0 ||| C D D C D ||| -244.045
-0 ||| B A B E E ||| -244.045
-0 ||| E A C B E ||| -244.045
-0 ||| B A C D E ||| -244.045
-0 ||| D C A D E ||| -244.045
-0 ||| B C D D D ||| -244.045
-0 ||| C C E D C ||| -244.045
-0 ||| D E A E C ||| -244.045
-0 ||| C C D E C ||| -244.045
-0 ||| D B E E B ||| -244.045
-0 ||| D E C E A ||| -244.045
-0 ||| E B D D C ||| -244.045
-0 ||| E D E D A ||| -244.045
-0 ||| E D B D C ||| -244.045
-0 ||| D D E E A ||| -244.045
-0 ||| D A E E C ||| -244.045
-0 ||| E E B E A ||| -244.045
-0 ||| B D A D E ||| -244.045
-0 ||| E D D E A ||| -244.045
-0 ||| E D C D B ||| -244.045
-0 ||| E E C D A ||| -244.045
-0 ||| C D D D C ||| -244.045
-0 ||| C E E D A ||| -244.045
-0 ||| D D C E B ||| -244.045
-0 ||| C E D E A ||| -244.045
-0 ||| E E A E B ||| -244.045
-0 ||| E E E C A ||| -244.045
-0 ||| E E B C C ||| -244.045
-0 ||| E C E E A ||| -244.045
-0 ||| E D E C B ||| -244.045
-0 ||| B E D D B ||| -244.045
-0 ||| D C C E C ||| -244.045
-0 ||| D D B E C ||| -244.045
-0 ||| B E E B C ||| -244.045
-0 ||| B D C E C ||| -244.045
-0 ||| B B E E C ||| -244.045
-0 ||| E A E A E ||| -244.045
-0 ||| E D A B E ||| -244.045
-0 ||| E C C A E ||| -244.045
-0 ||| E B B B E ||| -244.045
-0 ||| B D B C E ||| -244.045
-0 ||| C E D C C ||| -244.045
-0 ||| D B C B E ||| -244.045
-0 ||| B C A E E ||| -244.045
-0 ||| B B C E D ||| -244.045
-0 ||| C E A B E ||| -244.045
-0 ||| A A E E D ||| -245.045
-0 ||| A E C A E ||| -245.045
-0 ||| A D D E C ||| -245.045
-0 ||| A C B D E ||| -245.045
-0 ||| A B D E D ||| -245.045
-0 ||| A A D D E ||| -245.045
-0 ||| A C D C E ||| -245.045
-0 ||| A C C E D ||| -245.045
-0 ||| A B E B E ||| -245.045
-0 ||| A D C B E ||| -245.045
-0 ||| A C E E C ||| -245.045
-0 ||| A D E D C ||| -245.045
-0 ||| A E C D C ||| -245.045
-0 ||| A E E E A ||| -245.045
-0 ||| A E E C C ||| -245.045
-0 ||| A B E D D ||| -245.045
-0 ||| A E C E B ||| -245.045
-0 ||| A E D B D ||| -245.045
-0 ||| A D E A E ||| -245.045
-0 ||| A D E C D ||| -245.045
-0 ||| A D B E D ||| -245.045
-0 ||| A E C C D ||| -245.045
-0 ||| A D C D D ||| -245.045
-0 ||| A E B E C ||| -245.045
-0 ||| A E A E D ||| -245.045
-0 ||| A D E E B ||| -245.045
-0 ||| E D D D B ||| -246.045
-0 ||| B D D E C ||| -246.045
-0 ||| E C D E B ||| -246.045
-0 ||| E E C B C ||| -246.045
-0 ||| D C B E D ||| -246.045
-0 ||| D D D D C ||| -246.045
-0 ||| B E A E D ||| -246.045
-0 ||| C E D D B ||| -246.045
-0 ||| C A B E E ||| -246.045
-0 ||| B C B D E ||| -246.045
-0 ||| E C D A E ||| -246.045
-0 ||| C A E C E ||| -246.045
-0 ||| D C E A E ||| -246.045
-0 ||| E B B C E ||| -246.045
-0 ||| C D B C E ||| -246.045
-0 ||| E B A D E ||| -246.045
-0 ||| E C B B E ||| -246.045
-0 ||| D C E E B ||| -246.045
-0 ||| E D A C E ||| -246.045
-0 ||| B E C A E ||| -246.045
-0 ||| C B D C E ||| -246.045
-0 ||| B D E A E ||| -246.045
-0 ||| D A E B E ||| -246.045
-0 ||| B B E B E ||| -246.045
-0 ||| C D A D E ||| -246.045
-0 ||| E A A E E ||| -246.045
-0 ||| C C A E E ||| -246.045
-0 ||| B D E C D ||| -246.045
-0 ||| D B D B E ||| -246.045
-0 ||| D C C D D ||| -246.045
-0 ||| C B E E C ||| -246.045
-0 ||| D A E D D ||| -246.045
-0 ||| C E A C E ||| -246.045
-0 ||| C E E B C ||| -246.045
-0 ||| D D D A E ||| -246.045
-0 ||| D C E C D ||| -246.045
-0 ||| B C D C E ||| -246.045
-0 ||| E A C C E ||| -246.045
-0 ||| D D B D D ||| -246.045
-0 ||| D B C C E ||| -246.045
-0 ||| D D B B E ||| -246.045
-0 ||| D B D D D ||| -246.045
-0 ||| B B D E D ||| -246.045
-0 ||| B D E D C ||| -246.045
-0 ||| C A C D E ||| -246.045
-0 ||| D B A E E ||| -246.045
-0 ||| D E B A E ||| -246.045
-0 ||| B B E D D ||| -246.045
-0 ||| E A D D D ||| -246.045
-0 ||| C C D D D ||| -246.045
-0 ||| D E A D D ||| -246.045
-0 ||| E C E D B ||| -246.045
-0 ||| D E B E B ||| -246.045
-0 ||| C B B D E ||| -246.045
-0 ||| B A D D E ||| -246.045
-0 ||| B C C E D ||| -246.045
-0 ||| D C D E C ||| -246.045
-0 ||| D D D E B ||| -246.045
-0 ||| C C C C E ||| -246.045
-0 ||| E D C B D ||| -246.045
-0 ||| E E D C B ||| -246.045
-0 ||| D D E D B ||| -246.045
-0 ||| B D C B E ||| -246.045
-0 ||| B E C E B ||| -246.045
-0 ||| D C E D C ||| -246.045
-0 ||| C E E A D ||| -246.045
-0 ||| B E C D C ||| -246.045
-0 ||| E D E B C ||| -246.045
-0 ||| D E D E A ||| -246.045
-0 ||| B E C C D ||| -246.045
-0 ||| C C D B E ||| -246.045
-0 ||| C D E B D ||| -246.045
-0 ||| D E E D A ||| -246.045
-0 ||| C D C E C ||| -246.045
-0 ||| D C C B E ||| -246.045
-0 ||| B E E E A ||| -246.045
-0 ||| D A D E D ||| -246.045
-0 ||| E E D D A ||| -246.045
-0 ||| B D E E B ||| -246.045
-0 ||| B D B E D ||| -246.045
-0 ||| E C D C D ||| -246.045
-0 ||| B E E C C ||| -246.045
-0 ||| E B C E C ||| -246.045
-0 ||| E C D D C ||| -246.045
-0 ||| D E D C C ||| -246.045
-0 ||| B C E E C ||| -246.045
-0 ||| E C B D D ||| -246.045
-0 ||| C B C E D ||| -246.045
-0 ||| E B E B D ||| -246.045
-0 ||| D D D C D ||| -246.045
-0 ||| B A E E D ||| -246.045
-0 ||| B E B E C ||| -246.045
-0 ||| B E D B D ||| -246.045
-0 ||| D E B C D ||| -246.045
-0 ||| E A D B E ||| -246.045
-0 ||| D E A B E ||| -246.045
-0 ||| D E E C B ||| -246.045
-0 ||| E E C A D ||| -246.045
-0 ||| E E E A C ||| -246.045
-0 ||| D E B D C ||| -246.045
-0 ||| B D C D D ||| -246.045
-0 ||| E E B D B ||| -246.045
-0 ||| C E C B D ||| -246.045
-0 ||| E D E A D ||| -246.045
-0 ||| D E C D B ||| -246.045
-0 ||| A C E B E ||| -247.045
-0 ||| A E B B E ||| -247.045
-0 ||| A B E C E ||| -247.045
-0 ||| A D C C E ||| -247.045
-0 ||| A B B E E ||| -247.045
-0 ||| A D D D D ||| -247.045
-0 ||| A E D D C ||| -247.045
-0 ||| A E D E B ||| -247.045
-0 ||| A E E D B ||| -247.045
-0 ||| A D A E E ||| -247.045
-0 ||| A E D A E ||| -247.045
-0 ||| A B C D E ||| -247.045
-0 ||| A A C E E ||| -247.045
-0 ||| A E B D D ||| -247.045
-0 ||| A C D E D ||| -247.045
-0 ||| A E D C D ||| -247.045
-0 ||| A D D B E ||| -247.045
-0 ||| A C E D D ||| -247.045
-0 ||| B C D E D ||| -248.045
-0 ||| B C E D D ||| -248.045
-0 ||| C D E D C ||| -248.045
-0 ||| B E D C D ||| -248.045
-0 ||| C C E E C ||| -248.045
-0 ||| D D E B D ||| -248.045
-0 ||| C E B E C ||| -248.045
-0 ||| D E C B D ||| -248.045
-0 ||| D E A C E ||| -248.045
-0 ||| C B D E D ||| -248.045
-0 ||| B B E C E ||| -248.045
-0 ||| C E C C D ||| -248.045
-0 ||| C E E C C ||| -248.045
-0 ||| E E D B C ||| -248.045
-0 ||| E B E D C ||| -248.045
-0 ||| D D A D E ||| -248.045
-0 ||| E D C C D ||| -248.045
-0 ||| E C A D E ||| -248.045
-0 ||| C D E E B ||| -248.045
-0 ||| D C C C E ||| -248.045
-0 ||| C D E A E ||| -248.045
-0 ||| C C D C E ||| -248.045
-0 ||| C D C B E ||| -248.045
-0 ||| B B B E E ||| -248.045
-0 ||| E B E C D ||| -248.045
-0 ||| E C B C E ||| -248.045
-0 ||| B B C D E ||| -248.045
-0 ||| C E C A E ||| -248.045
-0 ||| C D D E C ||| -248.045
-0 ||| E B C B E ||| -248.045
-0 ||| B D C C E ||| -248.045
-0 ||| D C D B E ||| -248.045
-0 ||| E A E E C ||| -248.045
-0 ||| E E C C C ||| -248.045
-0 ||| B D A E E ||| -248.045
-0 ||| D E E B C ||| -248.045
-0 ||| E C C E C ||| -248.045
-0 ||| C B E B E ||| -248.045
-0 ||| D A E C E ||| -248.045
-0 ||| D E D D B ||| -248.045
-0 ||| E A D C E ||| -248.045
-0 ||| D B D C E ||| -248.045
-0 ||| E D C E B ||| -248.045
-0 ||| B E E D B ||| -248.045
-0 ||| B D D B E ||| -248.045
-0 ||| E E E B B ||| -248.045
-0 ||| E B B E D ||| -248.045
-0 ||| C E C D C ||| -248.045
-0 ||| B E D A E ||| -248.045
-0 ||| B E B B E ||| -248.045
-0 ||| D B B D E ||| -248.045
-0 ||| B C E B E ||| -248.045
-0 ||| D C A E E ||| -248.045
-0 ||| E C E B D ||| -248.045
-0 ||| C E C E B ||| -248.045
-0 ||| E D B E C ||| -248.045
-0 ||| D A B E E ||| -248.045
-0 ||| E D A E D ||| -248.045
-0 ||| E B E E B ||| -248.045
-0 ||| C A D D E ||| -248.045
-0 ||| B A C E E ||| -248.045
-0 ||| D D B C E ||| -248.045
-0 ||| C E A E D ||| -248.045
-0 ||| E D E C C ||| -248.045
-0 ||| B E D D C ||| -248.045
-0 ||| E A B D E ||| -248.045
-0 ||| E B D E C ||| -248.045
-0 ||| D C D D D ||| -248.045
-0 ||| C D E C D ||| -248.045
-0 ||| C D C D D ||| -248.045
-0 ||| D B C E D ||| -248.045
-0 ||| E D C A E ||| -248.045
-0 ||| C C C E D ||| -248.045
-0 ||| C E D B D ||| -248.045
-0 ||| E A C E D ||| -248.045
-0 ||| C B E D D ||| -248.045
-0 ||| D B E E C ||| -248.045
-0 ||| B E B D D ||| -248.045
-0 ||| D E E A D ||| -248.045
-0 ||| C D B E D ||| -248.045
-0 ||| D D C E C ||| -248.045
-0 ||| E D C D C ||| -248.045
-0 ||| E B E A E ||| -248.045
-0 ||| E E D A D ||| -248.045
-0 ||| C C B D E ||| -248.045
-0 ||| D A C D E ||| -248.045
-0 ||| B E D E B ||| -248.045
-0 ||| E B C D D ||| -248.045
-0 ||| C A E E D ||| -248.045
-0 ||| E E A E C ||| -248.045
-0 ||| B D D D D ||| -248.045
-0 ||| E D E E A ||| -248.045
-0 ||| E E B B D ||| -248.045
-0 ||| E E C E A ||| -248.045
-0 ||| E D D B D ||| -248.045
-0 ||| C E E E A ||| -248.045
-0 ||| A D D C E ||| -249.045
-0 ||| A A E D E ||| -249.045
-0 ||| A D E E C ||| -249.045
-0 ||| A C E C E ||| -249.045
-0 ||| A C C D E ||| -249.045
-0 ||| A D B D E ||| -249.045
-0 ||| A B E E D ||| -249.045
-0 ||| A A D E E ||| -249.045
-0 ||| A E E B D ||| -249.045
-0 ||| A E A D E ||| -249.045
-0 ||| A E C E C ||| -249.045
-0 ||| A D C E D ||| -249.045
-0 ||| A C B E E ||| -249.045
-0 ||| A E B C E ||| -249.045
-0 ||| A B D D E ||| -249.045
-0 ||| D C E E C ||| -250.045
-0 ||| C C E B E ||| -250.045
-0 ||| C E E D B ||| -250.045
-0 ||| C E D D C ||| -250.045
-0 ||| E A E D D ||| -250.045
-0 ||| D E C C D ||| -250.045
-0 ||| E E B A E ||| -250.045
-0 ||| E E C D B ||| -250.045
-0 ||| E D E D B ||| -250.045
-0 ||| E D D D C ||| -250.045
-0 ||| D D E C D ||| -250.045
-0 ||| E C D E C ||| -250.045
-0 ||| B C E C E ||| -250.045
-0 ||| E E A D D ||| -250.045
-0 ||| E A D E D ||| -250.045
-0 ||| C B E C E ||| -250.045
-0 ||| D E D B D ||| -250.045
-0 ||| D B E B E ||| -250.045
-0 ||| D E C E B ||| -250.045
-0 ||| E B D B E ||| -250.045
-0 ||| D B D E D ||| -250.045
-0 ||| C E B D D ||| -250.045
-0 ||| B D B D E ||| -250.045
-0 ||| C D D B E ||| -250.045
-0 ||| E C C B E ||| -250.045
-0 ||| E E E D A ||| -250.045
-0 ||| E D D E B ||| -250.045
-0 ||| E B A E E ||| -250.045
-0 ||| C A C E E ||| -250.045
-0 ||| E E D E A ||| -250.045
-0 ||| D E C D C ||| -250.045
-0 ||| D A D D E ||| -250.045
-0 ||| D C D C E ||| -250.045
-0 ||| D E E E A ||| -250.045
-0 ||| B C B E E ||| -250.045
-0 ||| E E B E B ||| -250.045
-0 ||| B A D E E ||| -250.045
-0 ||| E C E C D ||| -250.045
-0 ||| E D B B E ||| -250.045
-0 ||| D D E E B ||| -250.045
-0 ||| D D D E C ||| -250.045
-0 ||| D D C D D ||| -250.045
-0 ||| D B E D D ||| -250.045
-0 ||| C D C C E ||| -250.045
-0 ||| E C E D C ||| -250.045
-0 ||| C D A E E ||| -250.045
-0 ||| D E B E C ||| -250.045
-0 ||| E C B E D ||| -250.045
-0 ||| E B C C E ||| -250.045
-0 ||| E C C D D ||| -250.045
-0 ||| C B C D E ||| -250.045
-0 ||| E E D C C ||| -250.045
-0 ||| C B B E E ||| -250.045
-0 ||| B D D C E ||| -250.045
-0 ||| D D E D C ||| -250.045
-0 ||| B E C E C ||| -250.045
-0 ||| B B D D E ||| -250.045
-0 ||| C E D A E ||| -250.045
-0 ||| B C C D E ||| -250.045
-0 ||| E D D C D ||| -250.045
-0 ||| D D C B E ||| -250.045
-0 ||| C E B B E ||| -250.045
-0 ||| D D E A E ||| -250.045
-0 ||| B E A D E ||| -250.045
-0 ||| C C D E D ||| -250.045
-0 ||| E D D A E ||| -250.045
-0 ||| D E C A E ||| -250.045
-0 ||| D E A E D ||| -250.045
-0 ||| C C E D D ||| -250.045
-0 ||| B D E E C ||| -250.045
-0 ||| E E A B E ||| -250.045
-0 ||| E E B C D ||| -250.045
-0 ||| E A E B E ||| -250.045
-0 ||| E D B D D ||| -250.045
-0 ||| E B D D D ||| -250.045
-0 ||| D A E E D ||| -250.045
-0 ||| C E D E B ||| -250.045
-0 ||| C D D D D ||| -250.045
-0 ||| E E B D C ||| -250.045
-0 ||| E C E E B ||| -250.045
-0 ||| E E E C B ||| -250.045
-0 ||| B A E D E ||| -250.045
-0 ||| B D C E D ||| -250.045
-0 ||| B B E E D ||| -250.045
-0 ||| B E E B D ||| -250.045
-0 ||| D C C E D ||| -250.045
-0 ||| D D B E D ||| -250.045
-0 ||| B E B C E ||| -250.045
-0 ||| D C B D E ||| -250.045
-0 ||| E C E A E ||| -250.045
-0 ||| C E D C D ||| -250.045
-0 ||| D E E C C ||| -250.045
-0 ||| A E C B E ||| -251.045
-0 ||| A E E A E ||| -251.045
-0 ||| A B C E E ||| -251.045
-0 ||| A D D E D ||| -251.045
-0 ||| A E B E D ||| -251.045
-0 ||| A D E B E ||| -251.045
-0 ||| A E D E C ||| -251.045
-0 ||| A D E D D ||| -251.045
-0 ||| A C D D E ||| -251.045
-0 ||| A C E E D ||| -251.045
-0 ||| A E C D D ||| -251.045
-0 ||| A E E E B ||| -251.045
-0 ||| A E E D C ||| -251.045
-0 ||| A E E C D ||| -251.045
-0 ||| E A E C E ||| -252.045
-0 ||| B E E E B ||| -252.045
-0 ||| D D D D D ||| -252.045
-0 ||| D D D B E ||| -252.045
-0 ||| E B D C E ||| -252.045
-0 ||| E E C B D ||| -252.045
-0 ||| B D D E D ||| -252.045
-0 ||| E E A C E ||| -252.045
-0 ||| C C B E E ||| -252.045
-0 ||| C D C E D ||| -252.045
-0 ||| C C E C E ||| -252.045
-0 ||| C D E E C ||| -252.045
-0 ||| C B E E D ||| -252.045
-0 ||| C D B D E ||| -252.045
-0 ||| B D E D D ||| -252.045
-0 ||| D B B E E ||| -252.045
-0 ||| E C A E E ||| -252.045
-0 ||| E B B D E ||| -252.045
-0 ||| B E C B E ||| -252.045
-0 ||| D E D A E ||| -252.045
-0 ||| C E B C E ||| -252.045
-0 ||| C E E B D ||| -252.045
-0 ||| D E E D B ||| -252.045
-0 ||| B E E D C ||| -252.045
-0 ||| D E D D C ||| -252.045
-0 ||| E D C E C ||| -252.045
-0 ||| D C D E D ||| -252.045
-0 ||| E E E B C ||| -252.045
-0 ||| E A B E E ||| -252.045
-0 ||| D C E D D ||| -252.045
-0 ||| C E C E C ||| -252.045
-0 ||| C B D D E ||| -252.045
-0 ||| E D E B D ||| -252.045
-0 ||| B E C D D ||| -252.045
-0 ||| B B C E E ||| -252.045
-0 ||| C C C D E ||| -252.045
-0 ||| D A C E E ||| -252.045
-0 ||| E B E E C ||| -252.045
-0 ||| E C D B E ||| -252.045
-0 ||| D B E C E ||| -252.045
-0 ||| C A E D E ||| -252.045
-0 ||| E C C C E ||| -252.045
-0 ||| D B C D E ||| -252.045
-0 ||| D D C C E ||| -252.045
-0 ||| E D B C E ||| -252.045
-0 ||| D E B B E ||| -252.045
-0 ||| B D E B E ||| -252.045
-0 ||| C D D C E ||| -252.045
-0 ||| E E E A D ||| -252.045
-0 ||| B E E C D ||| -252.045
-0 ||| C E A D E ||| -252.045
-0 ||| D D A E E ||| -252.045
-0 ||| E E D D B ||| -252.045
-0 ||| B C D D E ||| -252.045
-0 ||| E C D D D ||| -252.045
-0 ||| E B C E D ||| -252.045
-0 ||| D E D C D ||| -252.045
-0 ||| B C E E D ||| -252.045
-0 ||| B E B E D ||| -252.045
-0 ||| E A C D E ||| -252.045
-0 ||| B E D E C ||| -252.045
-0 ||| D C E B E ||| -252.045
-0 ||| E D A D E ||| -252.045
-0 ||| B E E A E ||| -252.045
-0 ||| D E B D D ||| -252.045
-0 ||| D E D E B ||| -252.045
-0 ||| C A D E E ||| -252.045
-0 ||| A B D E E ||| -253.045
-0 ||| A E A E E ||| -253.045
-0 ||| A A E E E ||| -253.045
-0 ||| A D B E E ||| -253.045
-0 ||| A C C E E ||| -253.045
-0 ||| A D C D E ||| -253.045
-0 ||| A B E D E ||| -253.045
-0 ||| A E D D D ||| -253.045
-0 ||| A E D B E ||| -253.045
-0 ||| A E C C E ||| -253.045
-0 ||| A D E C E ||| -253.045
-0 ||| D C B E E ||| -254.045
-0 ||| D E A D E ||| -254.045
-0 ||| E E C D C ||| -254.045
-0 ||| C C D D E ||| -254.045
-0 ||| D E E B D ||| -254.045
-0 ||| E E C E B ||| -254.045
-0 ||| E D E D C ||| -254.045
-0 ||| D E C E C ||| -254.045
-0 ||| C E B E D ||| -254.045
-0 ||| B E A E E ||| -254.045
-0 ||| E D E E B ||| -254.045
-0 ||| C E E E B ||| -254.045
-0 ||| B E D B E ||| -254.045
-0 ||| E B E D D ||| -254.045
-0 ||| E D D E C ||| -254.045
-0 ||| E E B E C ||| -254.045
-0 ||| E E C C D ||| -254.045
-0 ||| E E E E A ||| -254.045
-0 ||| C D E D D ||| -254.045
-0 ||| E A E E D ||| -254.045
-0 ||| C D D E D ||| -254.045
-0 ||| B B D E E ||| -254.045
-0 ||| D D E E C ||| -254.045
-0 ||| D C C D E ||| -254.045
-0 ||| E D E A E ||| -254.045
-0 ||| D B D D E ||| -254.045
-0 ||| D D B D E ||| -254.045
-0 ||| E C C E D ||| -254.045
-0 ||| C B C E E ||| -254.045
-0 ||| E E D B D ||| -254.045
-0 ||| B B E D E ||| -254.045
-0 ||| E A D D E ||| -254.045
-0 ||| C E C D D ||| -254.045
-0 ||| D C E C E ||| -254.045
-0 ||| B C C E E ||| -254.045
-0 ||| C E E C D ||| -254.045
-0 ||| E D B E D ||| -254.045
-0 ||| C E E A E ||| -254.045
-0 ||| E D C B E ||| -254.045
-0 ||| B D E C E ||| -254.045
-0 ||| B E C C E ||| -254.045
-0 ||| C E E D C ||| -254.045
-0 ||| D D C E D ||| -254.045
-0 ||| E E A E D ||| -254.045
-0 ||| E E C A E ||| -254.045
-0 ||| E C B D E ||| -254.045
-0 ||| D A D E E ||| -254.045
-0 ||| B E D D D ||| -254.045
-0 ||| E C D C E ||| -254.045
-0 ||| C E C B E ||| -254.045
-0 ||| E D E C D ||| -254.045
-0 ||| E D C D D ||| -254.045
-0 ||| D A E D E ||| -254.045
-0 ||| E B D E D ||| -254.045
-0 ||| D B E E D ||| -254.045
-0 ||| C C E E D ||| -254.045
-0 ||| D E B C E ||| -254.045
-0 ||| E B E B E ||| -254.045
-0 ||| B A E E E ||| -254.045
-0 ||| D D D C E ||| -254.045
-0 ||| E E E C C ||| -254.045
-0 ||| C E D E C ||| -254.045
-0 ||| E C E E C ||| -254.045
-0 ||| B D C D E ||| -254.045
-0 ||| C D E B E ||| -254.045
-0 ||| B D B E E ||| -254.045
-0 ||| A C E D E ||| -255.045
-0 ||| A D D D E ||| -255.045
-0 ||| A E B D E ||| -255.045
-0 ||| A D E E D ||| -255.045
-0 ||| A E E E C ||| -255.045
-0 ||| A E D C E ||| -255.045
-0 ||| A C D E E ||| -255.045
-0 ||| A E C E D ||| -255.045
-0 ||| D E E A E ||| -256.045
-0 ||| C E A E E ||| -256.045
-0 ||| D E E C D ||| -256.045
-0 ||| B E E E C ||| -256.045
-0 ||| E E B D D ||| -256.045
-0 ||| E C D E D ||| -256.045
-0 ||| E D D D D ||| -256.045
-0 ||| E D A E E ||| -256.045
-0 ||| B C D E E ||| -256.045
-0 ||| B C E D E ||| -256.045
-0 ||| E E E D B ||| -256.045
-0 ||| B D D D E ||| -256.045
-0 ||| C B D E E ||| -256.045
-0 ||| D E C D D ||| -256.045
-0 ||| D E E E B ||| -256.045
-0 ||| E E D E B ||| -256.045
-0 ||| E B E C E ||| -256.045
-0 ||| D E C B E ||| -256.045
-0 ||| D D E D D ||| -256.045
-0 ||| D E E D C ||| -256.045
-0 ||| D D D E D ||| -256.045
-0 ||| E B B E E ||| -256.045
-0 ||| C E C C E ||| -256.045
-0 ||| C E D D D ||| -256.045
-0 ||| D E B E D ||| -256.045
-0 ||| E E D C D ||| -256.045
-0 ||| E C E B E ||| -256.045
-0 ||| D E D E C ||| -256.045
-0 ||| D C E E D ||| -256.045
-0 ||| E D C C E ||| -256.045
-0 ||| B E B D E ||| -256.045
-0 ||| B E C E D ||| -256.045
-0 ||| E D D B E ||| -256.045
-0 ||| B E D C E ||| -256.045
-0 ||| C B E D E ||| -256.045
-0 ||| C E D B E ||| -256.045
-0 ||| C C C E E ||| -256.045
-0 ||| D B C E E ||| -256.045
-0 ||| E C E D D ||| -256.045
-0 ||| D C D D E ||| -256.045
-0 ||| C D E C E ||| -256.045
-0 ||| C D C D E ||| -256.045
-0 ||| E E D D C ||| -256.045
-0 ||| B D E E D ||| -256.045
-0 ||| C A E E E ||| -256.045
-0 ||| E A C E E ||| -256.045
-0 ||| C D B E E ||| -256.045
-0 ||| E B C D E ||| -256.045
-0 ||| E E D A E ||| -256.045
-0 ||| E E B B E ||| -256.045
-0 ||| D D E B E ||| -256.045
-0 ||| A E E D D ||| -257.045
-0 ||| A D C E E ||| -257.045
-0 ||| A B E E E ||| -257.045
-0 ||| A E D E D ||| -257.045
-0 ||| A E E B E ||| -257.045
-0 ||| C C E D E ||| -258.045
-0 ||| D E D B E ||| -258.045
-0 ||| D C C E 

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/src/test/resources/kenlm/oilers.kenlm
----------------------------------------------------------------------
diff --git a/src/test/resources/kenlm/oilers.kenlm b/src/test/resources/kenlm/oilers.kenlm
deleted file mode 100644
index e343d7d..0000000
Binary files a/src/test/resources/kenlm/oilers.kenlm and /dev/null differ



[39/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/JoshuaConfiguration.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/JoshuaConfiguration.java
index 9b07a04,0000000..a2975c5
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/JoshuaConfiguration.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/JoshuaConfiguration.java
@@@ -1,730 -1,0 +1,735 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import static org.apache.joshua.util.Constants.TM_PREFIX;
 +import static org.apache.joshua.util.FormatUtils.cleanNonTerminal;
 +import static org.apache.joshua.util.FormatUtils.ensureNonTerminalBrackets;
 +
 +import java.io.BufferedReader;
 +import java.io.File;
 +import java.io.FileReader;
 +import java.io.FileWriter;
 +import java.io.IOException;
 +import java.io.PrintWriter;
 +import java.util.ArrayList;
 +import java.util.Collections;
 +
 +import org.apache.joshua.decoder.ff.StatefulFF;
 +import org.apache.joshua.decoder.ff.fragmentlm.Tree;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.Regex;
 +import org.apache.joshua.util.io.LineReader;
 +import org.apache.log4j.Level;
 +import org.apache.log4j.LogManager;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Configuration file for Joshua decoder.
 + *
 + * When adding new features to Joshua, any new configurable parameters should be added to this
 + * class.
 + *
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class JoshuaConfiguration {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(JoshuaConfiguration.class);
 +
 +  // whether to construct a StructuredTranslation object for each request instead of
 +  // printing to stdout. Used when the Decoder is used from Java directly.
 +  public Boolean use_structured_output = false;
 +
 +  // If set to true, Joshua will lowercase the input, creating an annotation that marks the
 +  // original case
 +  public boolean lowercase = false;
 +
 +  // If set to true, Joshua will recapitalize the output by projecting the case from aligned
 +  // source-side words
 +  public boolean project_case = false;
 +
 +  // List of grammar files to read
-   public ArrayList<String> tms = new ArrayList<String>();
++  public ArrayList<String> tms = new ArrayList<>();
 +
 +  // A rule cache for commonly used tries to avoid excess object allocations
 +  // Testing shows there's up to ~95% hit rate when cache size is 5000 Trie nodes.
-   public Integer cachedRuleSize = new Integer(5000);
++  public Integer cachedRuleSize = 5000;
 +
 +  /*
 +   * The file to read the weights from (part of the sparse features implementation). Weights can
 +   * also just be listed in the main config file.
 +   */
 +  public String weights_file = "";
 +  // Default symbols. The symbol here should be enclosed in square brackets.
 +  public String default_non_terminal = FormatUtils.ensureNonTerminalBrackets("X");
 +  public String goal_symbol = FormatUtils.ensureNonTerminalBrackets("GOAL");
 +
 +  /*
 +   * A list of OOV symbols in the form
 +   *
 +   * [X1] weight [X2] weight [X3] weight ...
 +   *
 +   * where the [X] symbols are nonterminals and the weights are weights. For each OOV word w in the
 +   * input sentence, Joshua will create rules of the form
 +   *
 +   * X1 -> w (weight)
 +   *
 +   * If this is empty, an unweighted default_non_terminal is used.
 +   */
 +  public class OOVItem implements Comparable<OOVItem> {
-     public String label;
++    public final String label;
 +
-     public float weight;
++    public final float weight;
 +
 +    OOVItem(String l, float w) {
 +      label = l;
 +      weight = w;
 +    }
 +    @Override
 +    public int compareTo(OOVItem other) {
 +      if (weight > other.weight)
 +        return -1;
 +      else if (weight < other.weight)
 +        return 1;
 +      return 0;
 +    }
 +  }
 +
 +  public ArrayList<OOVItem> oovList = null;
 +
 +  /*
 +   * Whether to segment OOVs into a lattice
 +   */
 +  public boolean segment_oovs = false;
 +
 +  /*
 +   * Enable lattice decoding.
 +   */
 +  public boolean lattice_decoding = false;
 +
 +  /*
 +   * If false, sorting of the complete grammar is done at load time. If true, grammar tries are not
 +   * sorted till they are first accessed. Amortized sorting means you get your first translation
 +   * much, much quicker (good for debugging), but that per-sentence decoding is a bit slower.
 +   */
 +  public boolean amortized_sorting = true;
 +  // syntax-constrained decoding
 +  public boolean constrain_parse = false;
 +
 +  public boolean use_pos_labels = false;
 +
 +  // oov-specific
 +  public boolean true_oovs_only = false;
 +
 +  /* Dynamic sentence-level filtering. */
 +  public boolean filter_grammar = false;
 +
 +  /* The cube pruning pop limit. Set to 0 for exhaustive pruning. */
 +  public int pop_limit = 100;
 +
 +  /* Maximum sentence length. Sentences longer than this are truncated. */
 +  public int maxlen = 200;
 +
 +  /*
 +   * N-best configuration.
 +   */
 +  // Make sure output strings in the n-best list are unique.
 +  public boolean use_unique_nbest = true;
 +
 +  /* Include the phrasal alignments in the output (not word-level alignmetns at the moment). */
 +  public boolean include_align_index = false;
 +
 +  /* The number of hypotheses to output by default. */
 +  public int topN = 1;
 +
 +  /**
 +   * This string describes the format of each line of output from the decoder (i.e., the
 +   * translations). The string can include arbitrary text and also variables. The following
 +   * variables are available:
 +   *
 +   * <pre>
 +   * - %i the 0-indexed sentence number
 +   * - %e the source string %s the translated sentence
 +   * - %S the translated sentence with some basic capitalization and denormalization
 +   * - %t the synchronous derivation
 +   * - %f the list of feature values (as name=value pairs)
 +   * - %c the model cost
 +   * - %w the weight vector
 +   * - %a the alignments between source and target words (currently unimplemented)
 +   * - %d a verbose, many-line version of the derivation
 +   * </pre>
 +   */
 +  public String outputFormat = "%i ||| %s ||| %f ||| %c";
 +
 +  /* The number of decoding threads to use (-threads). */
 +  public int num_parallel_decoders = 1;
 +
 +  /*
 +   * When true, _OOV is appended to all words that are passed through (useful for something like
 +   * transliteration on the target side
 +   */
 +  public boolean mark_oovs = false;
 +
 +  /* Enables synchronous parsing. */
 +  public boolean parse = false; // perform synchronous parsing
 +
 +
 +  /* A list of the feature functions. */
-   public ArrayList<String> features = new ArrayList<String>();
++  public ArrayList<String> features = new ArrayList<>();
 +
 +  /* A list of weights found in the main config file (instead of in a separate weights file) */
-   public ArrayList<String> weights = new ArrayList<String>();
++  public ArrayList<String> weights = new ArrayList<>();
 +
 +  /* Determines whether to expect JSON input or plain lines */
-   public enum INPUT_TYPE { plain, json };
++  public enum INPUT_TYPE { plain, json }
++
 +  public INPUT_TYPE input_type = INPUT_TYPE.plain;
 +
 +  /* Type of server. Not sure we need to keep the regular TCP one around. */
-   public enum SERVER_TYPE { none, TCP, HTTP };
++  public enum SERVER_TYPE { none, TCP, HTTP }
++
 +  public SERVER_TYPE server_type = SERVER_TYPE.TCP;
 +
 +  /* If set, Joshua will start a (multi-threaded, per "threads") TCP/IP server on this port. */
 +  public int server_port = 0;
 +
 +  /*
 +   * Whether to do forest rescoring. If set to true, the references are expected on STDIN along with
 +   * the input sentences in the following format:
 +   * 
 +   * input sentence ||| ||| reference1 ||| reference2 ...
 +   * 
 +   * (The second field is reserved for the output sentence for alignment and forced decoding).
 +   */
 +
 +  public boolean rescoreForest = false;
 +  public float rescoreForestWeight = 10.0f;
 +
 +  /*
 +   * Location of fragment mapping file, which maps flattened SCFG rules to their internal
 +   * representation.
 +   */
 +  public String fragmentMapFile = null;
 +
 +  /*
 +   * Whether to use soft syntactic constraint decoding /fuzzy matching, which allows that any
 +   * nonterminal may be substituted for any other nonterminal (except for OOV and GOAL)
 +   */
 +  public boolean fuzzy_matching = false;
 +
 +  public static final String SOFT_SYNTACTIC_CONSTRAINT_DECODING_PROPERTY_NAME = "fuzzy_matching";
 +
 +  /***
 +   * Phrase-based decoding parameters.
 +   */
 +  
 +  /* The search algorithm: currently either "cky" or "stack" */
 +  public String search_algorithm = "cky";
 +
 +  /* The distortion limit */
 +  public int reordering_limit = 8;
 +
 +  /* The number of target sides considered for each source side (after sorting by model weight) */
 +  public int num_translation_options = 20;
 +
 +  /* If true, decode using a dot chart (standard CKY+); if false, use the much more efficient
 +   * version of Sennrich (SSST 2014)
 +   */
 +  public boolean use_dot_chart = true;
 +
 +  /* Moses compatibility */
 +  public boolean moses = false;
 +
 +  /* If true, just print out the weights found in the config file, and exit. */
 +  public boolean show_weights_and_quit = false;
 +
 +  /* Read input from a file (Moses compatible flag) */
 +  public String input_file = null;
 +
 +  /* Write n-best output to this file */
 +  public String n_best_file = null;
 +
 +  /* Whether to look at source side for special annotations */
 +  public boolean source_annotations = false;
 +
 +  /* Weights overridden from the command line */
 +  public String weight_overwrite = "";
 +
 +  /**
 +   * This method resets the state of JoshuaConfiguration back to the state after initialization.
 +   * This is useful when for example making different calls to the decoder within the same java
 +   * program, which otherwise leads to potential errors due to inconsistent state as a result of
 +   * loading the configuration multiple times without resetting etc.
 +   *
 +   * This leads to the insight that in fact it may be an even better idea to refactor the code and
 +   * make JoshuaConfiguration an object that is is created and passed as an argument, rather than a
 +   * shared static object. This is just a suggestion for the next step.
 +   *
 +   */
 +  public void reset() {
 +    LOG.info("Resetting the JoshuaConfiguration to its defaults ...");
 +    LOG.info("\n\tResetting the StatefullFF global state index ...");
 +    LOG.info("\n\t...done");
 +    StatefulFF.resetGlobalStateIndex();
-     tms = new ArrayList<String>();
++    tms = new ArrayList<>();
 +    weights_file = "";
 +    default_non_terminal = "[X]";
-     oovList = new ArrayList<OOVItem>();
++    oovList = new ArrayList<>();
 +    oovList.add(new OOVItem(default_non_terminal, 1.0f));
 +    goal_symbol = "[GOAL]";
 +    amortized_sorting = true;
 +    constrain_parse = false;
 +    use_pos_labels = false;
 +    true_oovs_only = false;
 +    filter_grammar = false;
 +    pop_limit = 100;
 +    maxlen = 200;
 +    use_unique_nbest = false;
 +    include_align_index = false;
 +    topN = 1;
 +    outputFormat = "%i ||| %s ||| %f ||| %c";
 +    num_parallel_decoders = 1;
 +    mark_oovs = false;
 +    // oracleFile = null;
 +    parse = false; // perform synchronous parsing
-     features = new ArrayList<String>();
-     weights = new ArrayList<String>();
++    features = new ArrayList<>();
++    weights = new ArrayList<>();
 +    server_port = 0;
 +
 +    reordering_limit = 8;
 +    num_translation_options = 20;
 +    LOG.info("...done");
 +  }
 +
 +  // ===============================================================
 +  // Methods
 +  // ===============================================================
 +
 +  /**
 +   * To process command-line options, we write them to a file that looks like the config file, and
 +   * then call readConfigFile() on it. It would be more general to define a class that sits on a
 +   * stream and knows how to chop it up, but this was quicker to implement.
 +   * 
 +   * @param options string array of command line options
 +   */
 +  public void processCommandLineOptions(String[] options) {
 +    try {
 +      File tmpFile = File.createTempFile("options", null, null);
 +      PrintWriter out = new PrintWriter(new FileWriter(tmpFile));
 +
 +      for (int i = 0; i < options.length; i++) {
 +        String key = options[i].substring(1);
 +        if (i + 1 == options.length || options[i + 1].startsWith("-")) {
 +          // if this is the last item, or if the next item
 +          // is another flag, then this is a boolean flag
 +          out.println(key + " = true");
 +
 +        } else {
 +          out.print(key + " =");
 +          while (i + 1 < options.length && ! options[i + 1].startsWith("-")) {
 +            out.print(String.format(" %s", options[i + 1]));
 +            i++;
 +          }
 +          out.println();
 +        }
 +      }
 +      out.close();
 +      
 +//      LOG.info("Parameters overridden from the command line:");
 +      this.readConfigFile(tmpFile.getCanonicalPath());
 +
 +      tmpFile.delete();
 +
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +  }
 +
 +  public void readConfigFile(String configFile) throws IOException {
 +
 +    LineReader configReader = new LineReader(configFile, false);
 +    try {
 +      for (String line : configReader) {
 +        line = line.trim(); // .toLowerCase();
 +
 +        if (Regex.commentOrEmptyLine.matches(line))
 +          continue;
 +
 +        /*
 +         * There are two kinds of substantive (non-comment, non-blank) lines: parameters and feature
 +         * values. Parameters match the pattern "key = value"; all other substantive lines are
 +         * interpreted as features.
 +         */
 +
-         if (line.indexOf("=") != -1) { // parameters; (not feature function)
++        if (line.contains("=")) { // parameters; (not feature function)
 +          String[] fds = Regex.equalsWithSpaces.split(line, 2);
 +          if (fds.length < 2) {
 +            LOG.warn("skipping config file line '{}'", line);
 +            continue;
 +          }
 +
 +          String parameter = normalize_key(fds[0]);
 +
 +          if (parameter.equals(normalize_key("lm"))) {
 +            /* This is deprecated. This support old LM lines of the form
 +             * 
 +             *   lm = berkeleylm 5 false false 100 lm.gz
 +             * 
 +             * LMs are now loaded as general feature functions, so we transform that to either
 +             * 
 +             *   LanguageModel -lm_order 5 -lm_type berkeleylm -lm_file lm.gz
 +             * 
 +             * If the line were state minimizing:
 +             * 
 +             *   lm = kenlm 5 true false 100 lm.gz
 +             *              
 +             * StateMinimizingLanguageModel -lm_order 5 -lm_file lm.gz
 +             */
 +
 +            String[] tokens = fds[1].split("\\s+");
 +            if (tokens[2].equals("true"))
 +              features.add(String.format("StateMinimizingLanguageModel -lm_type kenlm -lm_order %s -lm_file %s",
 +                  tokens[1], tokens[5]));
 +            else
 +              features.add(String.format("LanguageModel -lm_type %s -lm_order %s -lm_file %s",
 +                  tokens[0], tokens[1], tokens[5]));
 +
 +          } else if (parameter.equals(normalize_key(TM_PREFIX))) {
 +            /* If found, convert old format:
 +             *   tm = TYPE OWNER MAXSPAN PATH
 +             * to new format
 +             *   tm = TYPE -owner OWNER -maxspan MAXSPAN -path PATH    
 +             */
 +            String tmLine = fds[1];
 +
 +            String[] tokens = fds[1].split("\\s+");
 +            if (! tokens[1].startsWith("-")) { // old format
 +              tmLine = String.format("%s -owner %s -maxspan %s -path %s", tokens[0], tokens[1], tokens[2], tokens[3]);
 +              LOG.warn("Converting deprecated TM line from '{}' -> '{}'", fds[1], tmLine);
 +            }
 +            tms.add(tmLine);
 +
 +          } else if (parameter.equals("v")) {
 +
 +            // This is already handled in ArgsParser, skip it here, easier than removing it there
 +
 +          } else if (parameter.equals(normalize_key("parse"))) {
 +            parse = Boolean.parseBoolean(fds[1]);
 +            LOG.debug("parse: {}", parse);
 +
 +          } else if (parameter.equals(normalize_key("oov-list"))) {
 +            if (new File(fds[1]).exists()) {
-               oovList = new ArrayList<OOVItem>();
++              oovList = new ArrayList<>();
 +              try {
 +                File file = new File(fds[1]);
 +                BufferedReader br = new BufferedReader(new FileReader(file));
 +                try {
 +                  String str = br.readLine();
 +                  while (str != null) {
 +                    String[] tokens = str.trim().split("\\s+");
 +
 +                    oovList.add(new OOVItem(FormatUtils.ensureNonTerminalBrackets(tokens[0]),
 +                            (float) Math.log(Float.parseFloat(tokens[1]))));
 +
 +                    str = br.readLine();
 +                  }
 +                  br.close();
 +                } catch(IOException e){
 +                  System.out.println(e);
 +                }
 +              } catch(IOException e){
 +                System.out.println(e);
 +              }
 +              Collections.sort(oovList);
 +
 +            } else {
 +              String[] tokens = fds[1].trim().split("\\s+");
 +              if (tokens.length % 2 != 0) {
 +                throw new RuntimeException(String.format("* FATAL: invalid format for '%s'", fds[0]));
 +              }
-               oovList = new ArrayList<OOVItem>();
++              oovList = new ArrayList<>();
 +
 +              for (int i = 0; i < tokens.length; i += 2)
 +                oovList.add(new OOVItem(FormatUtils.ensureNonTerminalBrackets(tokens[i]),
 +                    (float) Math.log(Float.parseFloat(tokens[i + 1]))));
 +
 +              Collections.sort(oovList);
 +            }
 +
 +          } else if (parameter.equals(normalize_key("lattice-decoding"))) {
 +            lattice_decoding = true;
 +
 +          } else if (parameter.equals(normalize_key("segment-oovs"))) {
 +            segment_oovs = true;
 +            lattice_decoding = true;
 +
 +          } else if (parameter.equals(normalize_key("default-non-terminal"))) {
 +            default_non_terminal = ensureNonTerminalBrackets(cleanNonTerminal(fds[1].trim()));
 +            LOG.debug("default_non_terminal: {}", default_non_terminal);
 +
 +          } else if (parameter.equals(normalize_key("goal-symbol"))) {
 +            goal_symbol = ensureNonTerminalBrackets(cleanNonTerminal(fds[1].trim()));
 +            LOG.debug("goalSymbol: {}", goal_symbol);
 +
 +          } else if (parameter.equals(normalize_key("weights-file"))) {
 +            weights_file = fds[1];
 +
 +          } else if (parameter.equals(normalize_key("constrain_parse"))) {
 +            constrain_parse = Boolean.parseBoolean(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("true_oovs_only"))) {
 +            true_oovs_only = Boolean.parseBoolean(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("filter-grammar"))) {
 +            filter_grammar = Boolean.parseBoolean(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("amortize"))) {
 +            amortized_sorting = Boolean.parseBoolean(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("use_pos_labels"))) {
 +            use_pos_labels = Boolean.parseBoolean(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("use_unique_nbest"))) {
 +            use_unique_nbest = Boolean.valueOf(fds[1]);
 +            LOG.debug("use_unique_nbest: {}", use_unique_nbest);
 +
 +          } else if (parameter.equals(normalize_key("output-format"))) {
 +            outputFormat = fds[1];
 +            LOG.debug("output-format: {}", outputFormat);
 +
 +          } else if (parameter.equals(normalize_key("include_align_index"))) {
 +            include_align_index = Boolean.valueOf(fds[1]);
 +            LOG.debug("include_align_index: {}", include_align_index);
 +
 +          } else if (parameter.equals(normalize_key("top_n"))) {
 +            topN = Integer.parseInt(fds[1]);
 +            LOG.debug("topN: {}", topN);
 +
 +          } else if (parameter.equals(normalize_key("num_parallel_decoders"))
 +              || parameter.equals(normalize_key("threads"))) {
 +            num_parallel_decoders = Integer.parseInt(fds[1]);
 +            if (num_parallel_decoders <= 0) {
 +              throw new IllegalArgumentException(
 +                  "Must specify a positive number for num_parallel_decoders");
 +            }
 +            LOG.debug("num_parallel_decoders: {}", num_parallel_decoders);
 +
 +          } else if (parameter.equals(normalize_key("mark_oovs"))) {
 +            mark_oovs = Boolean.valueOf(fds[1]);
 +            LOG.debug("mark_oovs: {}", mark_oovs);
 +
 +          } else if (parameter.equals(normalize_key("pop-limit"))) {
 +            pop_limit = Integer.parseInt(fds[1]);
 +            LOG.info("pop-limit: {}", pop_limit);
 +
 +          } else if (parameter.equals(normalize_key("input-type"))) {
-             if (fds[1].equals("json")) {
++            switch (fds[1]) {
++            case "json":
 +              input_type = INPUT_TYPE.json;
-             } else if (fds[1].equals("plain")) {
++              break;
++            case "plain":
 +              input_type = INPUT_TYPE.plain;
-             } else {
-               throw new RuntimeException(String.format("* FATAL: invalid server type '%s'", fds[1]));
++              break;
++            default:
++              throw new RuntimeException(
++                  String.format("* FATAL: invalid server type '%s'", fds[1]));
 +            }
 +            LOG.info("    input-type: {}", input_type);
 +
 +          } else if (parameter.equals(normalize_key("server-type"))) {
 +            if (fds[1].toLowerCase().equals("tcp"))
 +              server_type = SERVER_TYPE.TCP;
 +            else if (fds[1].toLowerCase().equals("http"))
 +              server_type = SERVER_TYPE.HTTP;
 +
 +            LOG.info("    server-type: {}", server_type);
 +
 +          } else if (parameter.equals(normalize_key("server-port"))) {
 +            server_port = Integer.parseInt(fds[1]);
 +            LOG.info("    server-port: {}", server_port);
 +
 +          } else if (parameter.equals(normalize_key("rescore-forest"))) {
 +            rescoreForest = true;
 +            LOG.info("    rescore-forest: {}", rescoreForest);
 +
 +          } else if (parameter.equals(normalize_key("rescore-forest-weight"))) {
 +            rescoreForestWeight = Float.parseFloat(fds[1]);
 +            LOG.info("    rescore-forest-weight: {}", rescoreForestWeight);
 +
 +          } else if (parameter.equals(normalize_key("maxlen"))) {
 +            // reset the maximum length
 +            maxlen = Integer.parseInt(fds[1]);
 +
 +          } else if (parameter.equals("c") || parameter.equals("config")) {
 +            // this was used to send in the config file, just ignore it
-             ;
 +
 +          } else if (parameter.equals(normalize_key("feature-function"))) {
 +            // add the feature to the list of features for later processing
 +            features.add(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("maxlen"))) {
 +            // add the feature to the list of features for later processing
 +            maxlen = Integer.parseInt(fds[1]);
 +
 +          } else if (parameter
 +              .equals(normalize_key(SOFT_SYNTACTIC_CONSTRAINT_DECODING_PROPERTY_NAME))) {
 +            fuzzy_matching = Boolean.parseBoolean(fds[1]);
 +            LOG.debug("fuzzy_matching: {}", fuzzy_matching);
 +
 +          } else if (parameter.equals(normalize_key("fragment-map"))) {
 +            fragmentMapFile = fds[1];
 +            Tree.readMapping(fragmentMapFile);
 +
 +            /** PHRASE-BASED PARAMETERS **/
 +          } else if (parameter.equals(normalize_key("search"))) {
 +            search_algorithm = fds[1];
 +
 +            if (!search_algorithm.equals("cky") && !search_algorithm.equals("stack")) {
 +              throw new RuntimeException(
 +                  "-search must be one of 'stack' (for phrase-based decoding) " +
 +                      "or 'cky' (for hierarchical / syntactic decoding)");
 +            }
 +
 +            if (search_algorithm.equals("cky") && include_align_index) {
 +              throw new RuntimeException(
 +                  "include_align_index is currently not supported with cky search");
 +            }
 +
 +          } else if (parameter.equals(normalize_key("reordering-limit"))) {
 +            reordering_limit = Integer.parseInt(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("num-translation-options"))) {
 +            num_translation_options = Integer.parseInt(fds[1]);
 +
 +          } else if (parameter.equals(normalize_key("no-dot-chart"))) {
 +            use_dot_chart = false;
 +
 +          } else if (parameter.equals(normalize_key("moses"))) {
 +            moses = true; // triggers some Moses-specific compatibility options
 +
 +          } else if (parameter.equals(normalize_key("show-weights"))) {
 +            show_weights_and_quit = true;
 +
 +          } else if (parameter.equals(normalize_key("n-best-list"))) {
 +            // for Moses compatibility
 +            String[] tokens = fds[1].split("\\s+");
 +            n_best_file = tokens[0];
 +            if (tokens.length > 1)
 +              topN = Integer.parseInt(tokens[1]);
 +
 +          } else if (parameter.equals(normalize_key("input-file"))) {
 +            // for Moses compatibility
 +            input_file = fds[1];
 +
 +          } else if (parameter.equals(normalize_key("weight-file"))) {
 +            // for Moses, ignore
 +
 +          } else if (parameter.equals(normalize_key("weight-overwrite"))) {
 +            weight_overwrite = fds[1];
 +
 +          } else if (parameter.equals(normalize_key("source-annotations"))) {
 +            // Check source sentence
 +            source_annotations = true;
 +
 +          } else if (parameter.equals(normalize_key("cached-rules-size"))) {
 +            // Check source sentence
 +            cachedRuleSize = Integer.parseInt(fds[1]);
 +          } else if (parameter.equals(normalize_key("lowercase"))) {
 +            lowercase = true;
 +
 +          } else if (parameter.equals(normalize_key("project-case"))) {
 +            project_case = true;
 +
 +          } else {
 +
 +            if (parameter.equals(normalize_key("use-sent-specific-tm"))
 +                || parameter.equals(normalize_key("add-combined-cost"))
 +                || parameter.equals(normalize_key("use-tree-nbest"))
 +                || parameter.equals(normalize_key("use-kenlm"))
 +                || parameter.equals(normalize_key("useCubePrune"))
 +                || parameter.equals(normalize_key("useBeamAndThresholdPrune"))
 +                || parameter.equals(normalize_key("regexp-grammar"))) {
 +              LOG.warn("ignoring deprecated parameter '{}'", fds[0]);
 +
 +            } else {
 +              throw new RuntimeException("FATAL: unknown configuration parameter '" + fds[0] + "'");
 +            }
 +          }
 +
 +          LOG.info("    {} = '{}'", normalize_key(fds[0]), fds[1]);
 +
 +        } else {
 +          /*
 +           * Lines that don't have an equals sign and are not blank lines, empty lines, or comments,
 +           * are feature values, which can be present in this file
 +           */
 +
 +          weights.add(line);
 +        }
 +      }
 +    } finally {
 +      configReader.close();
 +    }
 +  }
 +
 +  /**
 +   * Checks for invalid variable configurations
 +   */
 +  public void sanityCheck() {
 +  }
 +  
 +  /**
 +   * Sets the verbosity level to v (0: OFF; 1: INFO; 2: DEBUG).
 +   * 
 +   * @param v the verbosity level (0, 1, or 2)
 +   */
 +  public void setVerbosity(int v) {
 +    Decoder.VERBOSE = v;
 +    switch (Decoder.VERBOSE) {
 +    case 0:
 +      LogManager.getRootLogger().setLevel(Level.OFF);
 +      break;
 +    case 1:
 +      LogManager.getRootLogger().setLevel(Level.INFO);
 +      break;
 +    case 2:
 +      LogManager.getRootLogger().setLevel(Level.DEBUG);
 +      break;
 +    }
 +  }
 +
 +  /**
 +   * Normalizes parameter names by removing underscores and hyphens and lowercasing. This defines
 +   * equivalence classes on external use of parameter names, permitting arbitrary_under_scores and
 +   * camelCasing in paramter names without forcing the user to memorize them all. Here are some
 +   * examples of equivalent ways to refer to parameter names:
 +   * <pre>
 +   * {pop-limit, poplimit, PopLimit, popLimit, pop_lim_it} {lmfile, lm-file, LM-FILE, lm_file}
 +   * </pre>
 +   * 
 +   * @param text the string to be normalized
 +   * @return normalized key
 +   * 
 +   */
 +  public static String normalize_key(String text) {
 +    return text.replaceAll("[-_]", "").toLowerCase();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/NbestMinRiskReranker.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/NbestMinRiskReranker.java
index 9f63cad,0000000..d3913fb
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/NbestMinRiskReranker.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/NbestMinRiskReranker.java
@@@ -1,446 -1,0 +1,443 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map.Entry;
 +import java.util.Scanner;
 +import java.util.concurrent.ExecutorService;
 +import java.util.concurrent.Executors;
 +import java.util.concurrent.PriorityBlockingQueue;
 +import java.util.concurrent.TimeUnit;
 +
 +import org.apache.joshua.util.Ngram;
 +import org.apache.joshua.util.Regex;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * this class implements: (1) nbest min risk (MBR) reranking using BLEU as a gain funtion.
 + * <p>
 + * This assume that the string is unique in the nbest list In Hiero, due to spurious ambiguity, a
 + * string may correspond to many possible derivations, and ideally the probability of a string
 + * should be the sum of all the derivataions leading to that string. But, in practice, one normally
 + * uses a Viterbi approximation: the probability of a string is its best derivation probability So,
 + * if one want to deal with spurious ambiguity, he/she should do that before calling this class
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + */
 +public class NbestMinRiskReranker {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(NbestMinRiskReranker.class);
 +
 +  // TODO: this functionality is not implemented yet; default is to produce 1best without any
 +  // feature scores;
 +  boolean produceRerankedNbest = false;
 +
 +  double scalingFactor = 1.0;
 +
-   static int bleuOrder = 4;
-   static boolean doNgramClip = true;
++  static final int bleuOrder = 4;
++  static final boolean doNgramClip = true;
 +
-   static boolean useGoogleLinearCorpusGain = false;
++  static final boolean useGoogleLinearCorpusGain = false;
 +
-   final PriorityBlockingQueue<RankerResult> resultsQueue =
-       new PriorityBlockingQueue<RankerResult>();
++  final PriorityBlockingQueue<RankerResult> resultsQueue = new PriorityBlockingQueue<>();
 +
 +  public NbestMinRiskReranker(boolean produceRerankedNbest, double scalingFactor) {
 +    this.produceRerankedNbest = produceRerankedNbest;
 +    this.scalingFactor = scalingFactor;
 +  }
 +
 +
 +  public String processOneSent(List<String> nbest, int sentID) {
 +    LOG.info("Now process sentence {}", sentID);
 +
 +    // step-0: preprocess
 +    // assumption: each hyp has a formate:
 +    // "sent_id ||| hyp_itself ||| feature scores ||| linear-combination-of-feature-scores(this should be logP)"
 +
 +    /* Quit if you find an empty hypothesis. */
 +    if (nbest.size() == 1) {
 +      String[] fields = Regex.threeBarsWithSpace.split(nbest.get(0));
 +      if (fields[1].equals("") || Regex.spaces.matches(fields[1])) {
 +        LOG.warn("-> sentence is empty");
 +        return "";
 +      }
 +    } 
 +
-     List<String> hypsItself = new ArrayList<String>();
++    List<String> hypsItself = new ArrayList<>();
 +    // ArrayList<String> l_feat_scores = new ArrayList<String>();
-     List<Double> baselineScores = new ArrayList<Double>(); // linear combination of all baseline
++    List<Double> baselineScores = new ArrayList<>(); // linear combination of all baseline
 +                                                           // features
-     List<HashMap<String, Integer>> ngramTbls = new ArrayList<HashMap<String, Integer>>();
-     List<Integer> sentLens = new ArrayList<Integer>();
++    List<HashMap<String, Integer>> ngramTbls = new ArrayList<>();
++    List<Integer> sentLens = new ArrayList<>();
 +
 +    for (String hyp : nbest) {
 +      String[] fds = Regex.threeBarsWithSpace.split(hyp);
 +      int tSentID = Integer.parseInt(fds[0]);
 +      if (sentID != tSentID) {
 +        throw new RuntimeException("sentence_id does not match");
 +      }
 +      String hypothesis = (fds.length >= 4) ? fds[1] : "";
 +      hypsItself.add(hypothesis);
 +
 +      String[] words = Regex.spaces.split(hypothesis);
 +      sentLens.add(words.length);
 +
-       HashMap<String, Integer> ngramTbl = new HashMap<String, Integer>();
++      HashMap<String, Integer> ngramTbl = new HashMap<>();
 +      Ngram.getNgrams(ngramTbl, 1, bleuOrder, words);
 +      ngramTbls.add(ngramTbl);
 +
 +      // l_feat_scores.add(fds[2]);
 +
 +      // The value of finalIndex is expected to be 3,
 +      // unless the hyp_itself is empty,
 +      // in which case finalIndex will be 2.
 +      int finalIndex = fds.length - 1;
 +      baselineScores.add(Double.parseDouble(fds[finalIndex]));
 +
 +    }
 +
 +    // step-1: get normalized distribution
 +
 +    /**
 +     * value in baselineScores will be changed to normalized probability
 +     * */
 +    computeNormalizedProbs(baselineScores, scalingFactor);
 +
-     List<Double> normalizedProbs = baselineScores;
- 
 +    // === required by google linear corpus gain
 +    HashMap<String, Double> posteriorCountsTbl = null;
 +    if (useGoogleLinearCorpusGain) {
-       posteriorCountsTbl = new HashMap<String, Double>();
-       getGooglePosteriorCounts(ngramTbls, normalizedProbs, posteriorCountsTbl);
++      posteriorCountsTbl = new HashMap<>();
++      getGooglePosteriorCounts(ngramTbls, baselineScores, posteriorCountsTbl);
 +    }
 +
 +
 +    // step-2: rerank the nbest
 +    /**
 +     * TODO: zhifei: now the re-ranking takes O(n^2) where n is the size of the nbest. But, we can
 +     * significantly speed up this (leadding to O(n)) by first estimating a model on nbest, and then
 +     * rerank the nbest using the estimated model.
 +     * */
 +    double bestGain = -1000000000;// set as worst gain
 +    String bestHyp = null;
-     List<Double> gains = new ArrayList<Double>();
++    List<Double> gains = new ArrayList<>();
 +    for (int i = 0; i < hypsItself.size(); i++) {
 +      String curHyp = hypsItself.get(i);
 +      int curHypLen = sentLens.get(i);
 +      HashMap<String, Integer> curHypNgramTbl = ngramTbls.get(i);
 +      // double cur_gain = computeGain(cur_hyp, l_hyp_itself, l_normalized_probs);
 +      double curGain = 0;
 +      if (useGoogleLinearCorpusGain) {
 +        curGain = computeExpectedLinearCorpusGain(curHypLen, curHypNgramTbl, posteriorCountsTbl);
 +      } else {
 +        curGain =
-             computeExpectedGain(curHypLen, curHypNgramTbl, ngramTbls, sentLens, normalizedProbs);
++            computeExpectedGain(curHypLen, curHypNgramTbl, ngramTbls, sentLens, baselineScores);
 +      }
 +
 +      gains.add(curGain);
 +      if (i == 0 || curGain > bestGain) { // maximize
 +        bestGain = curGain;
 +        bestHyp = curHyp;
 +      }
 +    }
 +
 +    // step-3: output the 1best or nbest
 +    if (this.produceRerankedNbest) {
 +      // TOTO: sort the list and write the reranked nbest; Use Collections.sort(List list,
 +      // Comparator c)
 +    } else {
 +      /*
 +       * this.out.write(best_hyp); this.out.write("\n"); out.flush();
 +       */
 +    }
 +
 +    LOG.info("best gain: {}", bestGain);
 +    if (null == bestHyp) {
 +      throw new RuntimeException("mbr reranked one best is null, must be wrong");
 +    }
 +    return bestHyp;
 +  }
 +
 +
 +  /**
 +   * based on a list of log-probabilities in nbestLogProbs, obtain a normalized distribution, and
 +   * put the normalized probability (real value in [0,1]) into nbestLogProbs
 +   * 
 +   * @param nbestLogProbs a {@link java.util.List} of {@link java.lang.Double} representing nbestLogProbs
 +   * @param scalingFactor double value representing scaling factor
 +   */
 +  // get a normalized distributeion and put it back to nbestLogProbs
 +  static public void computeNormalizedProbs(List<Double> nbestLogProbs, double scalingFactor) {
 +
 +    // === get noralization constant, remember features, remember the combined linear score
 +    double normalizationConstant = Double.NEGATIVE_INFINITY;// log-semiring
 +
 +    for (double logp : nbestLogProbs) {
 +      normalizationConstant = addInLogSemiring(normalizationConstant, logp * scalingFactor, 0);
 +    }
 +    // System.out.println("normalization_constant (logP) is " + normalization_constant);
 +
 +    // === get normalized prob for each hyp
 +    double tSum = 0;
 +    for (int i = 0; i < nbestLogProbs.size(); i++) {
 +
 +      double normalizedProb =
 +          Math.exp(nbestLogProbs.get(i) * scalingFactor - normalizationConstant);
 +      tSum += normalizedProb;
 +      nbestLogProbs.set(i, normalizedProb);
 +
 +      if (Double.isNaN(normalizedProb)) {
 +        throw new RuntimeException("prob is NaN, must be wrong\nnbest_logps.get(i): "
 +            + nbestLogProbs.get(i) + "; scaling_factor: " + scalingFactor
 +            + "; normalization_constant:" + normalizationConstant);
 +      }
 +      // logger.info("probability: " + normalized_prob);
 +    }
 +
 +    // sanity check
 +    if (Math.abs(tSum - 1.0) > 1e-4) {
 +      throw new RuntimeException("probabilities not sum to one, must be wrong");
 +    }
 +
 +  }
 +
 +
 +  // Gain(e) = negative risk = \sum_{e'} G(e, e')P(e')
 +  // curHyp: e
 +  // trueHyp: e'
 +  public double computeExpectedGain(int curHypLen, HashMap<String, Integer> curHypNgramTbl,
 +      List<HashMap<String, Integer>> ngramTbls, List<Integer> sentLens, List<Double> nbestProbs) {
 +
 +    // ### get noralization constant, remember features, remember the combined linear score
 +    double gain = 0;
 +
 +    for (int i = 0; i < nbestProbs.size(); i++) {
 +      HashMap<String, Integer> trueHypNgramTbl = ngramTbls.get(i);
 +      double trueProb = nbestProbs.get(i);
 +      int trueLen = sentLens.get(i);
 +      gain +=
 +          trueProb
 +              * BLEU.computeSentenceBleu(trueLen, trueHypNgramTbl, curHypLen, curHypNgramTbl,
 +                  doNgramClip, bleuOrder);
 +    }
 +    // System.out.println("Gain is " + gain);
 +    return gain;
 +  }
 +
 +  // Gain(e) = negative risk = \sum_{e'} G(e, e')P(e')
 +  // curHyp: e
 +  // trueHyp: e'
 +  static public double computeExpectedGain(String curHyp, List<String> nbestHyps,
 +      List<Double> nbestProbs) {
 +    // ### get noralization constant, remember features, remember the combined linear score
 +    double gain = 0;
 +
 +    for (int i = 0; i < nbestHyps.size(); i++) {
 +      String trueHyp = nbestHyps.get(i);
 +      double trueProb = nbestProbs.get(i);
 +      gain += trueProb * BLEU.computeSentenceBleu(trueHyp, curHyp, doNgramClip, bleuOrder);
 +    }
 +    // System.out.println("Gain is " + gain);
 +    return gain;
 +  }
 +
 +  void getGooglePosteriorCounts(List<HashMap<String, Integer>> ngramTbls,
 +      List<Double> normalizedProbs, HashMap<String, Double> posteriorCountsTbl) {
 +    // TODO
 +  }
 +
 +  double computeExpectedLinearCorpusGain(int curHypLen, HashMap<String, Integer> curHypNgramTbl,
 +      HashMap<String, Double> posteriorCountsTbl) {
 +    // TODO
 +    double[] thetas = {-1, 1, 1, 1, 1};
 +
 +    double res = 0;
 +    res += thetas[0] * curHypLen;
 +    for (Entry<String, Integer> entry : curHypNgramTbl.entrySet()) {
 +      String key = entry.getKey();
 +      String[] tem = Regex.spaces.split(key);
 +
 +      double post_prob = posteriorCountsTbl.get(key);
 +      res += entry.getValue() * post_prob * thetas[tem.length];
 +    }
 +    return res;
 +  }
 +
 +  // OR: return Math.log(Math.exp(x) + Math.exp(y));
 +  static private double addInLogSemiring(double x, double y, int addMode) {// prevent over-flow
 +    if (addMode == 0) { // sum
 +      if (x == Double.NEGATIVE_INFINITY) {// if y is also n-infinity, then return n-infinity
 +        return y;
 +      }
 +      if (y == Double.NEGATIVE_INFINITY) {
 +        return x;
 +      }
 +
 +      if (y <= x) {
 +        return x + Math.log(1 + Math.exp(y - x));
 +      } else {
 +        return y + Math.log(1 + Math.exp(x - y));
 +      }
 +    } else if (addMode == 1) { // viter-min
 +      return (x <= y) ? x : y;
 +    } else if (addMode == 2) { // viter-max
 +      return (x >= y) ? x : y;
 +    } else {
 +      throw new RuntimeException("invalid add mode");
 +    }
 +  }
 +
 +
 +
 +  public static void main(String[] args) throws IOException {
 +
 +    // If you don't know what to use for scaling factor, try using 1
 +
 +    if (args.length < 2) {
 +      String msg = "usage: java NbestMinRiskReranker <produce_reranked_nbest> <scaling_factor> "
 +          + "[numThreads]";
 +      System.err.println(msg);
 +      LOG.error(msg);
 +      return;
 +    }
 +    long startTime = System.currentTimeMillis();
 +    boolean produceRerankedNbest = Boolean.valueOf(args[0].trim());
 +    double scalingFactor = Double.parseDouble(args[1].trim());
 +    int numThreads = (args.length > 2) ? Integer.parseInt(args[2].trim()) : 1;
 +
 +
 +    NbestMinRiskReranker mbrReranker =
 +        new NbestMinRiskReranker(produceRerankedNbest, scalingFactor);
 +
 +    LOG.info("Running mbr reranking");
 +
 +    int oldSentID = -1;
-     List<String> nbest = new ArrayList<String>();
++    List<String> nbest = new ArrayList<>();
 +
 +    Scanner scanner = new Scanner(System.in, "UTF-8");
 +
 +    if (numThreads == 1) {
 +
 +      while (scanner.hasNextLine()) {
 +        String line = scanner.nextLine();
 +        String[] fds = Regex.threeBarsWithSpace.split(line);
 +        int newSentID = Integer.parseInt(fds[0]);
 +        if (oldSentID != -1 && oldSentID != newSentID) {
 +          if (nbest.size() > 0) {
 +            String best_hyp = mbrReranker.processOneSent(nbest, oldSentID);// nbest: list of unique
 +                                                                           // strings
 +            System.out.println(best_hyp);
 +          } else {
 +            System.out.println();
 +          }
 +          nbest.clear();
 +        }
 +        oldSentID = newSentID;
 +        if (!fds[1].matches("^\\s*$")) nbest.add(line);
 +      }
 +
 +      // last nbest
 +      if (oldSentID >= 0) {
 +        String bestHyp = mbrReranker.processOneSent(nbest, oldSentID);
 +        System.out.println(bestHyp);
 +        nbest.clear();
 +      }
 +
 +    } else {
 +
 +      ExecutorService threadPool = Executors.newFixedThreadPool(numThreads);
 +
 +      while (scanner.hasNextLine()) {
 +        String line = scanner.nextLine();
 +        String[] fds = Regex.threeBarsWithSpace.split(line);
 +        int newSentID = Integer.parseInt(fds[0]);
 +        if (oldSentID != -1 && oldSentID != newSentID) {
 +
 +          threadPool.execute(mbrReranker.new RankerTask(nbest, oldSentID));
 +
 +          nbest.clear();
 +        }
 +        oldSentID = newSentID;
 +        nbest.add(line);
 +      }
 +
 +      // last nbest
 +      threadPool.execute(mbrReranker.new RankerTask(nbest, oldSentID));
 +      nbest.clear();
 +
 +      threadPool.shutdown();
 +
 +      try {
 +        threadPool.awaitTermination(Integer.MAX_VALUE, TimeUnit.SECONDS);
 +
 +        while (!mbrReranker.resultsQueue.isEmpty()) {
 +          RankerResult result = mbrReranker.resultsQueue.remove();
 +          String best_hyp = result.toString();
 +          System.out.println(best_hyp);
 +        }
 +      } catch (InterruptedException e) {
 +        LOG.error(e.getMessage(), e);
 +      }
 +    }
 +    
 +    scanner.close();
 +
 +    LOG.info("Total running time (seconds) is {} ",
 +        (System.currentTimeMillis() - startTime) / 1000.0);
 +  }
 +
 +  private class RankerTask implements Runnable {
 +
 +    final List<String> nbest;
 +    final int sentID;
 +
 +    RankerTask(final List<String> nbest, final int sentID) {
-       this.nbest = new ArrayList<String>(nbest);
++      this.nbest = new ArrayList<>(nbest);
 +      this.sentID = sentID;
 +    }
 +
 +    public void run() {
 +      String result = processOneSent(nbest, sentID);
 +      resultsQueue.add(new RankerResult(result, sentID));
 +    }
 +
 +  }
 +
 +  private static class RankerResult implements Comparable<RankerResult> {
 +    final String result;
 +    final Integer sentenceNumber;
 +
 +    RankerResult(String result, int sentenceNumber) {
 +      this.result = result;
 +      this.sentenceNumber = sentenceNumber;
 +    }
 +
 +    public int compareTo(RankerResult o) {
 +      return sentenceNumber.compareTo(o.sentenceNumber);
 +    }
 +
 +    public String toString() {
 +      return result;
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslation.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslation.java
index 0e167d1,0000000..9f32d31
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslation.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslation.java
@@@ -1,154 -1,0 +1,154 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.util.List;
 +import java.util.Map;
 +
++import org.apache.joshua.decoder.io.DeNormalize;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.util.FormatUtils;
 +
 +/**
 + * A StructuredTranslation instance provides a more structured access to
 + * translation results than the string-based Translation class.
 + * This is useful if the decoder is encapsulated in a larger project, instead
 + * of simply writing to a file or stdout.
 + * StructuredTranslation encodes all relevant information about a derivation,
 + * namely output string, tokens, score, features, and word alignment.
 + * 
 + * @author fhieber
 + */
 +public class StructuredTranslation {
 +  
 +  private final Sentence sourceSentence;
 +  private final String translationString;
 +  private final List<String> translationTokens;
 +  private final float translationScore;
 +  private final List<List<Integer>> translationWordAlignments;
 +  private final Map<String,Float> translationFeatures;
 +  private final float extractionTime;
 +  
 +  public StructuredTranslation(
 +      final Sentence sourceSentence,
 +      final String translationString,
 +      final List<String> translationTokens,
 +      final float translationScore,
 +      final List<List<Integer>> translationWordAlignments,
 +      final Map<String,Float> translationFeatures,
 +      final float extractionTime) {
 +    this.sourceSentence = sourceSentence;
 +    this.translationString = translationString;
 +    this.translationTokens = translationTokens;
 +    this.translationScore = translationScore;
 +    this.translationWordAlignments = translationWordAlignments;
 +    this.translationFeatures = translationFeatures;
 +    this.extractionTime = extractionTime;
 +  }
 +  
 +  public Sentence getSourceSentence() {
 +    return sourceSentence;
 +  }
 +
 +  public int getSentenceId() {
 +    return sourceSentence.id();
 +  }
 +
 +  /**
 +   * Produces the raw translation hypothesis (still tokenized).
 +   * 
 +   * @return the raw translation hypothesis
 +   */
 +  public String getTranslationString() {
 +    return translationString;
 +  }
 +  
 +  /**
 +   * Returns the output string formatted according to JoshuaConfiguration.output_format.
 +   * 
 +   * @return the formatted string
 +   */
 +  public String getFormattedTranslationString() {
-     throw new RuntimeException("Not yet implemented");
++    return DeNormalize.processSingleLine(maybeProjectCase(getTranslationString()));
 +  }
 +
 +  public List<String> getTranslationTokens() {
 +    return translationTokens;
 +  }
 +
 +  public float getTranslationScore() {
 +    return translationScore;
 +  }
 +
 +  /**
 +   * Returns a list of target to source alignments.
 +   * 
 +   * @return a list of target to source alignments
 +   */
 +  public List<List<Integer>> getTranslationWordAlignments() {
 +    return translationWordAlignments;
 +  }
 +  
 +  public Map<String,Float> getTranslationFeatures() {
 +    return translationFeatures;
 +  }
 +  
 +  /**
 +   * Time taken to build output information from the hypergraph.
 +   * @return the time taken to build output information from the hypergraph
 +   */
 +  public Float getExtractionTime() {
 +    return extractionTime;
 +  }
 +  
 +  /**
 +   * If requested, projects source-side lettercase to target, and appends the alignment from
 +   * to the source-side sentence in ||s.
 +   * 
-    * @param hypothesis todo
-    * @param state todo
-    * @return source-side lettercase to target, and appends the alignment from to the source-side sentence in ||s
++   * @param hypothesis the string hypothesis
++   * @return source-side lettercase to target, and appends the alignment from to the source-side sentence
 +   */
 +  private String maybeProjectCase(String hypothesis) {
 +    String output = hypothesis;
 +
 +    JoshuaConfiguration config = sourceSentence.config;
 +    if (config.project_case) {
 +      String[] tokens = hypothesis.split("\\s+");
 +      List<List<Integer>> points = getTranslationWordAlignments();
 +      for (int i = 0; i < points.size(); i++) {
 +        List<Integer> target = points.get(i);
 +        for (int source: target) {
 +          Token token = sourceSentence.getTokens().get(source + 1); // skip <s>
 +          String annotation = "";
 +          if (token != null && token.getAnnotation("lettercase") != null)
 +            annotation = token.getAnnotation("lettercase");
 +          if (source != 0 && annotation.equals("upper"))
 +            tokens[i] = FormatUtils.capitalize(tokens[i]);
 +          else if (annotation.equals("all-upper"))
 +            tokens[i] = tokens[i].toUpperCase();
 +        }
 +      }
 +
 +      output = String.join(" ",  tokens);
 +    }
 +
 +    return output;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslationFactory.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslationFactory.java
index ce4f32c,0000000..6453bd1
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslationFactory.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/StructuredTranslationFactory.java
@@@ -1,116 -1,0 +1,116 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import static java.util.Arrays.asList;
 +import static java.util.Collections.emptyList;
 +import static java.util.Collections.emptyMap;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiFeatures;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiString;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiWordAlignmentList;
 +import static org.apache.joshua.util.FormatUtils.removeSentenceMarkers;
 +
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.hypergraph.HyperGraph;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationState;
 +import org.apache.joshua.decoder.segment_file.Sentence;
++import org.apache.joshua.decoder.segment_file.Token;
++import org.apache.joshua.util.FormatUtils;
 +
 +/**
 + * This factory provides methods to create StructuredTranslation objects
 + * from either Viterbi derivations or KBest derivations.
 + * 
 + * @author fhieber
 + */
 +public class StructuredTranslationFactory {
 +  
 +  /**
 +   * Returns a StructuredTranslation instance from the Viterbi derivation.
 +   * 
 +   * @param sourceSentence the source sentence
 +   * @param hypergraph the hypergraph object
 +   * @param featureFunctions the list of active feature functions
 +   * @return A StructuredTranslation object representing the Viterbi derivation.
 +   */
 +  public static StructuredTranslation fromViterbiDerivation(
 +      final Sentence sourceSentence,
 +      final HyperGraph hypergraph,
 +      final List<FeatureFunction> featureFunctions) {
 +    final long startTime = System.currentTimeMillis();
 +    final String translationString = removeSentenceMarkers(getViterbiString(hypergraph));
 +    return new StructuredTranslation(
 +        sourceSentence,
 +        translationString,
 +        extractTranslationTokens(translationString),
 +        extractTranslationScore(hypergraph),
 +        getViterbiWordAlignmentList(hypergraph),
 +        getViterbiFeatures(hypergraph, featureFunctions, sourceSentence).toStringMap(),
 +        (System.currentTimeMillis() - startTime) / 1000.0f);
 +  }
 +  
 +  /**
 +   * Returns a StructuredTranslation from an empty decoder output
 +   * @param sourceSentence the source sentence
 +   * @return a StructuredTranslation object
 +   */
 +  public static StructuredTranslation fromEmptyOutput(final Sentence sourceSentence) {
 +        return new StructuredTranslation(
 +                sourceSentence, "", emptyList(), 0, emptyList(), emptyMap(), 0f);
 +      }
 +  
 +  /**
 +   * Returns a StructuredTranslation instance from a KBest DerivationState. 
 +   * @param sourceSentence Sentence object representing the source.
 +   * @param derivationState the KBest DerivationState.
 +   * @return A StructuredTranslation object representing the derivation encoded by derivationState.
 +   */
 +  public static StructuredTranslation fromKBestDerivation(
 +      final Sentence sourceSentence,
 +      final DerivationState derivationState) {
 +    final long startTime = System.currentTimeMillis();
 +    final String translationString = removeSentenceMarkers(derivationState.getHypothesis());
 +    return new StructuredTranslation(
 +        sourceSentence,
 +        translationString,
 +        extractTranslationTokens(translationString),
 +        derivationState.getModelCost(),
 +        derivationState.getWordAlignmentList(),
 +        derivationState.getFeatures().toStringMap(),
 +        (System.currentTimeMillis() - startTime) / 1000.0f);
 +  }
 +  
 +  private static float extractTranslationScore(final HyperGraph hypergraph) {
 +    if (hypergraph == null) {
 +      return 0;
 +    } else {
 +      return hypergraph.goalNode.getScore();
 +    }
 +  }
 +  
 +  private static List<String> extractTranslationTokens(final String translationString) {
 +    if (translationString.isEmpty()) {
 +      return emptyList();
 +    } else {
 +      return asList(translationString.split("\\s+"));
 +    }
 +  }
-   
- 
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/Translation.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/Translation.java
index cdda63e,0000000..260b0ac
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/Translation.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/Translation.java
@@@ -1,237 -1,0 +1,239 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import static java.util.Arrays.asList;
 +import static org.apache.joshua.decoder.StructuredTranslationFactory.fromViterbiDerivation;
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiFeatures;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiString;
 +import static org.apache.joshua.decoder.hypergraph.ViterbiExtractor.getViterbiWordAlignments;
 +import static org.apache.joshua.util.FormatUtils.removeSentenceMarkers;
 +
 +import java.io.BufferedWriter;
 +import java.io.IOException;
 +import java.io.StringWriter;
++import java.util.Collections;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel;
 +import org.apache.joshua.decoder.hypergraph.HyperGraph;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor;
 +import org.apache.joshua.decoder.io.DeNormalize;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class represents translated input objects (sentences or lattices). It is aware of the source
 + * sentence and id and contains the decoded hypergraph. Translation objects are returned by
 + * DecoderThread instances to the InputHandler, where they are assembled in order for output.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * @author Felix Hieber fhieber@amazon.com
 + */
 +
 +public class Translation {
 +  private static final Logger LOG = LoggerFactory.getLogger(Translation.class);
-   private Sentence source;
++  private final Sentence source;
 +
 +  /**
 +   * This stores the output of the translation so we don't have to hold onto the hypergraph while we
 +   * wait for the outputs to be assembled.
 +   */
 +  private String output = null;
 +
 +  /**
 +   * Stores the list of StructuredTranslations.
 +   * If joshuaConfig.topN == 0, will only contain the Viterbi translation.
 +   * Else it will use KBestExtractor to populate this list.
 +   */
 +  private List<StructuredTranslation> structuredTranslations = null;
 +  
 +  public Translation(Sentence source, HyperGraph hypergraph, 
 +      List<FeatureFunction> featureFunctions, JoshuaConfiguration joshuaConfiguration) {
 +    this.source = source;
 +    
 +    /**
 +     * Structured output from Joshua provides a way to programmatically access translation results
 +     * from downstream applications, instead of writing results as strings to an output buffer.
 +     */
 +    if (joshuaConfiguration.use_structured_output) {
 +      
 +      if (joshuaConfiguration.topN == 0) {
 +        /*
 +         * Obtain Viterbi StructuredTranslation
 +         */
 +        StructuredTranslation translation = fromViterbiDerivation(source, hypergraph, featureFunctions);
 +        this.output = translation.getTranslationString();
-         structuredTranslations = asList(translation);
++        structuredTranslations = Collections.singletonList(translation);
 +        
 +      } else {
 +        /*
 +         * Get K-Best list of StructuredTranslations
 +         */
 +        final KBestExtractor kBestExtractor = new KBestExtractor(source, featureFunctions, Decoder.weights, false, joshuaConfiguration);
 +        structuredTranslations = kBestExtractor.KbestExtractOnHG(hypergraph, joshuaConfiguration.topN);
 +        if (structuredTranslations.isEmpty()) {
-             structuredTranslations = asList(StructuredTranslationFactory.fromEmptyOutput(source));
++            structuredTranslations = Collections
++                .singletonList(StructuredTranslationFactory.fromEmptyOutput(source));
 +            this.output = "";
 +        } else {
 +            this.output = structuredTranslations.get(0).getTranslationString();
 +        }
 +        // TODO: We omit the BLEU rescoring for now since it is not clear whether it works at all and what the desired output is below.
 +      }
 +
 +    } else {
 +
 +      StringWriter sw = new StringWriter();
 +      BufferedWriter out = new BufferedWriter(sw);
 +
 +      try {
 +        
 +        if (hypergraph != null) {
 +          
 +          long startTime = System.currentTimeMillis();
 +
 +          if (joshuaConfiguration.topN == 0) {
 +
 +            /* construct Viterbi output */
 +            final String best = getViterbiString(hypergraph);
 +
 +            LOG.info("Translation {}: {} {}", source.id(), hypergraph.goalNode.getScore(), best);
 +
 +            /*
 +             * Setting topN to 0 turns off k-best extraction, in which case we need to parse through
 +             * the output-string, with the understanding that we can only substitute variables for the
 +             * output string, sentence number, and model score.
 +             */
 +            String translation = joshuaConfiguration.outputFormat
 +                .replace("%s", removeSentenceMarkers(best))
 +                .replace("%S", DeNormalize.processSingleLine(best))
 +                .replace("%c", String.format("%.3f", hypergraph.goalNode.getScore()))
 +                .replace("%i", String.format("%d", source.id()));
 +
 +            if (joshuaConfiguration.outputFormat.contains("%a")) {
 +              translation = translation.replace("%a", getViterbiWordAlignments(hypergraph));
 +            }
 +
 +            if (joshuaConfiguration.outputFormat.contains("%f")) {
 +              final FeatureVector features = getViterbiFeatures(hypergraph, featureFunctions, source);
 +              translation = translation.replace("%f", features.textFormat());
 +            }
 +
 +            out.write(translation);
 +            out.newLine();
 +
 +          } else {
 +
 +            final KBestExtractor kBestExtractor = new KBestExtractor(
 +                source, featureFunctions, Decoder.weights, false, joshuaConfiguration);
 +            kBestExtractor.lazyKBestExtractOnHG(hypergraph, joshuaConfiguration.topN, out);
 +
 +            if (joshuaConfiguration.rescoreForest) {
 +              final int bleuFeatureHash = hashFeature("BLEU");
 +              Decoder.weights.add(bleuFeatureHash, joshuaConfiguration.rescoreForestWeight);
 +              kBestExtractor.lazyKBestExtractOnHG(hypergraph, joshuaConfiguration.topN, out);
 +
 +              Decoder.weights.add(bleuFeatureHash, -joshuaConfiguration.rescoreForestWeight);
 +              kBestExtractor.lazyKBestExtractOnHG(hypergraph, joshuaConfiguration.topN, out);
 +            }
 +          }
 +
 +          float seconds = (float) (System.currentTimeMillis() - startTime) / 1000.0f;
 +          LOG.info("Input {}: {}-best extraction took {} seconds", id(),
 +              joshuaConfiguration.topN, seconds);
 +
 +        } else {
 +          
 +          // Failed translations and blank lines get empty formatted outputs
 +          out.write(getFailedTranslationOutput(source, joshuaConfiguration));
 +          out.newLine();
 +          
 +        }
 +
 +        out.flush();
 +        
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +
 +      this.output = sw.toString();
 +
 +    }
 +    
 +    // remove state from StateMinimizingLanguageModel instances in features.
 +    destroyKenLMStates(featureFunctions);
 +
 +  }
 +
 +  public Sentence getSourceSentence() {
 +    return this.source;
 +  }
 +
 +  public int id() {
 +    return source.id();
 +  }
 +
 +  @Override
 +  public String toString() {
 +    return output;
 +  }
 +  
 +  private String getFailedTranslationOutput(final Sentence source, final JoshuaConfiguration joshuaConfiguration) {
 +    return joshuaConfiguration.outputFormat
 +        .replace("%s", source.source())
 +        .replace("%e", "")
 +        .replace("%S", "")
 +        .replace("%t", "()")
 +        .replace("%i", Integer.toString(source.id()))
 +        .replace("%f", "")
 +        .replace("%c", "0.000");
 +  }
 +  
 +  /**
 +   * Returns the StructuredTranslations
 +   * if JoshuaConfiguration.use_structured_output == True.
 +   * @throws RuntimeException if JoshuaConfiguration.use_structured_output == False.
 +   * @return List of StructuredTranslations.
 +   */
 +  public List<StructuredTranslation> getStructuredTranslations() {
 +    if (structuredTranslations == null) {
 +      throw new RuntimeException(
 +          "No StructuredTranslation objects created. You should set JoshuaConfigration.use_structured_output = true");
 +    }
 +    return structuredTranslations;
 +  }
 +  
 +  /**
 +   * KenLM hack. If using KenLMFF, we need to tell KenLM to delete the pool used to create chart
 +   * objects for this sentence.
 +   */
 +  private void destroyKenLMStates(final List<FeatureFunction> featureFunctions) {
 +    for (FeatureFunction feature : featureFunctions) {
 +      if (feature instanceof StateMinimizingLanguageModel) {
 +        ((StateMinimizingLanguageModel) feature).destroyPool(getSourceSentence().id());
 +        break;
 +      }
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/Translations.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/Translations.java
index e607225,0000000..1eb859a
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/Translations.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/Translations.java
@@@ -1,158 -1,0 +1,158 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder;
 +
 +import java.util.Iterator;
 +import java.util.LinkedList;
 +import org.apache.joshua.decoder.io.TranslationRequestStream;
 +
 +/**
 + * This class represents a streaming sequence of translations. It is returned by the main entry
 + * point to the Decoder object, the call to decodeAll. The translations here are parallel to the
 + * input sentences in the corresponding TranslationRequest object. Because of parallelization, the
 + * translated sentences might be computed out of order. Each Translation is sent to this
 + * Translations object by a DecoderThreadRunner via the record() function, which places the
 + * Translation in the right place. When the next translation in a sequence is available, next() is
 + * notified.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class Translations implements Iterator<Translation>, Iterable<Translation> {
 +
 +  /* The source sentences to be translated. */
 +  private TranslationRequestStream request = null;
 +
 +  /*
 +   * This records the index of the sentence at the head of the underlying list. The iterator's
 +   * next() blocks when the value at this position in the translations LinkedList is null.
 +   */
 +  private int currentID = 0;
 +
 +  /* The set of translated sentences. */
 +  private LinkedList<Translation> translations = null;
 +
 +  private boolean spent = false;
 +
 +  private Translation nextTranslation;
 +
 +  public Translations(TranslationRequestStream request) {
 +    this.request = request;
-     this.translations = new LinkedList<Translation>();
++    this.translations = new LinkedList<>();
 +  }
 +
 +  /**
 +   * This is called when null is received from the TranslationRequest, indicating that there are no
 +   * more input sentences to translated. That in turn means that the request size will no longer
 +   * grow. We then notify any waiting thread if the last ID we've processed is the last one, period.
 +   */
 +  public void finish() {
 +    synchronized (this) {
 +      spent = true;
 +      if (currentID == request.size()) {
 +        this.notifyAll();
 +      }
 +    }
 +  }
 +
 +  /**
 +   * This is called whenever a translation is completed by one of the decoder threads. There may be
 +   * a current output thread waiting for the current translation, which is determined by checking if
 +   * the ID of the translation is the same as the one being waited for (currentID). If so, the
 +   * thread waiting for it is notified.
 +   * 
 +   * @param translation a translated input object
 +   */
 +  public void record(Translation translation) {
 +    synchronized (this) {
 +
 +      /* Pad the set of translations with nulls to accommodate the new translation. */
 +      int offset = translation.id() - currentID;
 +      while (offset >= translations.size())
 +        translations.add(null);
 +      translations.set(offset, translation);
 +
 +      /*
 +       * If the id of the current translation is at the head of the list (first element), then we
 +       * have the next Translation to be return, and we should notify anyone waiting on next(),
 +       * which will then remove the item and increment the currentID.
 +       */
 +      if (translation.id() == currentID) {
 +        this.notify();
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Returns the next Translation, blocking if necessary until it's available, since the next
 +   * Translation might not have been produced yet.
 +   * 
 +   * @return first element from the list of {@link org.apache.joshua.decoder.Translation}'s
 +   */
 +  @Override
 +  public Translation next() {
 +    synchronized(this) {
 +      if (this.hasNext()) {
 +        Translation t = this.nextTranslation;
 +        this.nextTranslation = null;
 +        return t;
 +      }
 +      
 +      return null;
 +    }
 +  }
 +   
 +  @Override
 +  public boolean hasNext() {
 +    synchronized (this) {
 +
 +      if (nextTranslation != null)
 +        return true;
 +      
 +      /*
 +       * If there are no more input sentences, and we've already distributed what we then know is
 +       * the last one, we're done.
 +       */
 +      if (spent && currentID == request.size())
 +        return false;
 +
 +      /*
 +       * Otherwise, there is another sentence. If it's not available already, we need to wait for
 +       * it.
 +       */
 +      if (translations.size() == 0 || translations.peek() == null) {
 +        try {
 +          this.wait();
 +        } catch (InterruptedException e) {
 +          // TODO Auto-generated catch block
 +          e.printStackTrace();
 +        }
 +      }
 +
 +      /* We now have the sentence and can return it. */
 +      currentID++;
 +      this.nextTranslation = translations.poll();
 +      return this.nextTranslation != null;
 +    }
 +  }
 +
 +  @Override
 +  public Iterator<Translation> iterator() {
 +    return this;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Cell.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Cell.java
index 10b9200,0000000..cfcd06b
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Cell.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/chart_parser/Cell.java
@@@ -1,294 -1,0 +1,294 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.chart_parser;
 +
 +import static com.google.common.base.Preconditions.checkNotNull;
 +
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.LinkedHashMap;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Set;
 +import java.util.Map.Entry;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * this class implement functions: (1) combine small itesm into larger ones using rules, and create
 + * items and hyper-edges to construct a hyper-graph, (2) evaluate model score for items, (3)
 + * cube-pruning Note: Bin creates Items, but not all Items will be used in the hyper-graph
 + * 
 + * @author Matt Post <po...@cs.jhu.edu>
 + * @author Zhifei Li, <zh...@gmail.com>
 + */
 +class Cell {
 +
 +  // ===============================================================
 +  // Static fields
 +  // ===============================================================
 +  private static final Logger LOG = LoggerFactory.getLogger(Cell.class);
 +
 +
 +  // The chart this cell belongs to
 +  private Chart chart = null;
 +
 +  // The top-level (goal) symbol
-   private int goalSymbol;
++  private final int goalSymbol;
 +
 +  // to maintain uniqueness of nodes
-   private HashMap<HGNode.Signature, HGNode> nodesSigTbl = new LinkedHashMap<HGNode.Signature, HGNode>();
++  private final HashMap<HGNode.Signature, HGNode> nodesSigTbl = new LinkedHashMap<>();
 +
 +  // signature by lhs
-   private Map<Integer, SuperNode> superNodesTbl = new HashMap<Integer, SuperNode>();
++  private final Map<Integer, SuperNode> superNodesTbl = new HashMap<>();
 +
 +  /**
 +   * sort values in nodesSigTbl, we need this list when necessary
 +   */
 +  private List<HGNode> sortedNodes = null;
 +
 +
 +  // ===============================================================
 +  // Constructor
 +  // ===============================================================
 +
 +  public Cell(Chart chart, int goalSymID) {
 +    this.chart = chart;
 +    this.goalSymbol = goalSymID;
 +  }
 +
 +  public Cell(Chart chart, int goal_sym_id, int constraint_symbol_id) {
 +    this(chart, goal_sym_id);
 +  }
 +
 +  // ===============================================================
 +  // Package-protected methods
 +  // ===============================================================
 +  
 +  public Set<Integer> getKeySet() {
 +    return superNodesTbl.keySet();
 +  }
 +  
 +  public SuperNode getSuperNode(int lhs) {
 +    return superNodesTbl.get(lhs);
 +  }
 +
 +  /**
 +   * This function loops over all items in the top-level bin (covering the input sentence from
 +   * <s> ... </s>), looking for items with the goal LHS. For each of these, 
 +   * add all the items with GOAL_SYM state into the goal bin the goal bin has only one Item, which
 +   * itself has many hyperedges only "goal bin" should call this function
 +   */
 +  // note that the input bin is bin[0][n], not the goal bin
 +  boolean transitToGoal(Cell bin, List<FeatureFunction> featureFunctions, int sentenceLength) {
-     this.sortedNodes = new ArrayList<HGNode>();
++    this.sortedNodes = new ArrayList<>();
 +    HGNode goalItem = null;
 +
 +    for (HGNode antNode : bin.getSortedNodes()) {
 +      if (antNode.lhs == this.goalSymbol) {
 +        float logP = antNode.bestHyperedge.getBestDerivationScore();
-         List<HGNode> antNodes = new ArrayList<HGNode>();
++        List<HGNode> antNodes = new ArrayList<>();
 +        antNodes.add(antNode);
 +
 +        float finalTransitionLogP = ComputeNodeResult.computeFinalCost(featureFunctions, antNodes,
 +            0, sentenceLength, null, this.chart.getSentence());
 +
-         List<HGNode> previousItems = new ArrayList<HGNode>();
++        List<HGNode> previousItems = new ArrayList<>();
 +        previousItems.add(antNode);
 +
 +        HyperEdge dt = new HyperEdge(null, logP + finalTransitionLogP, finalTransitionLogP,
 +            previousItems, null);
 +
 +        if (null == goalItem) {
 +          goalItem = new HGNode(0, sentenceLength + 1, this.goalSymbol, null, dt, logP
 +              + finalTransitionLogP);
 +          this.sortedNodes.add(goalItem);
 +        } else {
 +          goalItem.addHyperedgeInNode(dt);
 +        }
 +      } // End if item.lhs == this.goalSymID
 +    } // End foreach Item in bin.get_sorted_items()
 +
 +    int itemsInGoalBin = getSortedNodes().size();
 +    if (1 != itemsInGoalBin) {
 +      LOG.error("the goal_bin does not have exactly one item");
 +      return false;
 +    }
 +
 +    return true;
 +  }
 +
 +  /**
 +   * a note about pruning: when a hyperedge gets created, it first needs to pass through
 +   * shouldPruneEdge filter. Then, if it does not trigger a new node (i.e. will be merged to an old
 +   * node), then does not trigger pruningNodes. If it does trigger a new node (either because its
 +   * signature is new or because its logP is better than the old node's logP), then it will trigger
 +   * pruningNodes, which might causes *other* nodes got pruned as well
 +   * */
 +
 +  /**
 +   * Creates a new hyperedge and adds it to the chart, subject to pruning. The logic of this
 +   * function is as follows: if the pruner permits the edge to be added, we build the new edge,
 +   * which ends in an HGNode. If this is the first time we've built an HGNode for this point in the
 +   * graph, it gets added automatically. Otherwise, we add the hyperedge to the existing HGNode,
 +   * possibly updating the HGNode's cache of the best incoming hyperedge.
 +   * 
 +   * @return the new hypernode, or null if the cell was pruned.
 +   */
 +  HGNode addHyperEdgeInCell(ComputeNodeResult result, Rule rule, int i, int j, List<HGNode> ants,
 +      SourcePath srcPath, boolean noPrune) {
 +
 +//    System.err.println(String.format("ADD_EDGE(%d-%d): %s", i, j, rule.getRuleString()));
 +//    if (ants != null) {
 +//      for (int xi = 0; xi < ants.size(); xi++) {
 +//        System.err.println(String.format("  -> TAIL %s", ants.get(xi)));
 +//      }
 +//    }
 +
 +    List<DPState> dpStates = result.getDPStates();
 +    float pruningEstimate = result.getPruningEstimate();
 +    float transitionLogP = result.getTransitionCost();
 +    float finalizedTotalLogP = result.getViterbiCost();
 +
 +    /**
 +     * Here, the edge has passed pre-pruning. The edge will be added to the chart in one of three
 +     * ways:
 +     * 
 +     * 1. If there is no existing node, a new one gets created and the edge is its only incoming
 +     * hyperedge.
 +     * 
 +     * 2. If there is an existing node, the edge will be added to its list of incoming hyperedges,
 +     * possibly taking place as the best incoming hyperedge for that node.
 +     */
 +
 +    HyperEdge hyperEdge = new HyperEdge(rule, finalizedTotalLogP, transitionLogP, ants, srcPath);
 +    HGNode newNode = new HGNode(i, j, rule.getLHS(), dpStates, hyperEdge, pruningEstimate);
 +
 +    /**
 +     * each node has a list of hyperedges, need to check whether the node is already exist, if
 +     * yes, just add the hyperedges, this may change the best logP of the node
 +     * */
 +    HGNode oldNode = this.nodesSigTbl.get(newNode.signature());
 +    if (null != oldNode) { // have an item with same states, combine items
 +      this.chart.nMerged++;
 +
 +      /**
 +       * the position of oldItem in this.heapItems may change, basically, we should remove the
 +       * oldItem, and re-insert it (linear time), this is too expense)
 +       **/
 +      if (newNode.getScore() > oldNode.getScore()) { // merge old to new: semiring plus
 +
 +        newNode.addHyperedgesInNode(oldNode.hyperedges);
 +        // This will update the HashMap, so that the oldNode is destroyed.
 +        addNewNode(newNode);
 +      } else {// merge new to old, does not trigger pruningItems
 +        oldNode.addHyperedgesInNode(newNode.hyperedges);
 +      }
 +
 +    } else { // first time item
 +      this.chart.nAdded++; // however, this item may not be used in the future due to pruning in
 +      // the hyper-graph
 +      addNewNode(newNode);
 +    }
 +
 +    return newNode;
 +  }
 +
 +  List<HGNode> getSortedNodes() {
 +    ensureSorted();
 +    return this.sortedNodes;
 +  }
 +  
 +  Map<Integer, SuperNode> getSortedSuperItems() {
 +    ensureSorted();
 +    return this.superNodesTbl;
 +  }
 +  
 +  // ===============================================================
 +  // Private Methods
 +  // ===============================================================
 +
 +  /**
 +   * two cases this function gets called (1) a new hyperedge leads to a non-existing node signature
 +   * (2) a new hyperedge's signature matches an old node's signature, but the best-logp of old node
 +   * is worse than the new hyperedge's logP
 +   * */
 +  private void addNewNode(HGNode node) {
 +    this.nodesSigTbl.put(node.signature(), node); // add/replace the item
 +    this.sortedNodes = null; // reset the list
 +    
 +//    System.err.println(String.format("** NEW NODE %s %d %d", Vocabulary.word(node.lhs), node.i, node.j));
 +
 +    // since this.sortedItems == null, this is not necessary because we will always call
 +    // ensure_sorted to reconstruct the this.tableSuperItems
 +    // add a super-items if necessary
 +    SuperNode si = this.superNodesTbl.get(node.lhs);
 +    if (null == si) {
 +      si = new SuperNode(node.lhs);
 +      this.superNodesTbl.put(node.lhs, si);
 +    }
 +    si.nodes.add(node);// TODO what about the dead items?
 +  }
 +
 +  /**
 +   * get a sorted list of Nodes in the cell, and also make sure the list of node in any SuperItem is
 +   * sorted, this will be called only necessary, which means that the list is not always sorted,
 +   * mainly needed for goal_bin and cube-pruning
 +   */
 +  private void ensureSorted() {
 +    if (null == this.sortedNodes) {
 +      
 +      // get sortedNodes.
 +      this.sortedNodes = new ArrayList<>(this.nodesSigTbl.size());
 +      for (HGNode node : this.nodesSigTbl.values()) {
 +        this.sortedNodes.add(node);
 +      }
 +
 +      // sort the node in an decreasing-LogP order 
 +      this.sortedNodes.sort(HGNode.inverseLogPComparator);
 +
 +      // TODO: we cannot create new SuperItem here because the DotItem link to them.
 +      // Thus, we clear nodes from existing SuperNodes
 +      for (SuperNode superNode : this.superNodesTbl.values()) {
 +        superNode.nodes.clear();
 +      }
 +
 +      for (HGNode node : this.sortedNodes) {
 +        SuperNode superNode = this.superNodesTbl.get(node.lhs);
 +        checkNotNull(superNode, "Does not have super Item, have to exist");
 +        superNode.nodes.add(node);
 +      }
 +
 +      // Remove SuperNodes who may not contain any nodes anymore due to pruning
 +      for (Iterator<Entry<Integer, SuperNode>> it = this.superNodesTbl.entrySet().iterator(); it.hasNext(); ) {
 +        Entry<Integer, SuperNode> entry = it.next();
 +        if (entry.getValue().nodes.isEmpty()) {
 +          it.remove();
 +        }
 +      }
 +    }
 +  }
 +}



[02/50] [abbrv] incubator-joshua git commit: fixed computation of distortion

Posted by mj...@apache.org.
fixed computation of distortion


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/16d5647b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/16d5647b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/16d5647b

Branch: refs/heads/7
Commit: 16d5647bee30345ffa56b5b7d5bebc1021afa3fa
Parents: 574cb36
Author: Matt Post <po...@cs.jhu.edu>
Authored: Fri Aug 19 19:45:12 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Fri Aug 19 19:45:12 2016 -0500

----------------------------------------------------------------------
 .../joshua/decoder/ff/phrase/Distortion.java    | 23 +++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/16d5647b/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java b/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
index 072162b..d4b49db 100644
--- a/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
+++ b/src/main/java/org/apache/joshua/decoder/ff/phrase/Distortion.java
@@ -60,14 +60,27 @@ public class Distortion extends StatelessFF {
 //        int start_point = j - rule.getFrench().length + rule.getArity();
 //        int jump_size = Math.abs(tailNodes.get(0).j - start_point);
 
-      int start_point = tailNodes.get(rule == Hypothesis.MONO_RULE ? 0 : 1).j;
-      int jump_size = Math.abs(j - start_point);
+      if (rule == Hypothesis.MONO_RULE) {
+        int start_point = j - tailNodes.get(1).getHyperEdges().get(0).getRule().getFrench().length;
+        int last_point = tailNodes.get(0).j;
+        int jump_size = Math.abs(start_point - last_point);
+      
+//        System.err.println(String.format("DISTORTION_mono(%d -> %d) = %d", 
+//            last_point, start_point, jump_size));
 
-      acc.add(denseFeatureIndex, -jump_size); 
+        acc.add(denseFeatureIndex, -jump_size);
+      } else {
+        int start_point = j - tailNodes.get(0).getHyperEdges().get(0).getRule().getFrench().length;
+        int last_point = tailNodes.get(1).j;
+        int jump_size = Math.abs(start_point - last_point);
+      
+//        System.err.println(String.format("DISTORTION_swap(%d -> %d) = %d", 
+//            last_point, start_point, jump_size));
+
+        acc.add(denseFeatureIndex, -jump_size);    
+      }
     }
     
-//    System.err.println(String.format("DISTORTION(%d, %d) from %d = %d", i, j, tailNodes != null ? tailNodes.get(0).j : -1, jump_size));
-
     return null;
   }
 }


[17/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/output.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/output.gold b/src/test/resources/kbest_extraction/output.gold
new file mode 100644
index 0000000..e75bb9e
--- /dev/null
+++ b/src/test/resources/kbest_extraction/output.gold
@@ -0,0 +1,3126 @@
+0 ||| A A A A A ||| lm_0=-28.045 tm_pt_0=-172.000 tm_glue_0=5.000 ||| -195.045
+0 ||| B A A A A ||| lm_0=-28.045 tm_pt_0=-173.000 tm_glue_0=5.000 ||| -196.045
+0 ||| C A A A A ||| lm_0=-28.045 tm_pt_0=-175.000 tm_glue_0=5.000 ||| -198.045
+0 ||| A B A A A ||| lm_0=-28.045 tm_pt_0=-176.000 tm_glue_0=5.000 ||| -199.045
+0 ||| B B A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
+0 ||| D A A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
+0 ||| A A A A B ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A A A B A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A A B A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| A C A A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
+0 ||| B A A A B ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B A A B A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B A B A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| B C A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| C B A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
+0 ||| A A A C A ||| lm_0=-28.045 tm_pt_0=-180.000 tm_glue_0=5.000 ||| -203.045
+0 ||| C A A A B ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C A A B A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| B A A C A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C A B A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| E A A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| C C A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| D B A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
+0 ||| A A A A C ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B A B A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B A A B ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A A C A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A B B A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| A D A A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
+0 ||| B A A A C ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B A C A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B B B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| C A A C A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D A B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| B D A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| D C A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
+0 ||| A A B A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A B B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A A B B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A B A C A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C A A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C A B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A C B A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| A A D A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
+0 ||| C A A A C ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A A B B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A B A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A B B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| D A A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C A C A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B B A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| E B A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B C B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C B B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| C D A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| B A D A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
+0 ||| A B A A C ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A A C B ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A B C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A B C A A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A C A C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| A A A D A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
+0 ||| C A A B B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D A A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A B A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A A C B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B B A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D A C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A A D A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D D A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B C A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A D A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C A B B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E A B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C B A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| E C A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B B C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| B A B C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| C C B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| D B B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
+0 ||| A B A B B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B B B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A A B C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D A B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A C A A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A C B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A C A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A C C A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A B A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B D A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A A A D ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A A E A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A B B A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A E A A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D A A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| A D B A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
+0 ||| B D A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C B A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A C A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| E A A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A A D A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A A B C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B C A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D B A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A A A D ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A C B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B D A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A A C B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A E A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B A B A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C C A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B C C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C A B C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B E A A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D A D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| C B C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B B D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| D C B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| B D B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
+0 ||| A C B A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A D A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A B B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A A C C ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B A C B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C A B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B B C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A A E A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C B B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A D B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A B A D A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A D A C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A A C C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| A C D A A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
+0 ||| B C A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A B B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A A B C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A C A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A B A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A D A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E A A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D B A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A A A D ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C C A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A A C C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A D B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A C C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D C A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D A A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B B A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A C B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B A A E A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C C C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B D A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E B B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C A E A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C D B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| B C D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E D A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| D B C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C E A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| E A C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| C B D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
+0 ||| A B C A B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B B A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A D A A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A C A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B A B C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A B C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C A C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B A A D ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A A D B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B C B A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C A D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A D C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A C B C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A A B D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A B E A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| A D C A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
+0 ||| B B C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A B C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A C A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B D A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C C D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A B D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A A D B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A D B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D C C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A D A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B D C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A B B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C D A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A A C C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D D B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B A D C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A A E A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D B D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D C A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D E A A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C A C C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E A D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E C B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B C B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| B B E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| C B A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| D A E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| E B A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
+0 ||| A D B A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A C B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C A B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B B B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B A C C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B D A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A E A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C C A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E A A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D A B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A B B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B D B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A D A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C B A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B C C A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A A B D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C C B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A B A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D D A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C A A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A D B B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E A B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A C E A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A A E B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A E B A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| A B A E A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
+0 ||| B B B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E A A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A E A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A C B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A B C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A A D B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A B B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E C A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A E B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E B A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A B D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A D A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A D C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C D C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C A C A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D D A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C D A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A B A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E B C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B A A B D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E A B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D B A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| E A A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C B C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B C C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B E B A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| C C A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B D B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D A A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| D C B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| B B A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
+0 ||| A B B C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A C D ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B A D B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A D C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C D A B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C A C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A E B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C B B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A D B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A C C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D A C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A B E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A A A E ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B C A C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D B C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A B C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A E A C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B D C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C C C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C D B A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A C D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A D A D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A B B D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A A E C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| A C A E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
+0 ||| E A A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A C C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A D B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A B C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A C D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A B A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A A B D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E C A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A D C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A D A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A C B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A C D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A E B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A E C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A E A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A B E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D D A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A B B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B A A A E ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D A B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B E A C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C A E B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E E A A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B B B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C D D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D C A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D D C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C C E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E B B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E C C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C E A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B C A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| D B C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E D A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| E A C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| C B D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| B D A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
+0 ||| A E A A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B B A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A B D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B B B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A E A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D B A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A C B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C B C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B D A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D A B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C C A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B E A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A D C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C A D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B C B B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A C A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D C A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B A B D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D C B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D A A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A B E B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C D C A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A E C A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A C B D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A D E A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| A A D D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
+0 ||| D C B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A B D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A D B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A E B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A D C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E A A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A C C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A B C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A E A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B E A A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A C B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A D C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A C A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A A E ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A A C D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B A D D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E A B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B B E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D A E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A B E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A E C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E B B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C D B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E C D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E A C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B E C A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D E B A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D D B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B D E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| E D A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D C E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C E A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| B C B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| D B C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C B B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C A C D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| C C C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
+0 ||| A C A B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D B B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D D A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B C C B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E B B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C C B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A B B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D C C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B D B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A E B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C E B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C E A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E B A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D D B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A E B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B E C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A D A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E D A A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A A E ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A C E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C B B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B B E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C D A C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D A E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A D C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B C D A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A A E C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B A C D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A E A B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A C B A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A D B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A B B C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A D A C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| A A C C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
+0 ||| B B B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A E B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A D C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A B D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A B B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E A B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E C A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E B A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D E A C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E A B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A C A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A D A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A C C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E D C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C E C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A D B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D C A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E B A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E D A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B D A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B E B B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A C E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D D B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A C B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A D D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C E A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D A A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B A A E C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C C C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| E D A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C A E A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| D B C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B B A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| B C D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C D B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| C B D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
+0 ||| A C D B B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C C C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A C D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D A D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E A C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B D C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B B D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A E D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A E C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C E C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A A D D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D D C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A D E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C C D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B C A D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D B D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D B C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E A D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C B E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A D C A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B D D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A A B E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A E B C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A B D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C A D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A C B C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A A D C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B E A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| A B C B C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
+0 ||| C C E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A D C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A A E C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A C C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E A A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D E A A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A E B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A D B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A A B E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A C D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A D E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A C E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A E C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A D A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E A B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C D D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E A C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E B C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D E C A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E B B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B E A D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A B A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B B D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E C C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C E D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A A D D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E E B A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B A E D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D B C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E D D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D C B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B C B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C A B B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| E A B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| B D C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D A C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| D D A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C C B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| C B A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
+0 ||| A C E A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B D B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E B A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A E B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D D A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B C C C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E C A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A D D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D E A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D B B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C D C B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B E B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D E B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D C B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B C E A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B A E C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E C B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A A C E ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E E A A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A C B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C D D A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D B A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E A A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C C B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A A E A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B B B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A D A B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A B D A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C C A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A E A B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| A C B D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
+0 ||| E C B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A E C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E C A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E B A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A C D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A D D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E B A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A E A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A C B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E A A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E A B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A E B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E A B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A A D D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E C B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E B B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B A A C E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A A B E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D E D A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B E E A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A B D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D A C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B B C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A D C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B D E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E B D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A E D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E E A C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C A D E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C B D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E C C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C C C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E A C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C D B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D D A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| B C D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D B C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| D C E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| E D A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| C E A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
+0 ||| A B E C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C B B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C D B C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D C C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C C C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D D B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C E B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E A C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B D C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A B E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C D A D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A E C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E B B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E D A B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B D E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C A E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B A B E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D E C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A C A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D B C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A C C E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A D B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A E E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B B A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D A A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D B E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B A D D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A A A E D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B E D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A B C D B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E C C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E A E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A D C D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| A E D B A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
+0 ||| B A C A E ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E E A A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E B C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C C D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B C D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C C E A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B C D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B C C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E A D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E C A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C E C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E C B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D E A C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E A B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D B D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D D A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D A E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B D A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| E D C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B C E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D B B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D E A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C A E B C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D C A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D B A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B B B D C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D D B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B E D A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B A C E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D A B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B D A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| B E B B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B A E C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C D D A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| C B C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
+0 ||| D B E A C 

<TRUNCATED>


[41/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/adagrad/Optimizer.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/adagrad/Optimizer.java
index 722c593,0000000..16c25cd
mode 100755,000000..100755
--- a/joshua-core/src/main/java/org/apache/joshua/adagrad/Optimizer.java
+++ b/joshua-core/src/main/java/org/apache/joshua/adagrad/Optimizer.java
@@@ -1,728 -1,0 +1,716 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.adagrad;
 +
 +import java.util.Collections;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.Set;
 +import java.util.Vector;
 +import java.lang.Math;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.metrics.EvaluationMetric;
 +
 +// this class implements the AdaGrad algorithm
 +public class Optimizer {
 +    public Optimizer(Vector<String>_output, boolean[] _isOptimizable, double[] _initialLambda,
 +      HashMap<String, String>[] _feat_hash, HashMap<String, String>[] _stats_hash) {
 +    output = _output; // (not used for now)
 +    isOptimizable = _isOptimizable;
 +    initialLambda = _initialLambda; // initial weights array
 +    paramDim = initialLambda.length - 1;    
 +    initialLambda = _initialLambda;
 +    feat_hash = _feat_hash; // feature hash table
 +    stats_hash = _stats_hash; // suff. stats hash table
 +    finalLambda = new double[initialLambda.length];
-     for(int i = 0; i < finalLambda.length; i++)
-       finalLambda[i] = initialLambda[i];
++	    System.arraycopy(initialLambda, 0, finalLambda, 0, finalLambda.length);
 +  }
 +
 +  //run AdaGrad for one epoch
 +  public double[] runOptimizer() {
-       List<Integer> sents = new ArrayList<Integer>();
++      List<Integer> sents = new ArrayList<>();
 +      for( int i = 0; i < sentNum; ++i )
 +	  sents.add(i);
 +      double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required
 +      for( int i = 0; i < initialLambda.length; ++i )
 +	  avgLambda[i] = 0;
 +      for ( int iter = 0; iter < adagradIter; ++iter ) {
 +	  System.arraycopy(finalLambda, 1, initialLambda, 1, paramDim);
 +    	  if(needShuffle)
 +	      Collections.shuffle(sents);
 +    
 +	  double oraMetric, oraScore, predMetric, predScore;
 +	  double[] oraPredScore = new double[4];
 +	  double loss = 0;
 +	  double diff = 0;
 +	  double sumMetricScore = 0;
 +	  double sumModelScore = 0;
 +	  String oraFeat = "";
 +	  String predFeat = "";
 +	  String[] oraPredFeat = new String[2];
 +	  String[] vecOraFeat;
 +	  String[] vecPredFeat;
 +	  String[] featInfo;
 +	  int thisBatchSize = 0;
 +	  int numBatch = 0;
 +	  int numUpdate = 0;
 +	  Iterator it;
 +	  Integer diffFeatId;
 +
 +	  //update weights
 +	  Integer s;
 +	  int sentCount = 0;
 +	  double prevLambda = 0;
 +	  double diffFeatVal = 0;
 +	  double oldVal = 0;
 +	  double gdStep = 0;
 +	  double Hii = 0;
 +	  double gradiiSquare = 0;
 +	  int lastUpdateTime = 0;
- 	  HashMap<Integer, Integer> lastUpdate = new HashMap<Integer, Integer>();
- 	  HashMap<Integer, Double> lastVal = new HashMap<Integer, Double>();
- 	  HashMap<Integer, Double> H = new HashMap<Integer, Double>();
++	  HashMap<Integer, Integer> lastUpdate = new HashMap<>();
++	  HashMap<Integer, Double> lastVal = new HashMap<>();
++	  HashMap<Integer, Double> H = new HashMap<>();
 +	  while( sentCount < sentNum ) {
 +	      loss = 0;
 +	      thisBatchSize = batchSize;
 +	      ++numBatch;
- 	      HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();
++	      HashMap<Integer, Double> featDiff = new HashMap<>();
 +	      for(int b = 0; b < batchSize; ++b ) {
 +		  //find out oracle and prediction
 +		  s = sents.get(sentCount);
 +		  findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);
 +      
 +		  //the model scores here are already scaled in findOraPred
 +		  oraMetric = oraPredScore[0];
 +		  oraScore = oraPredScore[1];
 +		  predMetric = oraPredScore[2];
 +		  predScore = oraPredScore[3];
 +		  oraFeat = oraPredFeat[0];
 +		  predFeat = oraPredFeat[1];
 +      
 +		  //update the scale
 +		  if(needScale) { //otherwise featscale remains 1.0
 +		      sumMetricScore += Math.abs(oraMetric + predMetric);
 +		      //restore the original model score
 +		      sumModelScore += Math.abs(oraScore + predScore) / featScale;
 +        
 +		      if(sumModelScore/sumMetricScore > scoreRatio)
 +			  featScale = sumMetricScore/sumModelScore;
 +		  }
 +		  // processedSent++;
 +      
 +		  vecOraFeat = oraFeat.split("\\s+");
 +		  vecPredFeat = predFeat.split("\\s+");
 +
 +		  //accumulate difference feature vector
 +		  if ( b == 0 ) {
- 		      for (int i = 0; i < vecOraFeat.length; i++) {
- 			  featInfo = vecOraFeat[i].split("=");
- 			  diffFeatId = Integer.parseInt(featInfo[0]);
- 			  featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));
- 		      }
- 		      for (int i = 0; i < vecPredFeat.length; i++) {
- 			  featInfo = vecPredFeat[i].split("=");
- 			  diffFeatId = Integer.parseInt(featInfo[0]);
- 			  if (featDiff.containsKey(diffFeatId)) { //overlapping features
- 			      diff = featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]);
- 			      if ( Math.abs(diff) > 1e-20 )
- 				  featDiff.put(diffFeatId, diff);
- 			      else
- 				  featDiff.remove(diffFeatId);
++			  for (String aVecOraFeat : vecOraFeat) {
++				  featInfo = aVecOraFeat.split("=");
++				  diffFeatId = Integer.parseInt(featInfo[0]);
++				  featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));
++			  }
++			  for (String aVecPredFeat : vecPredFeat) {
++				  featInfo = aVecPredFeat.split("=");
++				  diffFeatId = Integer.parseInt(featInfo[0]);
++				  if (featDiff.containsKey(diffFeatId)) { //overlapping features
++					  diff = featDiff.get(diffFeatId) - Double.parseDouble(featInfo[1]);
++					  if (Math.abs(diff) > 1e-20)
++						  featDiff.put(diffFeatId, diff);
++					  else
++						  featDiff.remove(diffFeatId);
++				  } else //features only firing in the 2nd feature vector
++					  featDiff.put(diffFeatId, -1.0 * Double.parseDouble(featInfo[1]));
 +			  }
- 			  else //features only firing in the 2nd feature vector
- 			      featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));
- 		      }
 +		  } else {
- 		      for (int i = 0; i < vecOraFeat.length; i++) {
- 			  featInfo = vecOraFeat[i].split("=");
- 			  diffFeatId = Integer.parseInt(featInfo[0]);
- 			  if (featDiff.containsKey(diffFeatId)) { //overlapping features
- 			      diff = featDiff.get(diffFeatId)+Double.parseDouble(featInfo[1]);
- 			      if ( Math.abs(diff) > 1e-20 )
- 				  featDiff.put(diffFeatId, diff);
- 			      else
- 				  featDiff.remove(diffFeatId);
++			  for (String aVecOraFeat : vecOraFeat) {
++				  featInfo = aVecOraFeat.split("=");
++				  diffFeatId = Integer.parseInt(featInfo[0]);
++				  if (featDiff.containsKey(diffFeatId)) { //overlapping features
++					  diff = featDiff.get(diffFeatId) + Double.parseDouble(featInfo[1]);
++					  if (Math.abs(diff) > 1e-20)
++						  featDiff.put(diffFeatId, diff);
++					  else
++						  featDiff.remove(diffFeatId);
++				  } else //features only firing in the new oracle feature vector
++					  featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));
 +			  }
- 			  else //features only firing in the new oracle feature vector
- 			      featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));
- 		      }
- 		      for (int i = 0; i < vecPredFeat.length; i++) {
- 			  featInfo = vecPredFeat[i].split("=");
- 			  diffFeatId = Integer.parseInt(featInfo[0]);
- 			  if (featDiff.containsKey(diffFeatId)) { //overlapping features
- 			      diff = featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]);
- 			      if ( Math.abs(diff) > 1e-20 )
- 				  featDiff.put(diffFeatId, diff);
- 			      else
- 				  featDiff.remove(diffFeatId);
++			  for (String aVecPredFeat : vecPredFeat) {
++				  featInfo = aVecPredFeat.split("=");
++				  diffFeatId = Integer.parseInt(featInfo[0]);
++				  if (featDiff.containsKey(diffFeatId)) { //overlapping features
++					  diff = featDiff.get(diffFeatId) - Double.parseDouble(featInfo[1]);
++					  if (Math.abs(diff) > 1e-20)
++						  featDiff.put(diffFeatId, diff);
++					  else
++						  featDiff.remove(diffFeatId);
++				  } else //features only firing in the new prediction feature vector
++					  featDiff.put(diffFeatId, -1.0 * Double.parseDouble(featInfo[1]));
 +			  }
- 			  else //features only firing in the new prediction feature vector
- 			      featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));
- 		      }
 +		  }
 +
 +		  //remember the model scores here are already scaled
 +		  double singleLoss = evalMetric.getToBeMinimized() ?
 +		      (predMetric-oraMetric) - (oraScore-predScore)/featScale: 
 +		      (oraMetric-predMetric) - (oraScore-predScore)/featScale;
 +		  if(singleLoss > 0)
 +		      loss += singleLoss;
 +		  ++sentCount;
 +		  if( sentCount >= sentNum ) {
 +		      thisBatchSize = b + 1;
 +		      break;
 +		  }
 +	      } //for(int b : batchSize)
 +
 +	      //System.out.println("\n\n"+sentCount+":");
 +
 +	      if( loss > 0 ) {
 +	      //if(true) {
 +		  ++numUpdate;
 +		  //update weights (see Duchi'11, Eq.23. For l1-reg, use lazy update)
 +		  Set<Integer> diffFeatSet = featDiff.keySet();
 +		  it = diffFeatSet.iterator();
 +		  while(it.hasNext()) { //note these are all non-zero gradients!
 +		      diffFeatId = (Integer)it.next();
 +		      diffFeatVal = -1.0 * featDiff.get(diffFeatId); //gradient
 +		      if( regularization > 0 ) {
 +			  lastUpdateTime =
 +			      lastUpdate.get(diffFeatId) == null ? 0 : lastUpdate.get(diffFeatId);
 +			  if( lastUpdateTime < numUpdate - 1 ) {
 +			      //haven't been updated (gradient=0) for at least 2 steps
 +			      //lazy compute prevLambda now
 +			      oldVal =
 +				  lastVal.get(diffFeatId) == null ? initialLambda[diffFeatId] : lastVal.get(diffFeatId);
 +			      Hii =
 +				  H.get(diffFeatId) == null ? 0 : H.get(diffFeatId);
 +			      if(Math.abs(Hii) > 1e-20) {
 +				  if( regularization == 1 )
 +				      prevLambda =
 +					  Math.signum(oldVal) * clip( Math.abs(oldVal) - lam * eta * (numBatch - 1 - lastUpdateTime) / Hii );
 +				  else if( regularization == 2 ) {
 +				      prevLambda =
 +					  Math.pow( Hii/(lam+Hii), (numUpdate - 1 - lastUpdateTime) ) * oldVal;
 +				      if(needAvg) { //fill the gap due to lazy update
 +					  double prevLambdaCopy = prevLambda;
 +					  double scale = Hii/(lam+Hii);
 +					  for( int t = 0; t < numUpdate - 1 - lastUpdateTime; ++t ) {
 +					      avgLambda[diffFeatId] += prevLambdaCopy;
 +					      prevLambdaCopy /= scale;
 +					  }
 +				      }
 +				  }
 +			      } else {
 +				  if( regularization == 1 )
 +				      prevLambda = 0;
 +				  else if( regularization == 2 )
 +				      prevLambda = oldVal;
 +			      }
 +			  } else //just updated at last time step or just started
 +			      prevLambda = finalLambda[diffFeatId];
 +			  if(H.get(diffFeatId) != null) {
 +			      gradiiSquare = H.get(diffFeatId);
 +			      gradiiSquare *= gradiiSquare;
 +			      gradiiSquare += diffFeatVal * diffFeatVal;
 +			      Hii = Math.sqrt(gradiiSquare);
 +			  } else
 +			      Hii = Math.abs(diffFeatVal);
 +			  H.put(diffFeatId, Hii);
 +			  //update the weight
 +			  if( regularization == 1 ) {
 +			      gdStep = prevLambda - eta * diffFeatVal / Hii;
 +			      finalLambda[diffFeatId] = Math.signum(gdStep) * clip( Math.abs(gdStep) - lam * eta / Hii );
 +			  } else if(regularization == 2 ) {
 +			      finalLambda[diffFeatId] = (Hii * prevLambda - eta * diffFeatVal) / (lam + Hii);
 +			      if(needAvg)
 +				  avgLambda[diffFeatId] += finalLambda[diffFeatId];
 +			  }
 +			  lastUpdate.put(diffFeatId, numUpdate);
 +			  lastVal.put(diffFeatId, finalLambda[diffFeatId]);
 +		      } else { //if no regularization
 +			  if(H.get(diffFeatId) != null) {
 +			      gradiiSquare = H.get(diffFeatId);
 +			      gradiiSquare *= gradiiSquare;
 +			      gradiiSquare += diffFeatVal * diffFeatVal;
 +			      Hii = Math.sqrt(gradiiSquare);
 +			  } else
 +			      Hii = Math.abs(diffFeatVal);
 +			  H.put(diffFeatId, Hii);
 +			  finalLambda[diffFeatId] = finalLambda[diffFeatId] - eta * diffFeatVal / Hii;
 +			  if(needAvg)
 +			      avgLambda[diffFeatId] += finalLambda[diffFeatId];
 +		      }
 +		  } //while(it.hasNext())
 +	      } //if(loss > 0)
 +	      else { //no loss, therefore the weight update is skipped
 +		  //however, the avg weights still need to be accumulated
 +		  if( regularization == 0 ) {
 +		      for( int i = 1; i < finalLambda.length; ++i )
 +			  avgLambda[i] += finalLambda[i];
 +		  } else if( regularization == 2 ) {
 +		      if(needAvg) {
 +			  //due to lazy update, we need to figure out the actual
 +			  //weight vector at this point first...
 +			  for( int i = 1; i < finalLambda.length; ++i ) {
 +			      if( lastUpdate.get(i) != null ) {
 +			      	  if( lastUpdate.get(i) < numUpdate ) {
 +			      	      oldVal = lastVal.get(i);
 +			      	      Hii = H.get(i);
 +			      	      //lazy compute
 +			      	      avgLambda[i] +=
 +					  Math.pow( Hii/(lam+Hii), (numUpdate - lastUpdate.get(i)) ) * oldVal;
 +			      	  } else
 +			      	      avgLambda[i] += finalLambda[i];
 +			      }
 +			      avgLambda[i] += finalLambda[i];
 +			  }
 +		      }
 +		  }
 +	      }
 +	  } //while( sentCount < sentNum )
 +	  if( regularization > 0 ) {
 +	      for( int i = 1; i < finalLambda.length; ++i ) {
 +		  //now lazy compute those weights that haven't been taken care of
 +		  if( lastUpdate.get(i) == null )
 +		      finalLambda[i] = 0;
 +		  else if( lastUpdate.get(i) < numUpdate ) {
 +		      oldVal = lastVal.get(i);
 +		      Hii = H.get(i);
 +		      if( regularization == 1 )
 +		  	  finalLambda[i] =
 +		  	      Math.signum(oldVal) * clip( Math.abs(oldVal) - lam * eta * (numUpdate - lastUpdate.get(i)) / Hii );
 +		      else if( regularization == 2 ) {
 +		  	  finalLambda[i] = 
 +		  	      Math.pow( Hii/(lam+Hii), (numUpdate - lastUpdate.get(i)) ) * oldVal;
 +		  	  if(needAvg) { //fill the gap due to lazy update
 +		  	      double prevLambdaCopy = finalLambda[i];
 +		  	      double scale = Hii/(lam+Hii);
 +		  	      for( int t = 0; t < numUpdate - lastUpdate.get(i); ++t ) {
 +		  		  avgLambda[i] += prevLambdaCopy;
 +		  		  prevLambdaCopy /= scale;
 +		  	      }
 +		  	  }
 +		      }
 +		  }
 +		  if( regularization == 2 && needAvg ) {
 +		      if( iter == adagradIter - 1 )
 +			  finalLambda[i] = avgLambda[i] / ( numBatch * adagradIter );
 +		  }
 +	      }
 +	  } else { //if no regularization
 +	      if( iter == adagradIter - 1 && needAvg ) {
 +		  for( int i = 1; i < finalLambda.length; ++i )
 +		      finalLambda[i] = avgLambda[i] / ( numBatch * adagradIter );
 +	      }
 +	  }
 +
 +	  double initMetricScore;
 +	  if (iter == 0) {
 +	      initMetricScore = computeCorpusMetricScore(initialLambda);
 +	      finalMetricScore = computeCorpusMetricScore(finalLambda);
 +	  } else  {
 +	      initMetricScore = finalMetricScore;
 +	      finalMetricScore = computeCorpusMetricScore(finalLambda);
 +	  }
 +	  // prepare the printing info
 +	  String result = " Initial "
 +	      + evalMetric.get_metricName() + "=" + String.format("%.4f", initMetricScore) + " Final "
 +	      + evalMetric.get_metricName() + "=" + String.format("%.4f", finalMetricScore);
 +	  //print lambda info
 +	  // int numParamToPrint = 0;
 +	  // numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters
 +	  // // to print
 +	  // result = paramDim > 10 ? "Final lambda (first 10): {" : "Final lambda: {";
 +    
 +	  // for (int i = 1; i <= numParamToPrint; ++i)
 +	  //     result += String.format("%.4f", finalLambda[i]) + " ";
 +
 +	  output.add(result);
 +      } //for ( int iter = 0; iter < adagradIter; ++iter ) {
 +
 +      //non-optimizable weights should remain unchanged
-       ArrayList<Double> cpFixWt = new ArrayList<Double>();
++      ArrayList<Double> cpFixWt = new ArrayList<>();
 +      for ( int i = 1; i < isOptimizable.length; ++i ) {
 +	  if ( ! isOptimizable[i] )
 +	      cpFixWt.add(finalLambda[i]);
 +      }
 +      normalizeLambda(finalLambda);
 +      int countNonOpt = 0;
 +      for ( int i = 1; i < isOptimizable.length; ++i ) {
 +	  if ( ! isOptimizable[i] ) {
 +	      finalLambda[i] = cpFixWt.get(countNonOpt);
 +	      ++countNonOpt;
 +	  }
 +      }
 +      return finalLambda;
 +  }
 +
 +  private double clip(double x) {
 +      return x > 0 ? x : 0;
 +  }
 +
 +  public double computeCorpusMetricScore(double[] finalLambda) {
 +    int suffStatsCount = evalMetric.get_suffStatsCount();
 +    double modelScore;
 +    double maxModelScore;
 +    Set<String> candSet;
 +    String candStr;
 +    String[] feat_str;
 +    String[] tmpStatsVal = new String[suffStatsCount];
 +    int[] corpusStatsVal = new int[suffStatsCount];
 +    for (int i = 0; i < suffStatsCount; i++)
 +      corpusStatsVal[i] = 0;
 +
 +    for (int i = 0; i < sentNum; i++) {
 +      candSet = feat_hash[i].keySet();
 +
 +      // find out the 1-best candidate for each sentence
 +      // this depends on the training mode
 +      maxModelScore = NegInf;
-       for (Iterator it = candSet.iterator(); it.hasNext();) {
-         modelScore = 0.0;
-         candStr = it.next().toString();
++	    for (String aCandSet : candSet) {
++		    modelScore = 0.0;
++		    candStr = aCandSet.toString();
 +
-         feat_str = feat_hash[i].get(candStr).split("\\s+");
++		    feat_str = feat_hash[i].get(candStr).split("\\s+");
 +
- 	String[] feat_info;
++		    String[] feat_info;
 +
- 	for (int f = 0; f < feat_str.length; f++) {
- 	    feat_info = feat_str[f].split("=");
- 	    modelScore +=
- 		Double.parseDouble(feat_info[1]) * finalLambda[Vocabulary.id(feat_info[0])];
- 	}
++		    for (String aFeat_str : feat_str) {
++			    feat_info = aFeat_str.split("=");
++			    modelScore += Double.parseDouble(feat_info[1]) * finalLambda[Vocabulary.id(feat_info[0])];
++		    }
 +
-         if (maxModelScore < modelScore) {
-           maxModelScore = modelScore;
-           tmpStatsVal = stats_hash[i].get(candStr).split("\\s+"); // save the
-                                                                   // suff stats
-         }
-       }
++		    if (maxModelScore < modelScore) {
++			    maxModelScore = modelScore;
++			    tmpStatsVal = stats_hash[i].get(candStr).split("\\s+"); // save the
++			    // suff stats
++		    }
++	    }
 +
 +      for (int j = 0; j < suffStatsCount; j++)
 +        corpusStatsVal[j] += Integer.parseInt(tmpStatsVal[j]); // accumulate
 +                                                               // corpus-leve
 +                                                               // suff stats
 +    } // for( int i=0; i<sentNum; i++ )
 +
 +    return evalMetric.score(corpusStatsVal);
 +  }
 +  
 +  private void findOraPred(int sentId, double[] oraPredScore, String[] oraPredFeat, double[] lambda, double featScale)
 +  {
 +    double oraMetric=0, oraScore=0, predMetric=0, predScore=0;
 +    String oraFeat="", predFeat="";
 +    double candMetric = 0, candScore = 0; //metric and model scores for each cand
 +    Set<String> candSet = stats_hash[sentId].keySet();
 +    String cand = "";
 +    String feats = "";
 +    String oraCand = ""; //only used when BLEU/TER-BLEU is used as metric
 +    String[] featStr;
 +    String[] featInfo;
 +    
 +    int actualFeatId;
 +    double bestOraScore;
 +    double worstPredScore;
 +    
 +    if(oraSelectMode==1)
 +      bestOraScore = NegInf; //larger score will be selected
 +    else {
 +      if(evalMetric.getToBeMinimized())
 +        bestOraScore = PosInf; //smaller score will be selected
 +      else
 +        bestOraScore = NegInf;
 +    }
 +    
 +    if(predSelectMode==1 || predSelectMode==2)
 +      worstPredScore = NegInf; //larger score will be selected
 +    else {
 +      if(evalMetric.getToBeMinimized())
 +        worstPredScore = NegInf; //larger score will be selected
 +      else
 +        worstPredScore = PosInf;
 +    }
-     
-     for (Iterator it = candSet.iterator(); it.hasNext();) {
-       cand = it.next().toString();
-       candMetric = computeSentMetric(sentId, cand); //compute metric score
- 
-       //start to compute model score
-       candScore = 0;
-       featStr = feat_hash[sentId].get(cand).split("\\s+");
-       feats = "";
- 
-       for (int i = 0; i < featStr.length; i++) {
-           featInfo = featStr[i].split("=");
- 	  actualFeatId = Vocabulary.id(featInfo[0]);
- 	  candScore += Double.parseDouble(featInfo[1]) * lambda[actualFeatId];
- 	  if ( (actualFeatId < isOptimizable.length && isOptimizable[actualFeatId]) ||
- 	       actualFeatId >= isOptimizable.length )
- 	      feats += actualFeatId + "=" + Double.parseDouble(featInfo[1]) + " ";
-       }
-       
-       candScore *= featScale;  //scale the model score
-       
-       //is this cand oracle?
-       if(oraSelectMode == 1) {//"hope", b=1, r=1
-         if(evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
-           if( bestOraScore<=(candScore-candMetric) ) {
-             bestOraScore = candScore-candMetric;
-             oraMetric = candMetric;
-             oraScore = candScore;
-             oraFeat = feats;
-             oraCand = cand;
-           }
-         }
-         else {
-           if( bestOraScore<=(candScore+candMetric) ) {
-             bestOraScore = candScore+candMetric;
-             oraMetric = candMetric;
-             oraScore = candScore;
-             oraFeat = feats;
-             oraCand = cand;
-           }
-         }
-       }
-       else {//best metric score(ex: max BLEU), b=1, r=0
-         if(evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
-           if( bestOraScore>=candMetric ) {
-             bestOraScore = candMetric;
-             oraMetric = candMetric;
-             oraScore = candScore;
-             oraFeat = feats;
-             oraCand = cand;
-           }
-         }
-         else {
-           if( bestOraScore<=candMetric ) {
-             bestOraScore = candMetric;
-             oraMetric = candMetric;
-             oraScore = candScore;
-             oraFeat = feats;
-             oraCand = cand;
-           }
-         }
-       }
-       
-       //is this cand prediction?
-       if(predSelectMode == 1) {//"fear"
-         if(evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
-           if( worstPredScore<=(candScore+candMetric) ) {
-             worstPredScore = candScore+candMetric;
-             predMetric = candMetric;
-             predScore = candScore;
-             predFeat = feats;
-           }
-         }
-         else {
-           if( worstPredScore<=(candScore-candMetric) ) {
-             worstPredScore = candScore-candMetric;
-             predMetric = candMetric;
-             predScore = candScore;
-             predFeat = feats;
-           }
-         }
-       }
-       else if(predSelectMode == 2) {//model prediction(max model score)
-         if( worstPredScore<=candScore ) {
-           worstPredScore = candScore;
-           predMetric = candMetric; 
-           predScore = candScore;
-           predFeat = feats;
-         }
-       }
-       else {//worst metric score(ex: min BLEU)
-         if(evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
-           if( worstPredScore<=candMetric ) {
-             worstPredScore = candMetric;
-             predMetric = candMetric;
-             predScore = candScore;
-             predFeat = feats;
-           }
-         }
-         else {
-           if( worstPredScore>=candMetric ) {
-             worstPredScore = candMetric;
-             predMetric = candMetric;
-             predScore = candScore;
-             predFeat = feats;
-           }
-         }
-       } 
-     }
++
++	  for (String aCandSet : candSet) {
++		  cand = aCandSet.toString();
++		  candMetric = computeSentMetric(sentId, cand); //compute metric score
++
++		  //start to compute model score
++		  candScore = 0;
++		  featStr = feat_hash[sentId].get(cand).split("\\s+");
++		  feats = "";
++
++		  for (String aFeatStr : featStr) {
++			  featInfo = aFeatStr.split("=");
++			  actualFeatId = Vocabulary.id(featInfo[0]);
++			  candScore += Double.parseDouble(featInfo[1]) * lambda[actualFeatId];
++			  if ((actualFeatId < isOptimizable.length && isOptimizable[actualFeatId])
++					  || actualFeatId >= isOptimizable.length)
++				  feats += actualFeatId + "=" + Double.parseDouble(featInfo[1]) + " ";
++		  }
++
++		  candScore *= featScale;  //scale the model score
++
++		  //is this cand oracle?
++		  if (oraSelectMode == 1) {//"hope", b=1, r=1
++			  if (evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
++				  if (bestOraScore <= (candScore - candMetric)) {
++					  bestOraScore = candScore - candMetric;
++					  oraMetric = candMetric;
++					  oraScore = candScore;
++					  oraFeat = feats;
++					  oraCand = cand;
++				  }
++			  } else {
++				  if (bestOraScore <= (candScore + candMetric)) {
++					  bestOraScore = candScore + candMetric;
++					  oraMetric = candMetric;
++					  oraScore = candScore;
++					  oraFeat = feats;
++					  oraCand = cand;
++				  }
++			  }
++		  } else {//best metric score(ex: max BLEU), b=1, r=0
++			  if (evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
++				  if (bestOraScore >= candMetric) {
++					  bestOraScore = candMetric;
++					  oraMetric = candMetric;
++					  oraScore = candScore;
++					  oraFeat = feats;
++					  oraCand = cand;
++				  }
++			  } else {
++				  if (bestOraScore <= candMetric) {
++					  bestOraScore = candMetric;
++					  oraMetric = candMetric;
++					  oraScore = candScore;
++					  oraFeat = feats;
++					  oraCand = cand;
++				  }
++			  }
++		  }
++
++		  //is this cand prediction?
++		  if (predSelectMode == 1) {//"fear"
++			  if (evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
++				  if (worstPredScore <= (candScore + candMetric)) {
++					  worstPredScore = candScore + candMetric;
++					  predMetric = candMetric;
++					  predScore = candScore;
++					  predFeat = feats;
++				  }
++			  } else {
++				  if (worstPredScore <= (candScore - candMetric)) {
++					  worstPredScore = candScore - candMetric;
++					  predMetric = candMetric;
++					  predScore = candScore;
++					  predFeat = feats;
++				  }
++			  }
++		  } else if (predSelectMode == 2) {//model prediction(max model score)
++			  if (worstPredScore <= candScore) {
++				  worstPredScore = candScore;
++				  predMetric = candMetric;
++				  predScore = candScore;
++				  predFeat = feats;
++			  }
++		  } else {//worst metric score(ex: min BLEU)
++			  if (evalMetric.getToBeMinimized()) {//if the smaller the metric score, the better
++				  if (worstPredScore <= candMetric) {
++					  worstPredScore = candMetric;
++					  predMetric = candMetric;
++					  predScore = candScore;
++					  predFeat = feats;
++				  }
++			  } else {
++				  if (worstPredScore >= candMetric) {
++					  worstPredScore = candMetric;
++					  predMetric = candMetric;
++					  predScore = candScore;
++					  predFeat = feats;
++				  }
++			  }
++		  }
++	  }
 +    
 +    oraPredScore[0] = oraMetric;
 +    oraPredScore[1] = oraScore;
 +    oraPredScore[2] = predMetric;
 +    oraPredScore[3] = predScore;
 +    oraPredFeat[0] = oraFeat;
 +    oraPredFeat[1] = predFeat;
 +    
 +    //update the BLEU metric statistics if pseudo corpus is used to compute BLEU/TER-BLEU
 +    if(evalMetric.get_metricName().equals("BLEU") && usePseudoBleu ) {
 +      String statString;
 +      String[] statVal_str;
 +      statString = stats_hash[sentId].get(oraCand);
 +      statVal_str = statString.split("\\s+");
 +
 +      for (int j = 0; j < evalMetric.get_suffStatsCount(); j++)
 +        bleuHistory[sentId][j] = R*bleuHistory[sentId][j]+Integer.parseInt(statVal_str[j]);
 +    }
 +    
 +    if(evalMetric.get_metricName().equals("TER-BLEU") && usePseudoBleu ) {
 +      String statString;
 +      String[] statVal_str;
 +      statString = stats_hash[sentId].get(oraCand);
 +      statVal_str = statString.split("\\s+");
 +
 +      for (int j = 0; j < evalMetric.get_suffStatsCount()-2; j++)
 +        bleuHistory[sentId][j] = R*bleuHistory[sentId][j]+Integer.parseInt(statVal_str[j+2]); //the first 2 stats are TER stats
 +    }
 +  }
 +  
 +  // compute *sentence-level* metric score for cand
 +  private double computeSentMetric(int sentId, String cand) {
 +    String statString;
 +    String[] statVal_str;
 +    int[] statVal = new int[evalMetric.get_suffStatsCount()];
 +
 +    statString = stats_hash[sentId].get(cand);
 +    statVal_str = statString.split("\\s+");
 +
 +    if(evalMetric.get_metricName().equals("BLEU") && usePseudoBleu) {
 +      for (int j = 0; j < evalMetric.get_suffStatsCount(); j++)
 +        statVal[j] = (int) (Integer.parseInt(statVal_str[j]) + bleuHistory[sentId][j]);
 +    } else if(evalMetric.get_metricName().equals("TER-BLEU") && usePseudoBleu) {
 +      for (int j = 0; j < evalMetric.get_suffStatsCount()-2; j++)
 +        statVal[j+2] = (int)(Integer.parseInt(statVal_str[j+2]) + bleuHistory[sentId][j]); //only modify the BLEU stats part(TER has 2 stats)
 +    } else { //in all other situations, use normal stats
 +      for (int j = 0; j < evalMetric.get_suffStatsCount(); j++)
 +        statVal[j] = Integer.parseInt(statVal_str[j]);
 +    }
 +
 +    return evalMetric.score(statVal);
 +  }
 +
 +  // from ZMERT
 +  private void normalizeLambda(double[] origLambda) {
 +    // private String[] normalizationOptions;
 +    // How should a lambda[] vector be normalized (before decoding)?
 +    // nO[0] = 0: no normalization
 +    // nO[0] = 1: scale so that parameter nO[2] has absolute value nO[1]
 +    // nO[0] = 2: scale so that the maximum absolute value is nO[1]
 +    // nO[0] = 3: scale so that the minimum absolute value is nO[1]
 +    // nO[0] = 4: scale so that the L-nO[1] norm equals nO[2]
 +
 +    int normalizationMethod = (int) normalizationOptions[0];
 +    double scalingFactor = 1.0;
 +    if (normalizationMethod == 0) {
 +      scalingFactor = 1.0;
 +    } else if (normalizationMethod == 1) {
 +      int c = (int) normalizationOptions[2];
 +      scalingFactor = normalizationOptions[1] / Math.abs(origLambda[c]);
 +    } else if (normalizationMethod == 2) {
 +      double maxAbsVal = -1;
 +      int maxAbsVal_c = 0;
 +      for (int c = 1; c <= paramDim; ++c) {
 +        if (Math.abs(origLambda[c]) > maxAbsVal) {
 +          maxAbsVal = Math.abs(origLambda[c]);
 +          maxAbsVal_c = c;
 +        }
 +      }
 +      scalingFactor = normalizationOptions[1] / Math.abs(origLambda[maxAbsVal_c]);
 +
 +    } else if (normalizationMethod == 3) {
 +      double minAbsVal = PosInf;
 +      int minAbsVal_c = 0;
 +
 +      for (int c = 1; c <= paramDim; ++c) {
 +        if (Math.abs(origLambda[c]) < minAbsVal) {
 +          minAbsVal = Math.abs(origLambda[c]);
 +          minAbsVal_c = c;
 +        }
 +      }
 +      scalingFactor = normalizationOptions[1] / Math.abs(origLambda[minAbsVal_c]);
 +
 +    } else if (normalizationMethod == 4) {
 +      double pow = normalizationOptions[1];
 +      double norm = L_norm(origLambda, pow);
 +      scalingFactor = normalizationOptions[2] / norm;
 +    }
 +
 +    for (int c = 1; c <= paramDim; ++c) {
 +      origLambda[c] *= scalingFactor;
 +    }
 +  }
 +
 +  // from ZMERT
 +  private double L_norm(double[] A, double pow) {
 +    // calculates the L-pow norm of A[]
 +    // NOTE: this calculation ignores A[0]
 +    double sum = 0.0;
 +    for (int i = 1; i < A.length; ++i)
 +      sum += Math.pow(Math.abs(A[i]), pow);
 +
 +    return Math.pow(sum, 1 / pow);
 +  }
 +
 +  public static double getScale()
 +  {
 +    return featScale;
 +  }
 +  
 +  public static void initBleuHistory(int sentNum, int statCount)
 +  {
 +    bleuHistory = new double[sentNum][statCount];
 +    for(int i=0; i<sentNum; i++) {
 +      for(int j=0; j<statCount; j++) {
 +        bleuHistory[i][j] = 0.0;
 +      }
 +    }
 +  }
 +
 +  public double getMetricScore()
 +  {
 +      return finalMetricScore;
 +  }
 +  
-   private Vector<String> output;
++  private final Vector<String> output;
 +  private double[] initialLambda;
-   private double[] finalLambda;
++  private final double[] finalLambda;
 +  private double finalMetricScore;
-   private HashMap<String, String>[] feat_hash;
-   private HashMap<String, String>[] stats_hash;
-   private int paramDim;
-   private boolean[] isOptimizable;
++  private final HashMap<String, String>[] feat_hash;
++  private final HashMap<String, String>[] stats_hash;
++  private final int paramDim;
++  private final boolean[] isOptimizable;
 +  public static int sentNum;
 +  public static int adagradIter; //AdaGrad internal iterations
 +  public static int oraSelectMode;
 +  public static int predSelectMode;
 +  public static int batchSize;
 +  public static int regularization;
 +  public static boolean needShuffle;
 +  public static boolean needScale;
 +  public static double scoreRatio;
 +  public static boolean needAvg;
 +  public static boolean usePseudoBleu;
 +  public static double featScale = 1.0; //scale the features in order to make the model score comparable with metric score
 +                                            //updates in each epoch if necessary
 +  public static double eta;
 +  public static double lam;
 +  public static double R; //corpus decay(used only when pseudo corpus is used to compute BLEU) 
 +  public static EvaluationMetric evalMetric;
 +  public static double[] normalizationOptions;
 +  public static double[][] bleuHistory;
 +  
 +  private final static double NegInf = (-1.0 / 0.0);
 +  private final static double PosInf = (+1.0 / 0.0);
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/BasicPhrase.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/BasicPhrase.java
index 6c50458,0000000..8ab8add
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/BasicPhrase.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/BasicPhrase.java
@@@ -1,97 -1,0 +1,97 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus;
 +
 +import java.util.ArrayList;
 +
 +/**
 + * The simplest concrete implementation of Phrase.
 + * 
 + * @author wren ng thornton wren@users.sourceforge.net
 + * @version $LastChangedDate$
 + */
 +public class BasicPhrase extends AbstractPhrase {
 +  private byte language;
 +  private int[] words;
 +
 +
 +  public BasicPhrase(byte language, String sentence) {
 +    this.language = language;
 +    this.words = splitSentence(sentence);
 +  }
 +
 +  private BasicPhrase() {}
 +
 +  public int[] getWordIDs() {
 +    return words;
 +  }
 +
 +  /* See Javadoc for Phrase interface. */
 +  public BasicPhrase subPhrase(int start, int end) {
 +    BasicPhrase that = new BasicPhrase();
 +    that.language = this.language;
 +    that.words = new int[end - start + 1];
 +    System.arraycopy(this.words, start, that.words, 0, end - start + 1);
 +    return that;
 +  }
 +
 +  /* See Javadoc for Phrase interface. */
 +  public ArrayList<Phrase> getSubPhrases() {
 +    return this.getSubPhrases(this.size());
 +  }
 +
 +  /* See Javadoc for Phrase interface. */
 +  public ArrayList<Phrase> getSubPhrases(int maxLength) {
-     ArrayList<Phrase> phrases = new ArrayList<Phrase>();
++    ArrayList<Phrase> phrases = new ArrayList<>();
 +    int len = this.size();
 +    for (int n = 1; n <= maxLength; n++)
 +      for (int i = 0; i <= len - n; i++)
 +        phrases.add(this.subPhrase(i, i + n - 1));
 +    return phrases;
 +  }
 +
 +  /* See Javadoc for Phrase interface. */
 +  public int size() {
 +    return (words == null ? 0 : words.length);
 +  }
 +
 +  /* See Javadoc for Phrase interface. */
 +  public int getWordID(int position) {
 +    return words[position];
 +  }
 +
 +  /**
 +   * Returns a human-readable String representation of the phrase.
 +   * <p>
 +   * The implementation of this method is slightly more efficient than that inherited from
 +   * <code>AbstractPhrase</code>.
 +   * 
 +   * @return a human-readable String representation of the phrase.
 +   */
 +  public String toString() {
 +    StringBuffer sb = new StringBuffer();
 +    if (words != null) {
 +      for (int i = 0; i < words.length; ++i) {
 +        if (i != 0) sb.append(' ');
 +        sb.append(Vocabulary.word(words[i]));
 +      }
 +    }
 +    return sb.toString();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/ContiguousPhrase.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/ContiguousPhrase.java
index af669b7,0000000..9c76ce2
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/ContiguousPhrase.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/ContiguousPhrase.java
@@@ -1,127 -1,0 +1,127 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +/**
 + * ContiguousPhrase implements the Phrase interface by linking into indices within a corpus. This is
 + * intended to be a very low-memory implementation of the class.
 + * 
 + * @author Chris Callison-Burch
 + * @since 29 May 2008
 + * @version $LastChangedDate:2008-09-18 12:47:23 -0500 (Thu, 18 Sep 2008) $
 + */
 +public class ContiguousPhrase extends AbstractPhrase {
 +
-   protected int startIndex;
-   protected int endIndex;
-   protected Corpus corpusArray;
++  protected final int startIndex;
++  protected final int endIndex;
++  protected final Corpus corpusArray;
 +
 +  public ContiguousPhrase(int startIndex, int endIndex, Corpus corpusArray) {
 +    this.startIndex = startIndex;
 +    this.endIndex = endIndex;
 +    this.corpusArray = corpusArray;
 +  }
 +
 +  /**
 +   * This method copies the phrase into an array of ints. This method should be avoided if possible.
 +   * 
 +   * @return an int[] corresponding to the ID of each word in the phrase
 +   */
 +  public int[] getWordIDs() {
 +    int[] words = new int[endIndex - startIndex];
 +    for (int i = startIndex; i < endIndex; i++) {
 +      words[i - startIndex] = corpusArray.getWordID(i); // corpusArray.corpus[i];
 +    }
 +    return words;
 +  }
 +
 +  public int getWordID(int position) {
 +    return corpusArray.getWordID(startIndex + position);
 +    // return corpusArray.corpus[startIndex+position];
 +  }
 +
 +  public int size() {
 +    return endIndex - startIndex;
 +  }
 +
 +  /**
 +   * Gets all possible subphrases of this phrase, up to and including the phrase itself. For
 +   * example, the phrase "I like cheese ." would return the following:
 +   * <ul>
 +   * <li>I
 +   * <li>like
 +   * <li>cheese
 +   * <li>.
 +   * <li>I like
 +   * <li>like cheese
 +   * <li>cheese .
 +   * <li>I like cheese
 +   * <li>like cheese .
 +   * <li>I like cheese .
 +   * </ul>
 +   * 
 +   * @return ArrayList of all possible subphrases.
 +   */
 +  public List<Phrase> getSubPhrases() {
 +    return getSubPhrases(size());
 +  }
 +
 +  /**
 +   * Returns a list of subphrases only of length <code>maxLength</code> or smaller.
 +   * 
 +   * @param maxLength the maximum length phrase to return.
 +   * @return ArrayList of all possible subphrases of length maxLength or less
 +   * @see #getSubPhrases()
 +   */
 +  public List<Phrase> getSubPhrases(int maxLength) {
 +    if (maxLength > size()) return getSubPhrases(size());
-     List<Phrase> phrases = new ArrayList<Phrase>();
++    List<Phrase> phrases = new ArrayList<>();
 +    for (int i = 0; i < size(); i++) {
 +      for (int j = i + 1; (j <= size()) && (j - i <= maxLength); j++) {
 +        Phrase subPhrase = subPhrase(i, j);
 +        phrases.add(subPhrase);
 +      }
 +    }
 +    return phrases;
 +  }
 +
 +  /**
 +   * creates a new phrase object from the indexes provided.
 +   * <P>
 +   * NOTE: subList merely creates a "view" of the existing Phrase object. Memory taken up by other
 +   * Words in the Phrase is not freed since the underlying subList object still points to the
 +   * complete Phrase List.
 +   * 
 +   * @see ArrayList#subList(int, int)
 +   */
 +  public Phrase subPhrase(int start, int end) {
 +    return new ContiguousPhrase(startIndex + start, startIndex + end, corpusArray);
 +  }
 +
 +  /**
 +   * Main contains test code
 +   * @param args String array of arguments used to run this class.
 +   */
 +  public static void main(String[] args) {
 +
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/Phrase.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/Phrase.java
index 5a06a8b,0000000..41e8c63
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/Phrase.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/Phrase.java
@@@ -1,117 -1,0 +1,117 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +
 +/**
 + * Representation of a sequence of tokens.
 + * 
 + * @version $LastChangedDate:2008-09-18 10:31:54 -0500 (Thu, 18 Sep 2008) $
 + */
 +public interface Phrase extends Comparable<Phrase> {
 +
 +  /**
 +   * This method gets the integer IDs of the phrase as an array of ints.
 +   * 
 +   * @return an int[] corresponding to the ID of each word in the phrase
 +   */
-   public int[] getWordIDs();
++  int[] getWordIDs();
 +
 +  /**
 +   * Returns the integer word id of the word at the specified position.
 +   * 
 +   * @param position Index of a word in this phrase.
 +   * @return the integer word id of the word at the specified position.
 +   */
 +  int getWordID(int position);
 +
 +
 +  /**
 +   * Returns the number of words in this phrase.
 +   * 
 +   * @return the number of words in this phrase.
 +   */
 +  int size();
 +
 +
 +
 +  /**
 +   * Gets all possible subphrases of this phrase, up to and including the phrase itself. For
 +   * example, the phrase "I like cheese ." would return the following:
 +   * <ul>
 +   * <li>I
 +   * <li>like
 +   * <li>cheese
 +   * <li>.
 +   * <li>I like
 +   * <li>like cheese
 +   * <li>cheese .
 +   * <li>I like cheese
 +   * <li>like cheese .
 +   * <li>I like cheese .
 +   * </ul>
 +   * 
 +   * @return List of all possible subphrases.
 +   */
 +  List<Phrase> getSubPhrases();
 +
 +
 +  /**
 +   * Returns a list of subphrases only of length <code>maxLength</code> or smaller.
 +   * 
 +   * @param maxLength the maximum length phrase to return.
 +   * @return List of all possible subphrases of length maxLength or less
 +   * @see #getSubPhrases()
 +   */
 +  List<Phrase> getSubPhrases(int maxLength);
 +
 +
 +  /**
 +   * creates a new phrase object from the indexes provided.
 +   * <P>
 +   * NOTE: subList merely creates a "view" of the existing Phrase object. Memory taken up by other
 +   * Words in the Phrase is not freed since the underlying subList object still points to the
 +   * complete Phrase List.
 +   * 
 +   * @see ArrayList#subList(int, int)
 +   * @param start start position to begin new phrase
 +   * @param end end position to end new phrase
 +   * @return a new {@link org.apache.joshua.corpus.Phrase} object from the indexes provided.
 +   */
 +  Phrase subPhrase(int start, int end);
 +
 +
 +  /**
 +   * Compares the two strings based on the lexicographic order of words defined in the Vocabulary.
 +   * 
 +   * @param other the object to compare to
 +   * @return -1 if this object is less than the parameter, 0 if equals, 1 if greater
 +   */
 +  int compareTo(Phrase other);
 +
 +  /**
 +   * Returns a human-readable String representation of the phrase.
 +   * 
 +   * @return a human-readable String representation of the phrase.
 +   */
 +  String toString();
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/Span.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/Span.java
index 414fe95,0000000..26e00aa
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/Span.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/Span.java
@@@ -1,175 -1,0 +1,175 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus;
 +
 +import java.util.ArrayList;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.NoSuchElementException;
 +
 +/**
 + * Represents a span with an inclusive starting index and an exclusive ending index.
 + * 
 + * @author Lane Schwartz
 + */
 +public class Span implements Iterable<Integer>, Comparable<Span> {
 +
 +  /** Inclusive starting index of this span. */
-   public int start;
++  public final int start;
 +
 +  /** Exclusive ending index of this span. */
-   public int end;
++  public final int end;
 +
 +
 +  /**
 +   * Constructs a new span with the given inclusive starting and exclusive ending indices.
 +   * 
 +   * @param start Inclusive starting index of this span.
 +   * @param end Exclusive ending index of this span.
 +   */
 +  public Span(int start, int end) {
 +    this.start = start;
 +    this.end = end;
 +  }
 +
 +
 +  /**
 +   * Returns the length of the span.
 +   * 
 +   * @return the length of the span; this is equivalent to <code>span.end - span.start</code>.
 +   */
 +  public int size() {
 +    return end - start;
 +  }
 +
 +  /**
 +   * Returns all subspans of the given Span.
 +   * 
 +   * @return a list of all subspans.
 +   */
 +  public List<Span> getSubSpans() {
 +    return getSubSpans(size());
 +  }
 +
 +  /**
 +   * Returns all subspans of the given Span, up to a specified Span size.
 +   * 
 +   * @param max the maximum Span size to return
 +   * @return a list all subspans up to the given size
 +   */
 +  public List<Span> getSubSpans(int max) {
 +    int spanSize = size();
-     ArrayList<Span> result = new ArrayList<Span>(max * spanSize);
++    ArrayList<Span> result = new ArrayList<>(max * spanSize);
 +    for (int len = max; len > 0; len--) {
 +      for (int i = start; i < end - len + 1; i++) {
 +        result.add(new Span(i, i + len));
 +      }
 +    }
 +    return result;
 +  }
 +
 +  public boolean strictlyContainedIn(Span o) {
 +    return (start >= o.start) && (end <= o.end) && !(start == o.start && end == o.end);
 +  }
 +
 +  /**
 +   * Returns true if the other span does not intersect with this one.
 +   * @param o new {@link org.apache.joshua.corpus.Span} to check for intersection
 +   * @return true if the other span does not intersect with this one
 +   */
 +  public boolean disjointFrom(Span o) {
 +    if (start < o.start) {
 +      return end <= o.start;
 +    }
 +    if (end > o.end) {
 +      return start >= o.end;
 +    }
 +    return false;
 +  }
 +
 +  public String toString() {
 +    return "[" + start + "-" + end + ")";
 +  }
 +
 +
 +  public Iterator<Integer> iterator() {
 +    return new Iterator<Integer>() {
 +
 +      int next = start;
 +
 +      public boolean hasNext() {
 +        return next < end;
 +      }
 +
 +      public Integer next() {
 +        if (!hasNext()) {
 +          throw new NoSuchElementException();
 +        }
 +        return next++;
 +      }
 +
 +      public void remove() {
 +        throw new UnsupportedOperationException();
 +      }
 +
 +    };
 +  }
 +
 +
 +  public int compareTo(Span o) {
 +
 +    if (o == null) {
 +      throw new NullPointerException();
 +    } else {
 +
 +      if (start < o.start) {
 +        return -1;
 +      } else if (start > o.start) {
 +        return 1;
 +      } else {
 +        if (end < o.end) {
 +          return -1;
 +        } else if (end > o.end) {
 +          return 1;
 +        } else {
 +          return 0;
 +        }
 +      }
 +    }
 +
 +  }
 +
 +  @Override
 +  public boolean equals(Object o) {
 +    if (this == o) {
 +      return true;
 +    } else if (o instanceof Span) {
 +      Span other = (Span) o;
 +      return (start == other.start && end == other.end);
 +
 +    } else {
 +      return false;
 +    }
 +  }
 +
 +  @Override
 +  public int hashCode() {
 +    return start * 31 + end * 773;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/SymbolTable.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/SymbolTable.java
index 274e8b9,0000000..07a2760
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/SymbolTable.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/SymbolTable.java
@@@ -1,327 -1,0 +1,327 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus; 
 +
 +import java.util.Collection; 
 +
 +/**
 + * Represents a symbol table capable of mapping between strings and 
 + * symbols. 
 + *  
 + * @author Lane Schwartz 
 + * @author Zhifei Li 
 + * @version $LastChangedDate: 2009-11-24 23:07:43 -0600 (Tue, 24 Nov 2009) $ 
 + */ 
 +public interface SymbolTable { 
 +
 +  //TODO Remove all hard-coded references to nonterminals 
 +
 +  /**
 +   * The unknown word's ID will be the size of the vocabulary, 
 +   * ensuring that it is outside of the vocabulary. Note that 
 +   * for vocabularies which have not been fixed yet, this 
 +   * means the actual value is volatile and therefore a word 
 +   * ID can only be compared against UNKNOWN_WORD at the time 
 +   * the word ID is generated (otherwise unknown words can 
 +   * become "known" if new words are added to the vocabulary 
 +   * before testing). 
 +   * <p> 
 +   * Negative IDs are reserved for non-terminals. 
 +   * 
 +   * Zero is reserved as the UNKNOWN_WORD. 
 +   */ 
 +  int UNKNOWN_WORD = 1; 
 +
 +  /** String representation for out-of-vocabulary words. */ 
 +  String UNKNOWN_WORD_STRING = "<unk>"; 
 +
 +  /**
 +   * Integer representation of the bare (non-indexed) nonterminal X, 
 +   * which represents a wild-card gap in a phrase. 
 +   * <p> 
 +   * All nonterminals are guaranteed to be represented by negative integers. 
 +   */ 
 +  int X = -1; 
 +
 +  /**
 +   * String representation of the bare (non-indexed) nonterminal X, 
 +   * which represents a wild-card gap in a phrase. 
 +   */ 
 +  String X_STRING = "[X]"; 
 +
 +
 +
 +  /**
 +   * String representation of the nonterminal X with index 1, 
 +   * which represents a wild-card gap in a phrase. 
 +   */ 
 +  String X1_STRING = "[X,1]"; 
 +
 +
 +
 +  /**
 +   * String representation of the nonterminal X with index 2, 
 +   * which represents a wild-card gap in a phrase. 
 +   */ 
 +  String X2_STRING = "[X,2]";  
 +
 +  /**
 +   * Integer representation of the nonterminal S. 
 +   * <p> 
 +   * All nonterminals are guaranteed to be represented by negative integers. 
 +   */ 
 +  int S = -4; 
 +
 +  /**
 +   * String representation of the nonterminal S.. 
 +   */ 
 +  String S_STRING = "[S]";  
 +
 +  /**
 +   * Integer representation of the nonterminal X with index 1, 
 +   * which represents a wild-card gap in a phrase. 
 +   * <p> 
 +   * All nonterminals are guaranteed to be represented by negative integers. 
 +   */ 
 +  int S1 = -5; 
 +
 +  /**
 +   * String representation of the nonterminal X with index 2, 
 +   * which represents a wild-card gap in a phrase. 
 +   */ 
 +  String S1_STRING = "[S,1]";  
 +
 +  /**
 +   * Gets a unique integer identifier for the nonterminal. 
 +   * <p> 
 +   * The integer returned is guaranteed to be a negative number. 
 +   *  
 +   * If the nonterminal is {@link #X_STRING}, 
 +   * then the value returned must be {@link #X}. 
 +   *  
 +   * Otherwise, the value returned must be a negative number  
-    * whose value is less than {@link X}. 
++   * whose value is less than {@link #X}.
 +   *  
 +   * @param nonterminal Nonterminal symbol 
 +   * @return a unique integer identifier for the nonterminal 
 +   */ 
 +  int addNonterminal(String nonterminal); 
 +
 +  /**
 +   * Gets a unique integer identifier for the terminal. 
 +   *  
 +   * @param terminal Terminal symbol 
 +   * @return a unique integer identifier for the terminal 
 +   */ 
 +  int addTerminal(String terminal); 
 +
 +  /**
 +   * Gets the unique integer identifiers for the words. 
 +   *  
 +   * @param words Array of symbols 
 +   * @return the unique integer identifiers for the words 
 +   */ 
 +  int[] addTerminals(String[] words); 
 +
 +  /**
 +   * Gets the unique integer identifiers for the words 
 +   * in the sentence. 
 +   *  
 +   * @param sentence Space-delimited string of symbols 
 +   * @return the unique integer identifiers for the words 
 +   *         in the sentence 
 +   */ 
 +  int[] addTerminals(String sentence); 
 +
 +  /**
 +   * Gets an integer identifier for the word. 
 +   * <p> 
 +   * If the word is in the vocabulary, the integer returned 
 +   * will uniquely identify that word. 
 +   * <p> 
 +   * If the word is not in the vocabulary, the integer returned 
 +   * by <code>getUnknownWordID</code> may be returned. 
 +   *  
 +   * Alternatively, implementations may, if they choose, add 
 +   * unknown words and assign them a symbol ID instead of 
 +   * returning <code>getUnknownWordID</code>. 
 +   *  
 +   * @see #getUnknownWordID 
 +   * @return the unique integer identifier for wordString,  
 +   *         or the result of <code>getUnknownWordID</code>  
 +   *         if wordString is not in the vocabulary 
 +   * @param wordString the word to retrieve the integer identifier
 +   */ 
 +  int getID(String wordString); 
 +
 +  /**
 +   * Gets the integer identifiers for all words in the provided 
 +   * sentence. 
 +   * <p> 
 +   * The sentence will be split (on spaces) into words, then 
 +   * the integer identifier for each word will be retrieved 
 +   * using <code>getID</code>. 
 +   *  
 +   * @see #getID(String) 
 +   * @param sentence String of words, separated by spaces. 
 +   * @return Array of integer identifiers for each word in 
 +   *         the sentence 
 +   */ 
 +  int[] getIDs(String sentence); 
 +
 +  /**
 +   * Gets the String that corresponds to the specified integer 
 +   * identifier. 
 +   * <p> 
 +   * If the identifier is in the symbol vocabulary, the String 
 +   * returned will correspond to that identifier. 
 +   *  
 +   * Otherwise, the String returned by <code>getUnknownWord</code> 
 +   * will be returned. 
 +   * 
 +   * @param wordID an integer identifier for a specific String
 +   * @return the String that corresponds to the specified 
 +   *         integer identifier, or the result of 
 +   *         <code>getUnknownWord</code> if the identifier 
 +   *         does not correspond to a word in the vocabulary 
 +   */ 
 +  String getTerminal(int wordID); 
 +
 +  /**
 +   * Gets the String that corresponds to the specified integer 
 +   * identifier. 
 +   * <p> 
 +   * This method can be called for terminals or nonterminals. 
 +   * 
 +   * @param tokenID Integer identifier 
 +   * @return the String that corresponds to the specified 
 +   *         integer identifier 
 +   */ 
 +  String getWord(int tokenID); 
 +
 +  /**
 +   * Gets the String that corresponds to the sequence of 
 +   * specified integer identifiers. 
 +   * 
 +   * @param ids Sequence of integer identifiers 
 +   * @return the String that corresponds to the sequence of 
 +   *         specified integer identifiers 
 +   */ 
 +  String getWords(int[] ids); 
 +
 +  /**
 +   *  
 +   * @param wordIDs an int[] of identifiers for a specific Strings
 +   * @return the String that corresponds to the specified 
 +   *         integer identifiers
 +   */ 
 +  String getTerminals(int[] wordIDs); 
 +
 +  /**
 +   * Gets a collection over all symbol identifiers for the 
 +   * vocabulary. 
 +   * 
 +   * @return a collection over all symbol identifiers for the 
 +   *         vocabulary 
 +   */ 
 +  Collection<Integer> getAllIDs(); 
 +
 +  /**
 +   * Gets the list of all words represented by this vocabulary. 
 +   * 
 +   * @return the list of all words represented by this 
 +   *         vocabulary 
 +   */ 
 +  Collection<String> getWords(); 
 +
 +  /**
 +   * Gets the number of unique words in the vocabulary. 
 +   * 
 +   * @return the number of unique words in the vocabulary. 
 +   */ 
 +  int size(); 
 +
 +  /**
 +   * Gets the integer symbol representation of the unknown 
 +   * word. 
 +   * 
 +   * @return the integer symbol representation of the unknown 
 +   *         word. 
 +   */ 
 +  int getUnknownWordID(); 
 +
 +  /**
 +   * Gets the string representation of the unknown word. 
 +   * 
 +   * @return the string representation of the unknown word. 
 +   */ 
 +  String getUnknownWord(); 
 +
 +  /**
 +   * Returns <code>true</code> if the symbol id represents a 
 +   * nonterminal, <code>false</code> otherwise. 
 +   *  
 +   * @param id int symbol id
 +   * @return <code>true</code> if the symbol id represents a 
 +   *         nonterminal, <code>false</code> otherwise. 
 +   */ 
 +  boolean isNonterminal(int id); 
 +
 +  /**
 +   * Gets the lowest-valued allowable terminal symbol id in 
 +   * this table. 
 +   * 
 +   * @return the lowest-valued allowable terminal symbol id 
 +   *         in this table. 
 +   */ 
 +  int getLowestID(); 
 +
 +
 +  /**
 +   * Gets the highest-valued allowable terminal symbol id in 
 +   * this table. 
 +   * <p> 
 +   * NOTE: This may or may not return the same value as 
 +   * <code>size</code>. 
 +   * 
 +   * @return the highest-valued allowable terminal symbol id 
 +   *         in this table. 
 +   */ 
 +  int getHighestID(); 
 +
 +  /**
 +   * @param id todo
 +   * @return todo
 +   */ 
 +  int getTargetNonterminalIndex(int id);//first convert id to its String mapping, then call the function below 
 +
 +  /**
 +   * @param word todo
 +   * @return todo
 +   */ 
 +  int getTargetNonterminalIndex(String word); 
 +
 +  /**
 +   * @param wordIDs todo
 +   * @param ntIndexIncrements todo
 +   * @return todo
 +   */ 
 +  String getWords(int[] wordIDs, boolean ntIndexIncrements); 
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/corpus/Vocabulary.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/corpus/Vocabulary.java
index 24644ee,0000000..0a26822
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/corpus/Vocabulary.java
+++ b/joshua-core/src/main/java/org/apache/joshua/corpus/Vocabulary.java
@@@ -1,301 -1,0 +1,297 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.corpus;
 +
 +import java.io.BufferedInputStream;
 +import java.io.BufferedOutputStream;
 +import java.io.DataInputStream;
 +import java.io.DataOutputStream;
 +import java.io.Externalizable;
 +import java.io.File;
 +import java.io.FileInputStream;
 +import java.io.FileOutputStream;
 +import java.io.IOException;
 +import java.io.ObjectInput;
 +import java.io.ObjectOutput;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.concurrent.locks.StampedLock;
 +
 +import org.apache.joshua.decoder.ff.lm.NGramLanguageModel;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Static singular vocabulary class.
 + * Supports (de-)serialization into a vocabulary file.
 + *
 + * @author Juri Ganitkevitch
 + */
 +
 +public class Vocabulary implements Externalizable {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Vocabulary.class);
 +  private final static ArrayList<NGramLanguageModel> LMs = new ArrayList<>();
 +
 +  private static List<String> idToString;
 +  private static Map<String, Integer> stringToId;
 +  private static final StampedLock lock = new StampedLock();
 +
 +  static final int UNKNOWN_ID = 0;
 +  static final String UNKNOWN_WORD = "<unk>";
 +
 +  public static final String START_SYM = "<s>";
 +  public static final String STOP_SYM = "</s>";
 +
 +  static {
 +    clear();
 +  }
 +
 +  public static boolean registerLanguageModel(NGramLanguageModel lm) {
 +    long lock_stamp = lock.writeLock();
 +    try {
 +      // Store the language model.
 +      LMs.add(lm);
 +      // Notify it of all the existing words.
 +      boolean collision = false;
 +      for (int i = idToString.size() - 1; i > 0; i--)
 +        collision = collision || lm.registerWord(idToString.get(i), i);
 +      return collision;
 +    } finally {
 +      lock.unlockWrite(lock_stamp);
 +    }
 +  }
 +
 +  /**
 +   * Reads a vocabulary from file. This deletes any additions to the vocabulary made prior to
 +   * reading the file.
 +   *
 +   * @param vocab_file path to a vocabulary file
 +   * @return Returns true if vocabulary was read without mismatches or collisions.
 +   * @throws IOException of the file cannot be found or read properly
 +   */
 +  public static boolean read(final File vocab_file) throws IOException {
 +    DataInputStream vocab_stream =
 +        new DataInputStream(new BufferedInputStream(new FileInputStream(vocab_file)));
 +    int size = vocab_stream.readInt();
 +    LOG.info("Read {} entries from the vocabulary", size);
 +    clear();
 +    for (int i = 0; i < size; i++) {
 +      int id = vocab_stream.readInt();
 +      String token = vocab_stream.readUTF();
 +      if (id != Math.abs(id(token))) {
 +        vocab_stream.close();
 +        return false;
 +      }
 +    }
 +    vocab_stream.close();
 +    return (size + 1 == idToString.size());
 +  }
 +
 +  public static void write(String file_name) throws IOException {
 +    long lock_stamp =lock.readLock();
 +    try {
 +      File vocab_file = new File(file_name);
 +      DataOutputStream vocab_stream =
 +          new DataOutputStream(new BufferedOutputStream(new FileOutputStream(vocab_file)));
 +      vocab_stream.writeInt(idToString.size() - 1);
 +      LOG.info("Writing vocabulary: {} tokens", idToString.size() - 1);
 +      for (int i = 1; i < idToString.size(); i++) {
 +        vocab_stream.writeInt(i);
 +        vocab_stream.writeUTF(idToString.get(i));
 +      }
 +      vocab_stream.close();
 +    }
 +    finally{
 +      lock.unlockRead(lock_stamp);
 +    }
 +  }
 +
 +  /**
 +   * Get the id of the token if it already exists, new id is created otherwise.
 +   *
 +   * TODO: currently locks for every call. Separate constant (frozen) ids from
 +   * changing (e.g. OOV) ids. Constant ids could be immutable -&gt; no locking.
 +   * Alternatively: could we use ConcurrentHashMap to not have to lock if
 +   * actually contains it and only lock for modifications?
 +   * 
 +   * @param token a token to obtain an id for
 +   * @return the token id
 +   */
 +  public static int id(String token) {
 +    // First attempt an optimistic read
 +    long attempt_read_lock = lock.tryOptimisticRead();
 +    if (stringToId.containsKey(token)) {
 +      int resultId = stringToId.get(token);
 +      if (lock.validate(attempt_read_lock)) {
 +        return resultId;
 +      }
 +    }
 +
 +    // The optimistic read failed, try a read with a stamped read lock
 +    long read_lock_stamp = lock.readLock();
 +    try {
 +      if (stringToId.containsKey(token)) {
 +        return stringToId.get(token);
 +      }
 +    } finally {
 +      lock.unlockRead(read_lock_stamp);
 +    }
 +
 +    // Looks like the id we want is not there, let's get a write lock and add it
 +    long write_lock_stamp = lock.writeLock();
 +    try {
 +      if (stringToId.containsKey(token)) {
 +        return stringToId.get(token);
 +      }
 +      int id = idToString.size() * (FormatUtils.isNonterminal(token) ? -1 : 1);
 +
 +      // register this (token,id) mapping with each language
 +      // model, so that they can map it to their own private
 +      // vocabularies
 +      for (NGramLanguageModel lm : LMs)
 +        lm.registerWord(token, Math.abs(id));
 +
 +      idToString.add(token);
 +      stringToId.put(token, id);
 +      return id;
 +    } finally {
 +      lock.unlockWrite(write_lock_stamp);
 +    }
 +  }
 +
 +  public static boolean hasId(int id) {
 +    long lock_stamp = lock.readLock();
 +    try {
 +      id = Math.abs(id);
 +      return (id < idToString.size());
 +    }
 +    finally{
 +      lock.unlockRead(lock_stamp);
 +    }
 +  }
 +
 +  public static int[] addAll(String sentence) {
 +    return addAll(sentence.split("\\s+"));
 +  }
 +
 +  public static int[] addAll(String[] tokens) {
 +    int[] ids = new int[tokens.length];
 +    for (int i = 0; i < tokens.length; i++)
 +      ids[i] = id(tokens[i]);
 +    return ids;
 +  }
 +
 +  public static String word(int id) {
 +    long lock_stamp = lock.readLock();
 +    try {
 +      id = Math.abs(id);
 +      return idToString.get(id);
 +    }
 +    finally{
 +      lock.unlockRead(lock_stamp);
 +    }
 +  }
 +
 +  public static String getWords(int[] ids) {
 +    return getWords(ids, " ");
 +  }
 +  
 +  public static String getWords(int[] ids, final String separator) {
 +    if (ids.length == 0) {
 +      return "";
 +    }
 +    StringBuilder sb = new StringBuilder();
 +    for (int i = 0; i < ids.length - 1; i++) {
 +      sb.append(word(ids[i])).append(separator);
 +    }
 +    return sb.append(word(ids[ids.length - 1])).toString();
 +  }
 +
 +  public static String getWords(final Iterable<Integer> ids) {
 +    StringBuilder sb = new StringBuilder();
 +    for (int id : ids)
 +      sb.append(word(id)).append(" ");
 +    return sb.deleteCharAt(sb.length() - 1).toString();
 +  }
 +
 +  public static int getUnknownId() {
 +    return UNKNOWN_ID;
 +  }
 +
 +  public static String getUnknownWord() {
 +    return UNKNOWN_WORD;
 +  }
 +
 +  public static int size() {
 +    long lock_stamp = lock.readLock();
 +    try {
 +      return idToString.size();
 +    } finally {
 +      lock.unlockRead(lock_stamp);
 +    }
 +  }
 +
 +  public static synchronized int getTargetNonterminalIndex(int id) {
 +    return FormatUtils.getNonterminalIndex(word(id));
 +  }
 +
 +  /**
 +   * Clears the vocabulary and initializes it with an unknown word. Registered
 +   * language models are left unchanged.
 +   */
 +  public static void clear() {
 +    long lock_stamp = lock.writeLock();
 +    try {
-       idToString = new ArrayList<String>();
-       stringToId = new HashMap<String, Integer>();
++      idToString = new ArrayList<>();
++      stringToId = new HashMap<>();
 +
 +      idToString.add(UNKNOWN_ID, UNKNOWN_WORD);
 +      stringToId.put(UNKNOWN_WORD, UNKNOWN_ID);
 +    } finally {
 +      lock.unlockWrite(lock_stamp);
 +    }
 +  }
 +
 +  public static void unregisterLanguageModels() {
 +    LMs.clear();
 +  }
 +
 +  @Override
 +  public void writeExternal(ObjectOutput out) throws IOException {
 +    // TODO Auto-generated method stub
 +
 +  }
 +
 +  @Override
 +  public void readExternal(ObjectInput in)
 +      throws IOException, ClassNotFoundException {
 +    // TODO Auto-generated method stub
 +
 +  }
 +
 +  @Override
 +  public boolean equals(Object o) {
-     if(getClass() == o.getClass()) {
-       return true;
-     } else {
-       return false;
-     }
++    return getClass() == o.getClass();
 +  }
 +
 +}


[42/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
index 789757f,0000000..9dc81a4
mode 100755,000000..100755
--- a/joshua-core/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
+++ b/joshua-core/src/main/java/org/apache/joshua/adagrad/AdaGradCore.java
@@@ -1,3127 -1,0 +1,3126 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.adagrad;
 +
 +import java.io.BufferedReader;
 +import java.io.BufferedWriter;
 +import java.io.File;
 +import java.io.FileInputStream;
 +import java.io.FileNotFoundException;
 +import java.io.FileOutputStream;
 +import java.io.FileReader;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.InputStreamReader;
 +import java.io.OutputStream;
 +import java.io.OutputStreamWriter;
 +import java.io.PrintWriter;
 +import java.text.DecimalFormat;
 +import java.util.ArrayList;
++import java.util.Collections;
 +import java.util.Date;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.Random;
 +import java.util.Scanner;
 +import java.util.TreeSet;
 +import java.util.Vector;
++import java.util.concurrent.ConcurrentHashMap;
 +import java.util.zip.GZIPInputStream;
 +import java.util.zip.GZIPOutputStream;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.Decoder;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.metrics.EvaluationMetric;
 +import org.apache.joshua.util.StreamGobbler;
 +
- import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This code was originally written by Yuan Cao, who copied the MERT code to produce this file.
 + */
 +
 +public class AdaGradCore {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(AdaGradCore.class);
 +  private final static double NegInf = (-1.0 / 0.0);
 +  private final static double PosInf = (+1.0 / 0.0);
 +  private final static double epsilon = 1.0 / 1000000;
 +  private final static DecimalFormat f4 = new DecimalFormat("###0.0000");
 +
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  private final Runtime myRuntime = Runtime.getRuntime();
 +
 +  private TreeSet<Integer>[] indicesOfInterest_all;
 +
 +  private int progress;
 +
 +  private int verbosity; // anything of priority <= verbosity will be printed
 +                         // (lower value for priority means more important)
 +
 +  private Random randGen;
 +  private int generatedRands;
 +
 +  private int numSentences;
 +  // number of sentences in the dev set
 +  // (aka the "MERT training" set)
 +
 +  private int numDocuments;
 +  // number of documents in the dev set
 +  // this should be 1, unless doing doc-level optimization
 +
 +  private int[] docOfSentence;
 +  // docOfSentence[i] stores which document contains the i'th sentence.
 +  // docOfSentence is 0-indexed, as are the documents (i.e. first doc is indexed 0)
 +
 +  private int[] docSubsetInfo;
 +  // stores information regarding which subset of the documents are evaluated
 +  // [0]: method (0-6)
 +  // [1]: first (1-indexed)
 +  // [2]: last (1-indexed)
 +  // [3]: size
 +  // [4]: center
 +  // [5]: arg1
 +  // [6]: arg2
 +  // [1-6] are 0 for method 0, [6] is 0 for methods 1-4 as well
 +  // only [1] and [2] are needed for optimization. The rest are only needed for an output message.
 +
 +  private int refsPerSen;
 +  // number of reference translations per sentence
 +
 +  private int textNormMethod;
 +  // 0: no normalization, 1: "NIST-style" tokenization, and also rejoin 'm, 're, *'s, 've, 'll, 'd,
 +  // and n't,
 +  // 2: apply 1 and also rejoin dashes between letters, 3: apply 1 and also drop non-ASCII
 +  // characters
 +  // 4: apply 1+2+3
 +
 +  private int numParams;
 +  // total number of firing features
 +  // this number may increase overtime as new n-best lists are decoded
 +  // initially it is equal to the # of params in the parameter config file
 +  private int numParamsOld;
 +  // number of features before observing the new features fired in the current iteration
 +
 +  private double[] normalizationOptions;
 +  // How should a lambda[] vector be normalized (before decoding)?
 +  // nO[0] = 0: no normalization
 +  // nO[0] = 1: scale so that parameter nO[2] has absolute value nO[1]
 +  // nO[0] = 2: scale so that the maximum absolute value is nO[1]
 +  // nO[0] = 3: scale so that the minimum absolute value is nO[1]
 +  // nO[0] = 4: scale so that the L-nO[1] norm equals nO[2]
 +
 +  /* *********************************************************** */
 +  /* NOTE: indexing starts at 1 in the following few arrays: */
 +  /* *********************************************************** */
 +
 +  // private double[] lambda;
-   private ArrayList<Double> lambda = new ArrayList<Double>();
++  private ArrayList<Double> lambda = new ArrayList<>();
 +  // the current weight vector. NOTE: indexing starts at 1.
-   private ArrayList<Double> bestLambda = new ArrayList<Double>();
++  private final ArrayList<Double> bestLambda = new ArrayList<>();
 +  // the best weight vector across all iterations
 +
 +  private boolean[] isOptimizable;
 +  // isOptimizable[c] = true iff lambda[c] should be optimized
 +
 +  private double[] minRandValue;
 +  private double[] maxRandValue;
 +  // when choosing a random value for the lambda[c] parameter, it will be
 +  // chosen from the [minRandValue[c],maxRandValue[c]] range.
 +  // (*) minRandValue and maxRandValue must be real values, but not -Inf or +Inf
 +
 +  private double[] defaultLambda;
 +  // "default" parameter values; simply the values read in the parameter file
 +  // USED FOR NON-OPTIMIZABLE (FIXED) FEATURES
 +
 +  /* *********************************************************** */
 +  /* *********************************************************** */
 +
 +  private Decoder myDecoder;
 +  // COMMENT OUT if decoder is not Joshua
 +
 +  private String decoderCommand;
 +  // the command that runs the decoder; read from decoderCommandFileName
 +
 +  private int decVerbosity;
 +  // verbosity level for decoder output. If 0, decoder output is ignored.
 +  // If 1, decoder output is printed.
 +
 +  private int validDecoderExitValue;
 +  // return value from running the decoder command that indicates success
 +
 +  private int numOptThreads;
 +  // number of threads to run things in parallel
 +
 +  private int saveInterFiles;
 +  // 0: nothing, 1: only configs, 2: only n-bests, 3: both configs and n-bests
 +
 +  private int compressFiles;
 +  // should AdaGrad gzip the large files? If 0, no compression takes place.
 +  // If 1, compression is performed on: decoder output files, temp sents files,
 +  // and temp feats files.
 +
 +  private int sizeOfNBest;
 +  // size of N-best list generated by decoder at each iteration
 +  // (aka simply N, but N is a bad variable name)
 +
 +  private long seed;
 +  // seed used to create random number generators
 +
 +  private boolean randInit;
 +  // if true, parameters are initialized randomly. If false, parameters
 +  // are initialized using values from parameter file.
 +
 +  private int maxMERTIterations, minMERTIterations, prevMERTIterations;
 +  // max: maximum number of MERT iterations
 +  // min: minimum number of MERT iterations before an early MERT exit
 +  // prev: number of previous MERT iterations from which to consider candidates (in addition to
 +  // the candidates from the current iteration)
 +
 +  private double stopSigValue;
 +  // early MERT exit if no weight changes by more than stopSigValue
 +  // (but see minMERTIterations above and stopMinIts below)
 +
 +  private int stopMinIts;
 +  // some early stopping criterion must be satisfied in stopMinIts *consecutive* iterations
 +  // before an early exit (but see minMERTIterations above)
 +
 +  private boolean oneModificationPerIteration;
 +  // if true, each MERT iteration performs at most one parameter modification.
 +  // If false, a new MERT iteration starts (i.e. a new N-best list is
 +  // generated) only after the previous iteration reaches a local maximum.
 +
 +  private String metricName;
 +  // name of evaluation metric optimized by MERT
 +
 +  private String metricName_display;
 +  // name of evaluation metric optimized by MERT, possibly with "doc-level " prefixed
 +
 +  private String[] metricOptions;
 +  // options for the evaluation metric (e.g. for BLEU, maxGramLength and effLengthMethod)
 +
 +  private EvaluationMetric evalMetric;
 +  // the evaluation metric used by MERT
 +
 +  private int suffStatsCount;
 +  // number of sufficient statistics for the evaluation metric
 +
 +  private String tmpDirPrefix;
 +  // prefix for the AdaGrad.temp.* files
 +
 +  private boolean passIterationToDecoder;
 +  // should the iteration number be passed as an argument to decoderCommandFileName?
 +
 +  // used by adagrad
 +  private boolean needShuffle = true; // shuffle the training sentences or not
 +  private boolean needAvg = true; // average the weihgts or not?
 +  private boolean usePseudoBleu = true; // need to use pseudo corpus to compute bleu?
 +  private boolean returnBest = true; // return the best weight during tuning
 +  private boolean needScale = true; // need scaling?
 +  private String trainingMode;
 +  private int oraSelectMode = 1;
 +  private int predSelectMode = 1;
 +  private int adagradIter = 1;
 +  private int regularization = 2;
 +  private int batchSize = 1;
 +  private double eta;
 +  private double lam;
 +  private double R = 0.99; // corpus decay when pseudo corpus is used for bleu computation
 +  // private double sentForScale = 0.15; //percentage of sentences for scale factor estimation
 +  private double scoreRatio = 5.0; // sclale so that model_score/metric_score = scoreratio
 +  private double prevMetricScore = 0; // final metric score of the previous iteration, used only
 +                                      // when returnBest = true
 +
 +  private String dirPrefix; // where are all these files located?
 +  private String paramsFileName, docInfoFileName, finalLambdaFileName;
 +  private String sourceFileName, refFileName, decoderOutFileName;
 +  private String decoderConfigFileName, decoderCommandFileName;
 +  private String fakeFileNameTemplate, fakeFileNamePrefix, fakeFileNameSuffix;
 +
 +  // e.g. output.it[1-x].someOldRun would be specified as:
 +  // output.it?.someOldRun
 +  // and we'd have prefix = "output.it" and suffix = ".sameOldRun"
 +
 +  // private int useDisk;
 +
 +  public AdaGradCore(JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +  }
 +
 +  public AdaGradCore(String[] args, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    EvaluationMetric.set_knownMetrics();
 +    processArgsArray(args);
 +    initialize(0);
 +  }
 +
 +  public AdaGradCore(String configFileName, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    EvaluationMetric.set_knownMetrics();
 +    processArgsArray(cfgFileToArgsArray(configFileName));
 +    initialize(0);
 +  }
 +
 +  private void initialize(int randsToSkip) {
 +    println("NegInf: " + NegInf + ", PosInf: " + PosInf + ", epsilon: " + epsilon, 4);
 +
 +    randGen = new Random(seed);
 +    for (int r = 1; r <= randsToSkip; ++r) {
 +      randGen.nextDouble();
 +    }
 +    generatedRands = randsToSkip;
 +
 +    if (randsToSkip == 0) {
 +      println("----------------------------------------------------", 1);
 +      println("Initializing...", 1);
 +      println("----------------------------------------------------", 1);
 +      println("", 1);
 +
 +      println("Random number generator initialized using seed: " + seed, 1);
 +      println("", 1);
 +    }
 +
 +    // count the total num of sentences to be decoded, reffilename is the combined reference file
 +    // name(auto generated)
 +    numSentences = countLines(refFileName) / refsPerSen;
 +
 +    // ??
 +    processDocInfo();
 +    // sets numDocuments and docOfSentence[]
 +
 +    if (numDocuments > 1)
 +      metricName_display = "doc-level " + metricName;
 +
 +    // ??
 +    set_docSubsetInfo(docSubsetInfo);
 +
 +    // count the number of initial features
 +    numParams = countNonEmptyLines(paramsFileName) - 1;
 +    numParamsOld = numParams;
 +
 +    // read parameter config file
 +    try {
 +      // read dense parameter names
 +      BufferedReader inFile_names = new BufferedReader(new FileReader(paramsFileName));
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        String line = "";
 +        while (line != null && line.length() == 0) { // skip empty lines
 +          line = inFile_names.readLine();
 +        }
 +
 +        // save feature names
 +        String paramName = (line.substring(0, line.indexOf("|||"))).trim();
 +        Vocabulary.id(paramName);
 +        // System.err.println(String.format("VOCAB(%s) = %d", paramName, id));
 +      }
 +
 +      inFile_names.close();
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    // the parameter file contains one line per parameter
 +    // and one line for the normalization method
 +    // indexing starts at 1 in these arrays
 +    for (int p = 0; p <= numParams; ++p)
-       lambda.add(new Double(0));
-     bestLambda.add(new Double(0));
++      lambda.add(0d);
++    bestLambda.add(0d);
 +    // why only lambda is a list? because the size of lambda
 +    // may increase over time, but other arrays are specified in
 +    // the param config file, only used for initialization
 +    isOptimizable = new boolean[1 + numParams];
 +    minRandValue = new double[1 + numParams];
 +    maxRandValue = new double[1 + numParams];
 +    defaultLambda = new double[1 + numParams];
 +    normalizationOptions = new double[3];
 +
 +    // read initial param values
 +    processParamFile();
 +    // sets the arrays declared just above
 +
 +    // SentenceInfo.createV(); // uncomment ONLY IF using vocabulary implementation of SentenceInfo
 +
 +    String[][] refSentences = new String[numSentences][refsPerSen];
 +
 +    try {
 +
 +      // read in reference sentences
 +      InputStream inStream_refs = new FileInputStream(new File(refFileName));
 +      BufferedReader inFile_refs = new BufferedReader(new InputStreamReader(inStream_refs, "utf8"));
 +
 +      for (int i = 0; i < numSentences; ++i) {
 +        for (int r = 0; r < refsPerSen; ++r) {
 +          // read the rth reference translation for the ith sentence
 +          refSentences[i][r] = inFile_refs.readLine();
 +        }
 +      }
 +
 +      inFile_refs.close();
 +
 +      // normalize reference sentences
 +      for (int i = 0; i < numSentences; ++i) {
 +        for (int r = 0; r < refsPerSen; ++r) {
 +          // normalize the rth reference translation for the ith sentence
 +          refSentences[i][r] = normalize(refSentences[i][r], textNormMethod);
 +        }
 +      }
 +
 +      // read in decoder command, if any
 +      decoderCommand = null;
 +      if (decoderCommandFileName != null) {
 +        if (fileExists(decoderCommandFileName)) {
 +          BufferedReader inFile_comm = new BufferedReader(new FileReader(decoderCommandFileName));
 +          decoderCommand = inFile_comm.readLine(); // READ IN DECODE COMMAND
 +          inFile_comm.close();
 +        }
 +      }
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    // set static data members for the EvaluationMetric class
 +    EvaluationMetric.set_numSentences(numSentences);
 +    EvaluationMetric.set_numDocuments(numDocuments);
 +    EvaluationMetric.set_refsPerSen(refsPerSen);
 +    EvaluationMetric.set_refSentences(refSentences);
 +    EvaluationMetric.set_tmpDirPrefix(tmpDirPrefix);
 +
 +    evalMetric = EvaluationMetric.getMetric(metricName, metricOptions);
 +    // used only if returnBest = true
 +    prevMetricScore = evalMetric.getToBeMinimized() ? PosInf : NegInf;
 +
 +    // length of sufficient statistics
 +    // for bleu: suffstatscount=8 (2*ngram+2)
 +    suffStatsCount = evalMetric.get_suffStatsCount();
 +
 +    // set static data members for the IntermediateOptimizer class
 +    /*
 +     * IntermediateOptimizer.set_MERTparams(numSentences, numDocuments, docOfSentence,
 +     * docSubsetInfo, numParams, normalizationOptions, isOptimizable oneModificationPerIteration,
 +     * evalMetric, tmpDirPrefix, verbosity);
 +     */
 +
 +    // print info
 +    if (randsToSkip == 0) { // i.e. first iteration
 +      println("Number of sentences: " + numSentences, 1);
 +      println("Number of documents: " + numDocuments, 1);
 +      println("Optimizing " + metricName_display, 1);
 +
 +      /*
 +       * print("docSubsetInfo: {", 1); for (int f = 0; f < 6; ++f) print(docSubsetInfo[f] + ", ",
 +       * 1); println(docSubsetInfo[6] + "}", 1);
 +       */
 +
 +      println("Number of initial features: " + numParams, 1);
 +      print("Initial feature names: {", 1);
 +
 +      for (int c = 1; c <= numParams; ++c)
 +        print("\"" + Vocabulary.word(c) + "\"", 1);
 +      println("}", 1);
 +      println("", 1);
 +
 +      // TODO just print the correct info
 +      println("c    Default value\tOptimizable?\tRand. val. range", 1);
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        print(c + "     " + f4.format(lambda.get(c).doubleValue()) + "\t\t", 1);
 +
 +        if (!isOptimizable[c]) {
 +          println(" No", 1);
 +        } else {
 +          print(" Yes\t\t", 1);
 +          print(" [" + minRandValue[c] + "," + maxRandValue[c] + "]", 1);
 +          println("", 1);
 +        }
 +      }
 +
 +      println("", 1);
 +      print("Weight vector normalization method: ", 1);
 +      if (normalizationOptions[0] == 0) {
 +        println("none.", 1);
 +      } else if (normalizationOptions[0] == 1) {
 +        println(
 +            "weights will be scaled so that the \""
 +                + Vocabulary.word((int) normalizationOptions[2])
 +                + "\" weight has an absolute value of " + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 2) {
 +        println("weights will be scaled so that the maximum absolute value is "
 +            + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 3) {
 +        println("weights will be scaled so that the minimum absolute value is "
 +            + normalizationOptions[1] + ".", 1);
 +      } else if (normalizationOptions[0] == 4) {
 +        println("weights will be scaled so that the L-" + normalizationOptions[1] + " norm is "
 +            + normalizationOptions[2] + ".", 1);
 +      }
 +
 +      println("", 1);
 +
 +      println("----------------------------------------------------", 1);
 +      println("", 1);
 +
 +      // rename original config file so it doesn't get overwritten
 +      // (original name will be restored in finish())
 +      renameFile(decoderConfigFileName, decoderConfigFileName + ".AdaGrad.orig");
 +    } // if (randsToSkip == 0)
 +
 +    // by default, load joshua decoder
 +    if (decoderCommand == null && fakeFileNameTemplate == null) {
 +      println("Loading Joshua decoder...", 1);
 +      myDecoder = new Decoder(joshuaConfiguration, decoderConfigFileName + ".AdaGrad.orig");
 +      println("...finished loading @ " + (new Date()), 1);
 +      println("");
 +    } else {
 +      myDecoder = null;
 +    }
 +
 +    @SuppressWarnings("unchecked")
 +    TreeSet<Integer>[] temp_TSA = new TreeSet[numSentences];
 +    indicesOfInterest_all = temp_TSA;
 +
 +    for (int i = 0; i < numSentences; ++i) {
-       indicesOfInterest_all[i] = new TreeSet<Integer>();
++      indicesOfInterest_all[i] = new TreeSet<>();
 +    }
 +  } // void initialize(...)
 +
 +  // -------------------------
 +
 +  public void run_AdaGrad() {
 +    run_AdaGrad(minMERTIterations, maxMERTIterations, prevMERTIterations);
 +  }
 +
 +  public void run_AdaGrad(int minIts, int maxIts, int prevIts) {
 +    // FIRST, CLEAN ALL PREVIOUS TEMP FILES
 +    String dir;
 +    int k = tmpDirPrefix.lastIndexOf("/");
 +    if (k >= 0) {
 +      dir = tmpDirPrefix.substring(0, k + 1);
 +    } else {
 +      dir = "./";
 +    }
 +    String files;
 +    File folder = new File(dir);
 +
 +    if (folder.exists()) {
 +      File[] listOfFiles = folder.listFiles();
 +
-       for (int i = 0; i < listOfFiles.length; i++) {
-         if (listOfFiles[i].isFile()) {
-           files = listOfFiles[i].getName();
++      for (File listOfFile : listOfFiles) {
++        if (listOfFile.isFile()) {
++          files = listOfFile.getName();
 +          if (files.startsWith("AdaGrad.temp")) {
 +            deleteFile(files);
 +          }
 +        }
 +      }
 +    }
 +
 +    println("----------------------------------------------------", 1);
 +    println("AdaGrad run started @ " + (new Date()), 1);
 +    // printMemoryUsage();
 +    println("----------------------------------------------------", 1);
 +    println("", 1);
 +
 +    // if no default lambda is provided
 +    if (randInit) {
 +      println("Initializing lambda[] randomly.", 1);
 +      // initialize optimizable parameters randomly (sampling uniformly from
 +      // that parameter's random value range)
 +      lambda = randomLambda();
 +    }
 +
 +    println("Initial lambda[]: " + lambdaToString(lambda), 1);
 +    println("", 1);
 +
 +    int[] maxIndex = new int[numSentences];
 +
 +    // HashMap<Integer,int[]>[] suffStats_array = new HashMap[numSentences];
 +    // suffStats_array[i] maps candidates of interest for sentence i to an array
 +    // storing the sufficient statistics for that candidate
 +
 +    int earlyStop = 0;
 +    // number of consecutive iteration an early stopping criterion was satisfied
 +
 +    for (int iteration = 1;; ++iteration) {
 +
 +      // what does "A" contain?
 +      // retA[0]: FINAL_score
 +      // retA[1]: earlyStop
 +      // retA[2]: should this be the last iteration?
 +      double[] A = run_single_iteration(iteration, minIts, maxIts, prevIts, earlyStop, maxIndex);
 +      if (A != null) {
 +        earlyStop = (int) A[1];
 +        if (A[2] == 1)
 +          break;
 +      } else {
 +        break;
 +      }
 +
 +    } // for (iteration)
 +
 +    println("", 1);
 +
 +    println("----------------------------------------------------", 1);
 +    println("AdaGrad run ended @ " + (new Date()), 1);
 +    // printMemoryUsage();
 +    println("----------------------------------------------------", 1);
 +    println("", 1);
 +    if (!returnBest)
 +      println("FINAL lambda: " + lambdaToString(lambda), 1);
 +    // + " (" + metricName_display + ": " + FINAL_score + ")",1);
 +    else
 +      println("BEST lambda: " + lambdaToString(lambda), 1);
 +
 +    // delete intermediate .temp.*.it* decoder output files
 +    for (int iteration = 1; iteration <= maxIts; ++iteration) {
 +      if (compressFiles == 1) {
 +        deleteFile(tmpDirPrefix + "temp.sents.it" + iteration + ".gz");
 +        deleteFile(tmpDirPrefix + "temp.feats.it" + iteration + ".gz");
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".copy.gz")) {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".copy.gz");
 +        } else {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".gz");
 +        }
 +      } else {
 +        deleteFile(tmpDirPrefix + "temp.sents.it" + iteration);
 +        deleteFile(tmpDirPrefix + "temp.feats.it" + iteration);
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".copy")) {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration + ".copy");
 +        } else {
 +          deleteFile(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +      }
 +    }
 +  } // void run_AdaGrad(int maxIts)
 +
 +  // this is the key function!
 +  @SuppressWarnings("unchecked")
 +  public double[] run_single_iteration(int iteration, int minIts, int maxIts, int prevIts,
 +      int earlyStop, int[] maxIndex) {
 +    double FINAL_score = 0;
 +
 +    double[] retA = new double[3];
 +    // retA[0]: FINAL_score
 +    // retA[1]: earlyStop
 +    // retA[2]: should this be the last iteration?
 +
 +    boolean done = false;
 +    retA[2] = 1; // will only be made 0 if we don't break from the following loop
 +
 +    // save feats and stats for all candidates(old & new)
 +    HashMap<String, String>[] feat_hash = new HashMap[numSentences];
 +    for (int i = 0; i < numSentences; i++)
-       feat_hash[i] = new HashMap<String, String>();
++      feat_hash[i] = new HashMap<>();
 +
 +    HashMap<String, String>[] stats_hash = new HashMap[numSentences];
 +    for (int i = 0; i < numSentences; i++)
-       stats_hash[i] = new HashMap<String, String>();
++      stats_hash[i] = new HashMap<>();
 +
 +    while (!done) { // NOTE: this "loop" will only be carried out once
 +      println("--- Starting AdaGrad iteration #" + iteration + " @ " + (new Date()) + " ---", 1);
 +
 +      // printMemoryUsage();
 +
 +      /******************************/
 +      // CREATE DECODER CONFIG FILE //
 +      /******************************/
 +
 +      createConfigFile(lambda, decoderConfigFileName, decoderConfigFileName + ".AdaGrad.orig");
 +      // i.e. use the original config file as a template
 +
 +      /***************/
 +      // RUN DECODER //
 +      /***************/
 +
 +      if (iteration == 1) {
 +        println("Decoding using initial weight vector " + lambdaToString(lambda), 1);
 +      } else {
 +        println("Redecoding using weight vector " + lambdaToString(lambda), 1);
 +      }
 +
 +      // generate the n-best file after decoding
 +      String[] decRunResult = run_decoder(iteration); // iteration passed in case fake decoder will
 +                                                      // be used
 +      // [0] name of file to be processed
 +      // [1] indicates how the output file was obtained:
 +      // 1: external decoder
 +      // 2: fake decoder
 +      // 3: internal decoder
 +
 +      if (!decRunResult[1].equals("2")) {
 +        println("...finished decoding @ " + (new Date()), 1);
 +      }
 +
 +      checkFile(decRunResult[0]);
 +
 +      /************* END OF DECODING **************/
 +
 +      println("Producing temp files for iteration " + iteration, 3);
 +
 +      produceTempFiles(decRunResult[0], iteration);
 +
 +      // save intermedidate output files
 +      // save joshua.config.adagrad.it*
 +      if (saveInterFiles == 1 || saveInterFiles == 3) { // make copy of intermediate config file
 +        if (!copyFile(decoderConfigFileName, decoderConfigFileName + ".AdaGrad.it" + iteration)) {
 +          println("Warning: attempt to make copy of decoder config file (to create"
 +              + decoderConfigFileName + ".AdaGrad.it" + iteration + ") was unsuccessful!", 1);
 +        }
 +      }
 +
 +      // save output.nest.AdaGrad.it*
 +      if (saveInterFiles == 2 || saveInterFiles == 3) { // make copy of intermediate decoder output
 +                                                        // file...
 +
 +        if (!decRunResult[1].equals("2")) { // ...but only if no fake decoder
 +          if (!decRunResult[0].endsWith(".gz")) {
 +            if (!copyFile(decRunResult[0], decRunResult[0] + ".AdaGrad.it" + iteration)) {
 +              println("Warning: attempt to make copy of decoder output file (to create"
 +                  + decRunResult[0] + ".AdaGrad.it" + iteration + ") was unsuccessful!", 1);
 +            }
 +          } else {
 +            String prefix = decRunResult[0].substring(0, decRunResult[0].length() - 3);
 +            if (!copyFile(prefix + ".gz", prefix + ".AdaGrad.it" + iteration + ".gz")) {
 +              println("Warning: attempt to make copy of decoder output file (to create" + prefix
 +                  + ".AdaGrad.it" + iteration + ".gz" + ") was unsuccessful!", 1);
 +            }
 +          }
 +
 +          if (compressFiles == 1 && !decRunResult[0].endsWith(".gz")) {
 +            gzipFile(decRunResult[0] + ".AdaGrad.it" + iteration);
 +          }
 +        } // if (!fake)
 +      }
 +
 +      // ------------- end of saving .adagrad.it* files ---------------
 +
 +      int[] candCount = new int[numSentences];
 +      int[] lastUsedIndex = new int[numSentences];
 +
 +      ConcurrentHashMap[] suffStats_array = new ConcurrentHashMap[numSentences];
 +      for (int i = 0; i < numSentences; ++i) {
 +        candCount[i] = 0;
 +        lastUsedIndex[i] = -1;
 +        // suffStats_array[i].clear();
-         suffStats_array[i] = new ConcurrentHashMap();
++        suffStats_array[i] = new ConcurrentHashMap<>();
 +      }
 +
 +      // initLambda[0] is not used!
 +      double[] initialLambda = new double[1 + numParams];
 +      for (int i = 1; i <= numParams; ++i)
 +        initialLambda[i] = lambda.get(i);
 +
 +      // the "score" in initialScore refers to that
 +      // assigned by the evaluation metric)
 +
 +      // you may consider all candidates from iter 1, or from iter (iteration-prevIts) to current
 +      // iteration
 +      int firstIt = Math.max(1, iteration - prevIts);
 +      // i.e. only process candidates from the current iteration and candidates
 +      // from up to prevIts previous iterations.
 +      println("Reading candidate translations from iterations " + firstIt + "-" + iteration, 1);
 +      println("(and computing " + metricName
 +          + " sufficient statistics for previously unseen candidates)", 1);
 +      print("  Progress: ");
 +
 +      int[] newCandidatesAdded = new int[1 + iteration];
 +      for (int it = 1; it <= iteration; ++it)
 +        newCandidatesAdded[it] = 0;
 +
 +      try {
 +        // read temp files from all past iterations
 +        // 3 types of temp files:
 +        // 1. output hypo at iter i
 +        // 2. feature value of each hypo at iter i
 +        // 3. suff stats of each hypo at iter i
 +
 +        // each inFile corresponds to the output of an iteration
 +        // (index 0 is not used; no corresponding index for the current iteration)
 +        BufferedReader[] inFile_sents = new BufferedReader[iteration];
 +        BufferedReader[] inFile_feats = new BufferedReader[iteration];
 +        BufferedReader[] inFile_stats = new BufferedReader[iteration];
 +
 +        // temp file(array) from previous iterations
 +        for (int it = firstIt; it < iteration; ++it) {
 +          InputStream inStream_sents, inStream_feats, inStream_stats;
 +          if (compressFiles == 0) {
 +            inStream_sents = new FileInputStream(tmpDirPrefix + "temp.sents.it" + it);
 +            inStream_feats = new FileInputStream(tmpDirPrefix + "temp.feats.it" + it);
 +            inStream_stats = new FileInputStream(tmpDirPrefix + "temp.stats.it" + it);
 +          } else {
 +            inStream_sents = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.sents.it"
 +                + it + ".gz"));
 +            inStream_feats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.feats.it"
 +                + it + ".gz"));
 +            inStream_stats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.stats.it"
 +                + it + ".gz"));
 +          }
 +
 +          inFile_sents[it] = new BufferedReader(new InputStreamReader(inStream_sents, "utf8"));
 +          inFile_feats[it] = new BufferedReader(new InputStreamReader(inStream_feats, "utf8"));
 +          inFile_stats[it] = new BufferedReader(new InputStreamReader(inStream_stats, "utf8"));
 +        }
 +
 +        InputStream inStream_sentsCurrIt, inStream_featsCurrIt, inStream_statsCurrIt;
 +        // temp file for current iteration!
 +        if (compressFiles == 0) {
 +          inStream_sentsCurrIt = new FileInputStream(tmpDirPrefix + "temp.sents.it" + iteration);
 +          inStream_featsCurrIt = new FileInputStream(tmpDirPrefix + "temp.feats.it" + iteration);
 +        } else {
 +          inStream_sentsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.sents.it" + iteration + ".gz"));
 +          inStream_featsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.feats.it" + iteration + ".gz"));
 +        }
 +
 +        BufferedReader inFile_sentsCurrIt = new BufferedReader(new InputStreamReader(
 +            inStream_sentsCurrIt, "utf8"));
 +        BufferedReader inFile_featsCurrIt = new BufferedReader(new InputStreamReader(
 +            inStream_featsCurrIt, "utf8"));
 +
 +        BufferedReader inFile_statsCurrIt = null; // will only be used if statsCurrIt_exists below
 +                                                  // is set to true
 +        PrintWriter outFile_statsCurrIt = null; // will only be used if statsCurrIt_exists below is
 +                                                // set to false
 +
 +        // just to check if temp.stat.it.iteration exists
 +        boolean statsCurrIt_exists = false;
 +
 +        if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration)) {
 +          inStream_statsCurrIt = new FileInputStream(tmpDirPrefix + "temp.stats.it" + iteration);
 +          inFile_statsCurrIt = new BufferedReader(new InputStreamReader(inStream_statsCurrIt,
 +              "utf8"));
 +          statsCurrIt_exists = true;
 +          copyFile(tmpDirPrefix + "temp.stats.it" + iteration, tmpDirPrefix + "temp.stats.it"
 +              + iteration + ".copy");
 +        } else if (fileExists(tmpDirPrefix + "temp.stats.it" + iteration + ".gz")) {
 +          inStream_statsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.stats.it" + iteration + ".gz"));
 +          inFile_statsCurrIt = new BufferedReader(new InputStreamReader(inStream_statsCurrIt,
 +              "utf8"));
 +          statsCurrIt_exists = true;
 +          copyFile(tmpDirPrefix + "temp.stats.it" + iteration + ".gz", tmpDirPrefix
 +              + "temp.stats.it" + iteration + ".copy.gz");
 +        } else {
 +          outFile_statsCurrIt = new PrintWriter(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +
 +        // output the 4^th temp file: *.temp.stats.merged
 +        PrintWriter outFile_statsMerged = new PrintWriter(tmpDirPrefix + "temp.stats.merged");
 +        // write sufficient statistics from all the sentences
 +        // from the output files into a single file
 +        PrintWriter outFile_statsMergedKnown = new PrintWriter(tmpDirPrefix
 +            + "temp.stats.mergedKnown");
 +        // write sufficient statistics from all the sentences
 +        // from the output files into a single file
 +
 +        // output the 5^th 6^th temp file, but will be deleted at the end of the function
 +        FileOutputStream outStream_unknownCands = new FileOutputStream(tmpDirPrefix
 +            + "temp.currIt.unknownCands", false);
 +        OutputStreamWriter outStreamWriter_unknownCands = new OutputStreamWriter(
 +            outStream_unknownCands, "utf8");
 +        BufferedWriter outFile_unknownCands = new BufferedWriter(outStreamWriter_unknownCands);
 +
 +        PrintWriter outFile_unknownIndices = new PrintWriter(tmpDirPrefix
 +            + "temp.currIt.unknownIndices");
 +
 +        String sents_str, feats_str, stats_str;
 +
 +        // BUG: this assumes a candidate string cannot be produced for two
 +        // different source sentences, which is not necessarily true
 +        // (It's not actually a bug, but only because existingCandStats gets
 +        // cleared before moving to the next source sentence.)
 +        // FIX: should be made an array, indexed by i
-         HashMap<String, String> existingCandStats = new HashMap<String, String>();
++        HashMap<String, String> existingCandStats = new HashMap<>();
 +        // VERY IMPORTANT:
 +        // A CANDIDATE X MAY APPEARED IN ITER 1, ITER 3
 +        // BUT IF THE USER SPECIFIED TO CONSIDER ITERATIONS FROM ONLY ITER 2, THEN
 +        // X IS NOT A "REPEATED" CANDIDATE IN ITER 3. THEREFORE WE WANT TO KEEP THE
 +        // SUFF STATS FOR EACH CANDIDATE(TO SAVE COMPUTATION IN THE FUTURE)
 +
 +        // Stores precalculated sufficient statistics for candidates, in case
 +        // the same candidate is seen again. (SS stored as a String.)
 +        // Q: Why do we care? If we see the same candidate again, aren't we going
 +        // to ignore it? So, why do we care about the SS of this repeat candidate?
 +        // A: A "repeat" candidate may not be a repeat candidate in later
 +        // iterations if the user specifies a value for prevMERTIterations
 +        // that causes MERT to skip candidates from early iterations.
 +
 +        double[] currFeatVal = new double[1 + numParams];
 +        String[] featVal_str;
 +
 +        int totalCandidateCount = 0;
 +
 +        // new candidate size for each sentence
 +        int[] sizeUnknown_currIt = new int[numSentences];
 +
 +        for (int i = 0; i < numSentences; ++i) {
 +          // process candidates from previous iterations
 +          // low efficiency? for each iteration, it reads in all previous iteration outputs
 +          // therefore a lot of overlapping jobs
 +          // this is an easy implementation to deal with the situation in which user only specified
 +          // "previt" and hopes to consider only the previous previt
 +          // iterations, then for each iteration the existing candadites will be different
 +          for (int it = firstIt; it < iteration; ++it) {
 +            // Why up to but *excluding* iteration?
 +            // Because the last iteration is handled a little differently, since
 +            // the SS must be calculated (and the corresponding file created),
 +            // which is not true for previous iterations.
 +
 +            for (int n = 0; n <= sizeOfNBest; ++n) {
 +              // note that in all temp files, "||||||" is a separator between 2 n-best lists
 +
 +              // Why up to and *including* sizeOfNBest?
 +              // So that it would read the "||||||" separator even if there is
 +              // a complete list of sizeOfNBest candidates.
 +
 +              // for the nth candidate for the ith sentence, read the sentence, feature values,
 +              // and sufficient statistics from the various temp files
 +
 +              // read one line of temp.sent, temp.feat, temp.stats from iteration it
 +              sents_str = inFile_sents[it].readLine();
 +              feats_str = inFile_feats[it].readLine();
 +              stats_str = inFile_stats[it].readLine();
 +
 +              if (sents_str.equals("||||||")) {
 +                n = sizeOfNBest + 1; // move on to the next n-best list
 +              } else if (!existingCandStats.containsKey(sents_str)) // if this candidate does not
 +                                                                    // exist
 +              {
 +                outFile_statsMergedKnown.println(stats_str);
 +
 +                // save feats & stats
 +                feat_hash[i].put(sents_str, feats_str);
 +                stats_hash[i].put(sents_str, stats_str);
 +
 +                // extract feature value
 +                featVal_str = feats_str.split("\\s+");
 +
 +                if (feats_str.indexOf('=') != -1) {
 +                  for (String featurePair : featVal_str) {
 +                    String[] pair = featurePair.split("=");
 +                    String name = pair[0];
 +                    Double value = Double.parseDouble(pair[1]);
 +                  }
 +                }
 +                existingCandStats.put(sents_str, stats_str);
 +                candCount[i] += 1;
 +                newCandidatesAdded[it] += 1;
 +
 +              } // if unseen candidate
 +            } // for (n)
 +          } // for (it)
 +
 +          outFile_statsMergedKnown.println("||||||");
 +
 +          // ---------- end of processing previous iterations ----------
 +          // ---------- now start processing new candidates ----------
 +
 +          // now process the candidates of the current iteration
 +          // now determine the new candidates of the current iteration
 +
 +          /*
 +           * remember: BufferedReader inFile_sentsCurrIt BufferedReader inFile_featsCurrIt
 +           * PrintWriter outFile_statsCurrIt
 +           */
 +
 +          String[] sentsCurrIt_currSrcSent = new String[sizeOfNBest + 1];
 +
-           Vector<String> unknownCands_V = new Vector<String>();
++          Vector<String> unknownCands_V = new Vector<>();
 +          // which candidates (of the i'th source sentence) have not been seen before
 +          // this iteration?
 +
 +          for (int n = 0; n <= sizeOfNBest; ++n) {
 +            // Why up to and *including* sizeOfNBest?
 +            // So that it would read the "||||||" separator even if there is
 +            // a complete list of sizeOfNBest candidates.
 +
 +            // for the nth candidate for the ith sentence, read the sentence,
 +            // and store it in the sentsCurrIt_currSrcSent array
 +
 +            sents_str = inFile_sentsCurrIt.readLine(); // read one candidate from the current
 +                                                       // iteration
 +            sentsCurrIt_currSrcSent[n] = sents_str; // Note: possibly "||||||"
 +
 +            if (sents_str.equals("||||||")) {
 +              n = sizeOfNBest + 1;
 +            } else if (!existingCandStats.containsKey(sents_str)) {
 +              unknownCands_V.add(sents_str); // NEW CANDIDATE FROM THIS ITERATION
 +              writeLine(sents_str, outFile_unknownCands);
 +              outFile_unknownIndices.println(i); // INDEX OF THE NEW CANDIDATES
 +              newCandidatesAdded[iteration] += 1;
 +              existingCandStats.put(sents_str, "U"); // i.e. unknown
 +              // we add sents_str to avoid duplicate entries in unknownCands_V
 +            }
 +          } // for (n)
 +
 +          // only compute suff stats for new candidates
 +          // now unknownCands_V has the candidates for which we need to calculate
 +          // sufficient statistics (for the i'th source sentence)
 +          int sizeUnknown = unknownCands_V.size();
 +          sizeUnknown_currIt[i] = sizeUnknown;
 +
 +          existingCandStats.clear();
 +
 +        } // for (i) each sentence
 +
 +        // ---------- end of merging candidates stats from previous iterations
 +        // and finding new candidates ------------
 +
 +        /*
 +         * int[][] newSuffStats = null; if (!statsCurrIt_exists && sizeUnknown > 0) { newSuffStats =
 +         * evalMetric.suffStats(unknownCands, indices); }
 +         */
 +
 +        outFile_statsMergedKnown.close();
 +        outFile_unknownCands.close();
 +        outFile_unknownIndices.close();
 +
 +        // want to re-open all temp files and start from scratch again?
 +        for (int it = firstIt; it < iteration; ++it) // previous iterations temp files
 +        {
 +          inFile_sents[it].close();
 +          inFile_stats[it].close();
 +
 +          InputStream inStream_sents, inStream_stats;
 +          if (compressFiles == 0) {
 +            inStream_sents = new FileInputStream(tmpDirPrefix + "temp.sents.it" + it);
 +            inStream_stats = new FileInputStream(tmpDirPrefix + "temp.stats.it" + it);
 +          } else {
 +            inStream_sents = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.sents.it"
 +                + it + ".gz"));
 +            inStream_stats = new GZIPInputStream(new FileInputStream(tmpDirPrefix + "temp.stats.it"
 +                + it + ".gz"));
 +          }
 +
 +          inFile_sents[it] = new BufferedReader(new InputStreamReader(inStream_sents, "utf8"));
 +          inFile_stats[it] = new BufferedReader(new InputStreamReader(inStream_stats, "utf8"));
 +        }
 +
 +        inFile_sentsCurrIt.close();
 +        // current iteration temp files
 +        if (compressFiles == 0) {
 +          inStream_sentsCurrIt = new FileInputStream(tmpDirPrefix + "temp.sents.it" + iteration);
 +        } else {
 +          inStream_sentsCurrIt = new GZIPInputStream(new FileInputStream(tmpDirPrefix
 +              + "temp.sents.it" + iteration + ".gz"));
 +        }
 +        inFile_sentsCurrIt = new BufferedReader(new InputStreamReader(inStream_sentsCurrIt, "utf8"));
 +
 +        // calculate SS for unseen candidates and write them to file
 +        FileInputStream inStream_statsCurrIt_unknown = null;
 +        BufferedReader inFile_statsCurrIt_unknown = null;
 +
 +        if (!statsCurrIt_exists && newCandidatesAdded[iteration] > 0) {
 +          // create the file...
 +          evalMetric.createSuffStatsFile(tmpDirPrefix + "temp.currIt.unknownCands", tmpDirPrefix
 +              + "temp.currIt.unknownIndices", tmpDirPrefix + "temp.stats.unknown", sizeOfNBest);
 +
 +          // ...and open it
 +          inStream_statsCurrIt_unknown = new FileInputStream(tmpDirPrefix + "temp.stats.unknown");
 +          inFile_statsCurrIt_unknown = new BufferedReader(new InputStreamReader(
 +              inStream_statsCurrIt_unknown, "utf8"));
 +        }
 +
 +        // open mergedKnown file
 +        // newly created by the big loop above
 +        FileInputStream instream_statsMergedKnown = new FileInputStream(tmpDirPrefix
 +            + "temp.stats.mergedKnown");
 +        BufferedReader inFile_statsMergedKnown = new BufferedReader(new InputStreamReader(
 +            instream_statsMergedKnown, "utf8"));
 +
 +        // num of features before observing new firing features from this iteration
 +        numParamsOld = numParams;
 +
 +        for (int i = 0; i < numSentences; ++i) {
 +          // reprocess candidates from previous iterations
 +          for (int it = firstIt; it < iteration; ++it) {
 +            for (int n = 0; n <= sizeOfNBest; ++n) {
 +              sents_str = inFile_sents[it].readLine();
 +              stats_str = inFile_stats[it].readLine();
 +
 +              if (sents_str.equals("||||||")) {
 +                n = sizeOfNBest + 1;
 +              } else if (!existingCandStats.containsKey(sents_str)) {
 +                existingCandStats.put(sents_str, stats_str);
 +              } // if unseen candidate
 +            } // for (n)
 +          } // for (it)
 +
 +          // copy relevant portion from mergedKnown to the merged file
 +          String line_mergedKnown = inFile_statsMergedKnown.readLine();
 +          while (!line_mergedKnown.equals("||||||")) {
 +            outFile_statsMerged.println(line_mergedKnown);
 +            line_mergedKnown = inFile_statsMergedKnown.readLine();
 +          }
 +
 +          int[] stats = new int[suffStatsCount];
 +
 +          for (int n = 0; n <= sizeOfNBest; ++n) {
 +            sents_str = inFile_sentsCurrIt.readLine();
 +            feats_str = inFile_featsCurrIt.readLine();
 +
 +            if (sents_str.equals("||||||")) {
 +              n = sizeOfNBest + 1;
 +            } else if (!existingCandStats.containsKey(sents_str)) {
 +
 +              if (!statsCurrIt_exists) {
 +                stats_str = inFile_statsCurrIt_unknown.readLine();
 +
 +                String[] temp_stats = stats_str.split("\\s+");
 +                for (int s = 0; s < suffStatsCount; ++s) {
 +                  stats[s] = Integer.parseInt(temp_stats[s]);
 +                }
 +
 +                outFile_statsCurrIt.println(stats_str);
 +              } else {
 +                stats_str = inFile_statsCurrIt.readLine();
 +
 +                String[] temp_stats = stats_str.split("\\s+");
 +                for (int s = 0; s < suffStatsCount; ++s) {
 +                  stats[s] = Integer.parseInt(temp_stats[s]);
 +                }
 +              }
 +
 +              outFile_statsMerged.println(stats_str);
 +
 +              // save feats & stats
 +              // System.out.println(sents_str+" "+feats_str);
 +
 +              feat_hash[i].put(sents_str, feats_str);
 +              stats_hash[i].put(sents_str, stats_str);
 +
 +              featVal_str = feats_str.split("\\s+");
 +
 +              if (feats_str.indexOf('=') != -1) {
 +                for (String featurePair : featVal_str) {
 +                  String[] pair = featurePair.split("=");
 +                  String name = pair[0];
 +                  Double value = Double.parseDouble(pair[1]);
 +                  int featId = Vocabulary.id(name);
 +
 +                  // need to identify newly fired feats here
 +                  // in this case currFeatVal is not given the value
 +                  // of the new feat, since the corresponding weight is
 +                  // initialized as zero anyway
 +                  if (featId > numParams) {
 +                    ++numParams;
-                     lambda.add(new Double(0));
++                    lambda.add(0d);
 +                  }
 +                }
 +              }
 +              existingCandStats.put(sents_str, stats_str);
 +              candCount[i] += 1;
 +
 +              // newCandidatesAdded[iteration] += 1;
 +              // moved to code above detecting new candidates
 +            } else {
 +              if (statsCurrIt_exists)
 +                inFile_statsCurrIt.readLine();
 +              else {
 +                // write SS to outFile_statsCurrIt
 +                stats_str = existingCandStats.get(sents_str);
 +                outFile_statsCurrIt.println(stats_str);
 +              }
 +            }
 +
 +          } // for (n)
 +
 +          // now d = sizeUnknown_currIt[i] - 1
 +
 +          if (statsCurrIt_exists)
 +            inFile_statsCurrIt.readLine();
 +          else
 +            outFile_statsCurrIt.println("||||||");
 +
 +          existingCandStats.clear();
 +          totalCandidateCount += candCount[i];
 +
 +          // output sentence progress
 +          if ((i + 1) % 500 == 0) {
 +            print((i + 1) + "\n" + "            ", 1);
 +          } else if ((i + 1) % 100 == 0) {
 +            print("+", 1);
 +          } else if ((i + 1) % 25 == 0) {
 +            print(".", 1);
 +          }
 +
 +        } // for (i)
 +
 +        inFile_statsMergedKnown.close();
 +        outFile_statsMerged.close();
 +
 +        // for testing
 +        /*
 +         * int total_sent = 0; for( int i=0; i<numSentences; i++ ) {
 +         * System.out.println(feat_hash[i].size()+" "+candCount[i]); total_sent +=
 +         * feat_hash[i].size(); feat_hash[i].clear(); }
 +         * System.out.println("----------------total sent: "+total_sent); total_sent = 0; for( int
 +         * i=0; i<numSentences; i++ ) { System.out.println(stats_hash[i].size()+" "+candCount[i]);
 +         * total_sent += stats_hash[i].size(); stats_hash[i].clear(); }
 +         * System.out.println("*****************total sent: "+total_sent);
 +         */
 +
 +        println("", 1); // finish progress line
 +
 +        for (int it = firstIt; it < iteration; ++it) {
 +          inFile_sents[it].close();
 +          inFile_feats[it].close();
 +          inFile_stats[it].close();
 +        }
 +
 +        inFile_sentsCurrIt.close();
 +        inFile_featsCurrIt.close();
 +        if (statsCurrIt_exists)
 +          inFile_statsCurrIt.close();
 +        else
 +          outFile_statsCurrIt.close();
 +
 +        if (compressFiles == 1 && !statsCurrIt_exists) {
 +          gzipFile(tmpDirPrefix + "temp.stats.it" + iteration);
 +        }
 +
 +        // clear temp files
 +        deleteFile(tmpDirPrefix + "temp.currIt.unknownCands");
 +        deleteFile(tmpDirPrefix + "temp.currIt.unknownIndices");
 +        deleteFile(tmpDirPrefix + "temp.stats.unknown");
 +        deleteFile(tmpDirPrefix + "temp.stats.mergedKnown");
 +
 +        // cleanupMemory();
 +
 +        println("Processed " + totalCandidateCount + " distinct candidates " + "(about "
 +            + totalCandidateCount / numSentences + " per sentence):", 1);
 +        for (int it = firstIt; it <= iteration; ++it) {
 +          println("newCandidatesAdded[it=" + it + "] = " + newCandidatesAdded[it] + " (about "
 +              + newCandidatesAdded[it] / numSentences + " per sentence)", 1);
 +        }
 +
 +        println("", 1);
 +
 +        println("Number of features observed so far: " + numParams);
 +        println("", 1);
 +
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +
 +      // n-best list converges
 +      if (newCandidatesAdded[iteration] == 0) {
 +        if (!oneModificationPerIteration) {
 +          println("No new candidates added in this iteration; exiting AdaGrad.", 1);
 +          println("", 1);
 +          println("---  AdaGrad iteration #" + iteration + " ending @ " + (new Date()) + "  ---", 1);
 +          println("", 1);
 +          deleteFile(tmpDirPrefix + "temp.stats.merged");
 +
 +          if (returnBest) {
 +            // note that bestLambda.size() <= lambda.size()
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              lambda.set(p, bestLambda.get(p));
 +            // and set the rest of lambda to be 0
 +            for (int p = 0; p < lambda.size() - bestLambda.size(); ++p)
-               lambda.set(p + bestLambda.size(), new Double(0));
++              lambda.set(p + bestLambda.size(), 0d);
 +          }
 +
 +          return null; // this means that the old values should be kept by the caller
 +        } else {
 +          println("Note: No new candidates added in this iteration.", 1);
 +        }
 +      }
 +
 +      /************* start optimization **************/
 +
 +      /*
 +       * for( int v=1; v<initialLambda[1].length; v++ ) System.out.print(initialLambda[1][v]+" ");
 +       * System.exit(0);
 +       */
 +
 +      Optimizer.sentNum = numSentences; // total number of training sentences
 +      Optimizer.needShuffle = needShuffle;
 +      Optimizer.adagradIter = adagradIter;
 +      Optimizer.oraSelectMode = oraSelectMode;
 +      Optimizer.predSelectMode = predSelectMode;
 +      Optimizer.needAvg = needAvg;
 +      // Optimizer.sentForScale = sentForScale;
 +      Optimizer.scoreRatio = scoreRatio;
 +      Optimizer.evalMetric = evalMetric;
 +      Optimizer.normalizationOptions = normalizationOptions;
 +      Optimizer.needScale = needScale;
 +      Optimizer.regularization = regularization;
 +      Optimizer.batchSize = batchSize;
 +      Optimizer.eta = eta;
 +      Optimizer.lam = lam;
 +
 +      // if need to use bleu stats history
 +      if (iteration == 1) {
 +        if (evalMetric.get_metricName().equals("BLEU") && usePseudoBleu) {
 +          Optimizer.initBleuHistory(numSentences, evalMetric.get_suffStatsCount());
 +          Optimizer.usePseudoBleu = usePseudoBleu;
 +          Optimizer.R = R;
 +        }
 +        if (evalMetric.get_metricName().equals("TER-BLEU") && usePseudoBleu) {
 +          Optimizer.initBleuHistory(numSentences, evalMetric.get_suffStatsCount() - 2); // Stats
 +                                                                                        // count of
 +                                                                                        // TER=2
 +          Optimizer.usePseudoBleu = usePseudoBleu;
 +          Optimizer.R = R;
 +        }
 +      }
 +
-       Vector<String> output = new Vector<String>();
++      Vector<String> output = new Vector<>();
 +
 +      // note: initialLambda[] has length = numParamsOld
 +      // augmented with new feature weights, initial values are 0
 +      double[] initialLambdaNew = new double[1 + numParams];
 +      System.arraycopy(initialLambda, 1, initialLambdaNew, 1, numParamsOld);
 +
 +      // finalLambda[] has length = numParams (considering new features)
 +      double[] finalLambda = new double[1 + numParams];
 +
 +      Optimizer opt = new Optimizer(output, isOptimizable, initialLambdaNew, feat_hash, stats_hash);
 +      finalLambda = opt.runOptimizer();
 +
 +      if (returnBest) {
 +        double metricScore = opt.getMetricScore();
 +        if (!evalMetric.getToBeMinimized()) {
 +          if (metricScore > prevMetricScore) {
 +            prevMetricScore = metricScore;
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              bestLambda.set(p, finalLambda[p]);
 +            if (1 + numParams > bestLambda.size()) {
 +              for (int p = bestLambda.size(); p <= numParams; ++p)
 +                bestLambda.add(p, finalLambda[p]);
 +            }
 +          }
 +        } else {
 +          if (metricScore < prevMetricScore) {
 +            prevMetricScore = metricScore;
 +            for (int p = 1; p < bestLambda.size(); ++p)
 +              bestLambda.set(p, finalLambda[p]);
 +            if (1 + numParams > bestLambda.size()) {
 +              for (int p = bestLambda.size(); p <= numParams; ++p)
 +                bestLambda.add(p, finalLambda[p]);
 +            }
 +          }
 +        }
 +      }
 +
 +      // System.out.println(finalLambda.length);
 +      // for( int i=0; i<finalLambda.length-1; i++ )
 +      // System.out.println(finalLambda[i+1]);
 +
 +      /************* end optimization **************/
 +
-       for (int i = 0; i < output.size(); i++)
-         println(output.get(i));
++      for (String anOutput : output)
++        println(anOutput);
 +
 +      // check if any parameter has been updated
 +      boolean anyParamChanged = false;
 +      boolean anyParamChangedSignificantly = false;
 +
 +      for (int c = 1; c <= numParams; ++c) {
 +        if (finalLambda[c] != lambda.get(c)) {
 +          anyParamChanged = true;
 +        }
 +        if (Math.abs(finalLambda[c] - lambda.get(c)) > stopSigValue) {
 +          anyParamChangedSignificantly = true;
 +        }
 +      }
 +
 +      // System.arraycopy(finalLambda,1,lambda,1,numParams);
 +
 +      println("---  AdaGrad iteration #" + iteration + " ending @ " + (new Date()) + "  ---", 1);
 +      println("", 1);
 +
 +      if (!anyParamChanged) {
 +        println("No parameter value changed in this iteration; exiting AdaGrad.", 1);
 +        println("", 1);
 +        break; // exit for (iteration) loop preemptively
 +      }
 +
 +      // was an early stopping criterion satisfied?
 +      boolean critSatisfied = false;
 +      if (!anyParamChangedSignificantly && stopSigValue >= 0) {
 +        println("Note: No parameter value changed significantly " + "(i.e. by more than "
 +            + stopSigValue + ") in this iteration.", 1);
 +        critSatisfied = true;
 +      }
 +
 +      if (critSatisfied) {
 +        ++earlyStop;
 +        println("", 1);
 +      } else {
 +        earlyStop = 0;
 +      }
 +
 +      // if min number of iterations executed, investigate if early exit should happen
 +      if (iteration >= minIts && earlyStop >= stopMinIts) {
 +        println("Some early stopping criteria has been observed " + "in " + stopMinIts
 +            + " consecutive iterations; exiting AdaGrad.", 1);
 +        println("", 1);
 +
 +        if (returnBest) {
 +          for (int f = 1; f <= bestLambda.size() - 1; ++f)
 +            lambda.set(f, bestLambda.get(f));
 +        } else {
 +          for (int f = 1; f <= numParams; ++f)
 +            lambda.set(f, finalLambda[f]);
 +        }
 +
 +        break; // exit for (iteration) loop preemptively
 +      }
 +
 +      // if max number of iterations executed, exit
 +      if (iteration >= maxIts) {
 +        println("Maximum number of AdaGrad iterations reached; exiting AdaGrad.", 1);
 +        println("", 1);
 +
 +        if (returnBest) {
 +          for (int f = 1; f <= bestLambda.size() - 1; ++f)
 +            lambda.set(f, bestLambda.get(f));
 +        } else {
 +          for (int f = 1; f <= numParams; ++f)
 +            lambda.set(f, finalLambda[f]);
 +        }
 +
 +        break; // exit for (iteration) loop
 +      }
 +
 +      // use the new wt vector to decode the next iteration
 +      // (interpolation with previous wt vector)
 +      double interCoef = 1.0; // no interpolation for now
 +      for (int i = 1; i <= numParams; i++)
-         lambda.set(i, interCoef * finalLambda[i] + (1 - interCoef) * lambda.get(i).doubleValue());
++        lambda.set(i, interCoef * finalLambda[i] + (1 - interCoef) * lambda.get(i));
 +
 +      println("Next iteration will decode with lambda: " + lambdaToString(lambda), 1);
 +      println("", 1);
 +
 +      // printMemoryUsage();
 +      for (int i = 0; i < numSentences; ++i) {
 +        suffStats_array[i].clear();
 +      }
 +      // cleanupMemory();
 +      // println("",2);
 +
 +      retA[2] = 0; // i.e. this should NOT be the last iteration
 +      done = true;
 +
 +    } // while (!done) // NOTE: this "loop" will only be carried out once
 +
 +    // delete .temp.stats.merged file, since it is not needed in the next
 +    // iteration (it will be recreated from scratch)
 +    deleteFile(tmpDirPrefix + "temp.stats.merged");
 +
 +    retA[0] = FINAL_score;
 +    retA[1] = earlyStop;
 +    return retA;
 +
 +  } // run_single_iteration
 +
 +  private String lambdaToString(ArrayList<Double> lambdaA) {
 +    String retStr = "{";
 +    int featToPrint = numParams > 15 ? 15 : numParams;
 +    // print at most the first 15 features
 +
 +    retStr += "(listing the first " + featToPrint + " lambdas)";
 +    for (int c = 1; c <= featToPrint - 1; ++c) {
-       retStr += "" + String.format("%.4f", lambdaA.get(c).doubleValue()) + ", ";
++      retStr += "" + String.format("%.4f", lambdaA.get(c)) + ", ";
 +    }
-     retStr += "" + String.format("%.4f", lambdaA.get(numParams).doubleValue()) + "}";
++    retStr += "" + String.format("%.4f", lambdaA.get(numParams)) + "}";
 +
 +    return retStr;
 +  }
 +
 +  private String[] run_decoder(int iteration) {
 +    String[] retSA = new String[2];
 +
 +    // retsa saves the output file name(nbest-file)
 +    // and the decoder type
 +
 +    // [0] name of file to be processed
 +    // [1] indicates how the output file was obtained:
 +    // 1: external decoder
 +    // 2: fake decoder
 +    // 3: internal decoder
 +
 +    // use fake decoder
 +    if (fakeFileNameTemplate != null
 +        && fileExists(fakeFileNamePrefix + iteration + fakeFileNameSuffix)) {
 +      String fakeFileName = fakeFileNamePrefix + iteration + fakeFileNameSuffix;
 +      println("Not running decoder; using " + fakeFileName + " instead.", 1);
 +      /*
 +       * if (fakeFileName.endsWith(".gz")) { copyFile(fakeFileName,decoderOutFileName+".gz");
 +       * gunzipFile(decoderOutFileName+".gz"); } else { copyFile(fakeFileName,decoderOutFileName); }
 +       */
 +      retSA[0] = fakeFileName;
 +      retSA[1] = "2";
 +
 +    } else {
 +      println("Running external decoder...", 1);
 +
 +      try {
-         ArrayList<String> cmd = new ArrayList<String>();
++        ArrayList<String> cmd = new ArrayList<>();
 +        cmd.add(decoderCommandFileName);
 +
 +        if (passIterationToDecoder)
 +          cmd.add(Integer.toString(iteration));
 +
 +        ProcessBuilder pb = new ProcessBuilder(cmd);
 +        // this merges the error and output streams of the subprocess
 +        pb.redirectErrorStream(true);
 +        Process p = pb.start();
 +
 +        // capture the sub-command's output
 +        new StreamGobbler(p.getInputStream(), decVerbosity).start();
 +
 +        int decStatus = p.waitFor();
 +        if (decStatus != validDecoderExitValue) {
 +          throw new RuntimeException("Call to decoder returned " + decStatus + "; was expecting "
 +              + validDecoderExitValue + ".");
 +        }
 +      } catch (IOException | InterruptedException e) {
 +        throw new RuntimeException(e);
 +      }
 +
 +      retSA[0] = decoderOutFileName;
 +      retSA[1] = "1";
 +
 +    }
 +
 +    return retSA;
 +  }
 +
 +  private void produceTempFiles(String nbestFileName, int iteration) {
 +    try {
 +      String sentsFileName = tmpDirPrefix + "temp.sents.it" + iteration;
 +      String featsFileName = tmpDirPrefix + "temp.feats.it" + iteration;
 +
 +      FileOutputStream outStream_sents = new FileOutputStream(sentsFileName, false);
 +      OutputStreamWriter outStreamWriter_sents = new OutputStreamWriter(outStream_sents, "utf8");
 +      BufferedWriter outFile_sents = new BufferedWriter(outStreamWriter_sents);
 +
 +      PrintWriter outFile_feats = new PrintWriter(featsFileName);
 +
 +      InputStream inStream_nbest = null;
 +      if (nbestFileName.endsWith(".gz")) {
 +        inStream_nbest = new GZIPInputStream(new FileInputStream(nbestFileName));
 +      } else {
 +        inStream_nbest = new FileInputStream(nbestFileName);
 +      }
 +      BufferedReader inFile_nbest = new BufferedReader(
 +          new InputStreamReader(inStream_nbest, "utf8"));
 +
 +      String line; // , prevLine;
 +      String candidate_str = "";
 +      String feats_str = "";
 +
 +      int i = 0;
 +      int n = 0;
 +      line = inFile_nbest.readLine();
 +
 +      while (line != null) {
 +
 +        /*
 +         * line format:
-          * 
++         *
 +         * i ||| words of candidate translation . ||| feat-1_val feat-2_val ... feat-numParams_val
 +         * .*
 +         */
 +
 +        // in a well formed file, we'd find the nth candidate for the ith sentence
 +
 +        int read_i = Integer.parseInt((line.substring(0, line.indexOf("|||"))).trim());
 +
 +        if (read_i != i) {
 +          writeLine("||||||", outFile_sents);
 +          outFile_feats.println("||||||");
 +          n = 0;
 +          ++i;
 +        }
 +
 +        line = (line.substring(line.indexOf("|||") + 3)).trim(); // get rid of initial text
 +
 +        candidate_str = (line.substring(0, line.indexOf("|||"))).trim();
 +        feats_str = (line.substring(line.indexOf("|||") + 3)).trim();
 +        // get rid of candidate string
 +
 +        int junk_i = feats_str.indexOf("|||");
 +        if (junk_i >= 0) {
 +          feats_str = (feats_str.substring(0, junk_i)).trim();
 +        }
 +
 +        writeLine(normalize(candidate_str, textNormMethod), outFile_sents);
 +        outFile_feats.println(feats_str);
 +
 +        ++n;
 +        if (n == sizeOfNBest) {
 +          writeLine("||||||", outFile_sents);
 +          outFile_feats.println("||||||");
 +          n = 0;
 +          ++i;
 +        }
 +
 +        line = inFile_nbest.readLine();
 +      }
 +
 +      if (i != numSentences) { // last sentence had too few candidates
 +        writeLine("||||||", outFile_sents);
 +        outFile_feats.println("||||||");
 +      }
 +
 +      inFile_nbest.close();
 +      outFile_sents.close();
 +      outFile_feats.close();
 +
 +      if (compressFiles == 1) {
 +        gzipFile(sentsFileName);
 +        gzipFile(featsFileName);
 +      }
 +
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +  }
 +
 +  private void createConfigFile(ArrayList<Double> params, String cfgFileName,
 +      String templateFileName) {
 +    try {
 +      // i.e. create cfgFileName, which is similar to templateFileName, but with
 +      // params[] as parameter values
 +
 +      BufferedReader inFile = new BufferedReader(new FileReader(templateFileName));
 +      PrintWriter outFile = new PrintWriter(cfgFileName);
 +
 +      BufferedReader inFeatDefFile = null;
 +      PrintWriter outFeatDefFile = null;
 +      int origFeatNum = 0; // feat num in the template file
 +
 +      String line = inFile.readLine();
 +      while (line != null) {
 +        int c_match = -1;
 +        for (int c = 1; c <= numParams; ++c) {
 +          if (line.startsWith(Vocabulary.word(c) + " ")) {
 +            c_match = c;
 +            ++origFeatNum;
 +            break;
 +          }
 +        }
 +
 +        if (c_match == -1) {
 +          outFile.println(line);
 +        } else {
-           if (Math.abs(params.get(c_match).doubleValue()) > 1e-20)
++          if (Math.abs(params.get(c_match)) > 1e-20)
 +            outFile.println(Vocabulary.word(c_match) + " " + params.get(c_match));
 +        }
 +
 +        line = inFile.readLine();
 +      }
 +
 +      // now append weights of new features
 +      for (int c = origFeatNum + 1; c <= numParams; ++c) {
-         if (Math.abs(params.get(c).doubleValue()) > 1e-20)
++        if (Math.abs(params.get(c)) > 1e-20)
 +          outFile.println(Vocabulary.word(c) + " " + params.get(c));
 +      }
 +
 +      inFile.close();
 +      outFile.close();
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +  }
 +
 +  private void processParamFile() {
 +    // process parameter file
 +    Scanner inFile_init = null;
 +    try {
 +      inFile_init = new Scanner(new FileReader(paramsFileName));
 +    } catch (FileNotFoundException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    String dummy = "";
 +
 +    // initialize lambda[] and other related arrays
 +    for (int c = 1; c <= numParams; ++c) {
 +      // skip parameter name
 +      while (!dummy.equals("|||")) {
 +        dummy = inFile_init.next();
 +      }
 +
 +      // read default value
 +      lambda.set(c, inFile_init.nextDouble());
-       defaultLambda[c] = lambda.get(c).doubleValue();
++      defaultLambda[c] = lambda.get(c);
 +
 +      // read isOptimizable
 +      dummy = inFile_init.next();
 +      if (dummy.equals("Opt")) {
 +        isOptimizable[c] = true;
 +      } else if (dummy.equals("Fix")) {
 +        isOptimizable[c] = false;
 +      } else {
 +        throw new RuntimeException("Unknown isOptimizable string " + dummy + " (must be either Opt or Fix)");
 +      }
 +
 +      if (!isOptimizable[c]) { // skip next two values
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +      } else {
 +        // the next two values are not used, only to be consistent with ZMERT's params file format
 +        dummy = inFile_init.next();
 +        dummy = inFile_init.next();
 +        // set minRandValue[c] and maxRandValue[c] (range for random values)
 +        dummy = inFile_init.next();
 +        if (dummy.equals("-Inf") || dummy.equals("+Inf")) {
 +          throw new RuntimeException("minRandValue[" + c + "] cannot be -Inf or +Inf!");
 +        } else {
 +          minRandValue[c] = Double.parseDouble(dummy);
 +        }
 +
 +        dummy = inFile_init.next();
 +        if (dummy.equals("-Inf") || dummy.equals("+Inf")) {
 +          throw new RuntimeException("maxRandValue[" + c + "] cannot be -Inf or +Inf!");
 +        } else {
 +          maxRandValue[c] = Double.parseDouble(dummy);
 +        }
 +
 +        // check for illogical values
 +        if (minRandValue[c] > maxRandValue[c]) {
 +          throw new RuntimeException("minRandValue[" + c + "]=" + minRandValue[c] + " > " + maxRandValue[c]
 +              + "=maxRandValue[" + c + "]!");
 +        }
 +
 +        // check for odd values
 +        if (minRandValue[c] == maxRandValue[c]) {
 +          println("Warning: lambda[" + c + "] has " + "minRandValue = maxRandValue = "
 +              + minRandValue[c] + ".", 1);
 +        }
 +      } // if (!isOptimizable[c])
 +
 +      /*
 +       * precision[c] = inFile_init.nextDouble(); if (precision[c] < 0) { println("precision[" + c +
 +       * "]=" + precision[c] + " < 0!  Must be non-negative."); System.exit(21); }
 +       */
 +
 +    }
 +
 +    // set normalizationOptions[]
 +    String origLine = "";
 +    while (origLine != null && origLine.length() == 0) {
 +      origLine = inFile_init.nextLine();
 +    }
 +
 +    // How should a lambda[] vector be normalized (before decoding)?
 +    // nO[0] = 0: no normalization
 +    // nO[0] = 1: scale so that parameter nO[2] has absolute value nO[1]
 +    // nO[0] = 2: scale so that the maximum absolute value is nO[1]
 +    // nO[0] = 3: scale so that the minimum absolute value is nO[1]
 +    // nO[0] = 4: scale so that the L-nO[1] norm equals nO[2]
 +
 +    // normalization = none
 +    // normalization = absval 1 lm
 +    // normalization = maxabsval 1
 +    // normalization = minabsval 1
 +    // normalization = LNorm 2 1
 +
 +    dummy = (origLine.substring(origLine.indexOf("=") + 1)).trim();
 +    String[] dummyA = dummy.split("\\s+");
 +
 +    if (dummyA[0].equals("none")) {
 +      normalizationOptions[0] = 0;
 +    } else if (dummyA[0].equals("absval")) {
 +      normalizationOptions[0] = 1;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      String pName = dummyA[2];
 +      for (int i = 3; i < dummyA.length; ++i) { // in case parameter name has multiple words
 +        pName = pName + " " + dummyA[i];
 +      }
 +      normalizationOptions[2] = Vocabulary.id(pName);
 +
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the absval normalization method must be positive.");
 +      }
 +      if (normalizationOptions[2] == 0) {
 +        throw new RuntimeException("Unrecognized feature name " + normalizationOptions[2]
 +            + " for absval normalization method.");
 +      }
 +    } else if (dummyA[0].equals("maxabsval")) {
 +      normalizationOptions[0] = 2;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the maxabsval normalization method must be positive.");
 +      }
 +    } else if (dummyA[0].equals("minabsval")) {
 +      normalizationOptions[0] = 3;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      if (normalizationOptions[1] <= 0) {
 +        throw new RuntimeException("Value for the minabsval normalization method must be positive.");
 +      }
 +    } else if (dummyA[0].equals("LNorm")) {
 +      normalizationOptions[0] = 4;
 +      normalizationOptions[1] = Double.parseDouble(dummyA[1]);
 +      normalizationOptions[2] = Double.parseDouble(dummyA[2]);
 +      if (normalizationOptions[1] <= 0 || normalizationOptions[2] <= 0) {
 +        throw new RuntimeException("Both values for the LNorm normalization method must be positive.");
 +      }
 +    } else {
 +      throw new RuntimeException("Unrecognized normalization method " + dummyA[0] + "; "
 +          + "must be one of none, absval, maxabsval, and LNorm.");
 +    } // if (dummyA[0])
 +
 +    inFile_init.close();
 +  } // processParamFile()
 +
 +  private void processDocInfo() {
 +    // sets numDocuments and docOfSentence[]
 +    docOfSentence = new int[numSentences];
 +
 +    if (docInfoFileName == null) {
 +      for (int i = 0; i < numSentences; ++i)
 +        docOfSentence[i] = 0;
 +      numDocuments = 1;
 +    } else {
 +
 +      try {
 +
 +        // 4 possible formats:
 +        // 1) List of numbers, one per document, indicating # sentences in each document.
 +        // 2) List of "docName size" pairs, one per document, indicating name of document and #
 +        // sentences.
 +        // 3) List of docName's, one per sentence, indicating which doument each sentence belongs
 +        // to.
 +        // 4) List of docName_number's, one per sentence, indicating which doument each sentence
 +        // belongs to,
 +        // and its order in that document. (can also use '-' instead of '_')
 +
 +        int docInfoSize = countNonEmptyLines(docInfoFileName);
 +
 +        if (docInfoSize < numSentences) { // format #1 or #2
 +          numDocuments = docInfoSize;
 +          int i = 0;
 +
 +          BufferedReader inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          String line = inFile.readLine();
 +          boolean format1 = (!(line.contains(" ")));
 +
 +          for (int doc = 0; doc < numDocuments; ++doc) {
 +
 +            if (doc != 0)
 +              line = inFile.readLine();
 +
 +            int docSize = 0;
 +            if (format1) {
 +              docSize = Integer.parseInt(line);
 +            } else {
 +              docSize = Integer.parseInt(line.split("\\s+")[1]);
 +            }
 +
 +            for (int i2 = 1; i2 <= docSize; ++i2) {
 +              docOfSentence[i] = doc;
 +              ++i;
 +            }
 +
 +          }
 +
 +          // now i == numSentences
 +
 +          inFile.close();
 +
 +        } else if (docInfoSize == numSentences) { // format #3 or #4
 +
 +          boolean format3 = false;
 +
-           HashSet<String> seenStrings = new HashSet<String>();
++          HashSet<String> seenStrings = new HashSet<>();
 +          BufferedReader inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          for (int i = 0; i < numSentences; ++i) {
 +            // set format3 = true if a duplicate is found
 +            String line = inFile.readLine();
 +            if (seenStrings.contains(line))
 +              format3 = true;
 +            seenStrings.add(line);
 +          }
 +
 +          inFile.close();
 +
-           HashSet<String> seenDocNames = new HashSet<String>();
-           HashMap<String, Integer> docOrder = new HashMap<String, Integer>();
++          HashSet<String> seenDocNames = new HashSet<>();
++          HashMap<String, Integer> docOrder = new HashMap<>();
 +          // maps a document name to the order (0-indexed) in which it was seen
 +
 +          inFile = new BufferedReader(new FileReader(docInfoFileName));
 +          for (int i = 0; i < numSentences; ++i) {
 +            String line = inFile.readLine();
 +
 +            String docName = "";
 +            if (format3) {
 +              docName = line;
 +            } else {
 +              int sep_i = Math.max(line.lastIndexOf('_'), line.lastIndexOf('-'));
 +              docName = line.substring(0, sep_i);
 +            }
 +
 +            if (!seenDocNames.contains(docName)) {
 +              seenDocNames.add(docName);
 +              docOrder.put(docName, seenDocNames.size() - 1);
 +            }
 +
 +            int docOrder_i = docOrder.get(docName);
 +
 +            docOfSentence[i] = docOrder_i;
 +
 +          }
 +
 +          inFile.close();
 +
 +          numDocuments = seenDocNames.size();
 +
 +        } else { // badly formatted
 +
 +        }
 +
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +    }
 +
 +  }
 +
 +  private boolean copyFile(String origFileName, String newFileName) {
 +    try {
 +      File inputFile = new File(origFileName);
 +      File outputFile = new File(newFileName);
 +
 +      InputStream in = new FileInputStream(inputFile);
 +      OutputStream out = new FileOutputStream(outputFile);
 +
 +      byte[] buffer = new byte[1024];
 +      int len;
 +      while ((len = in.read(buffer)) > 0) {
 +        out.write(buffer, 0, len);
 +      }
 +      in.close();
 +      out.close();
 +
 +      /*
 +       * InputStream inStream = new FileInputStream(new File(origFileName)); BufferedReader inFile =
 +       * new BufferedReader(new InputStreamReader(inStream, "utf8"));
-        * 
++       *
 +       * FileOutputStream outStream = new FileOutputStream(newFileName, false); OutputStreamWriter
 +       * outStreamWriter = new OutputStreamWriter(outStream, "utf8"); BufferedWriter outFile = new
 +       * BufferedWriter(outStreamWriter);
-        * 
++       *
 +       * String line; while(inFile.ready()) { line = inFile.readLine(); writeLine(line, outFile); }
-        * 
++       *
 +       * inFile.close(); outFile.close();
 +       */
 +      return true;
 +    } catch (IOException e) {
 +      LOG.error(e.getMessage(), e);
 +      return false;
 +    }
 +  }
 +
 +  private void renameFile(String origFileName, String newFileName) {
 +    if (fileExists(origFileName)) {
 +      deleteFile(newFileName);
 +      File oldFile = new File(origFileName);
 +      File newFile = new File(newFileName);
 +      if (!oldFile.renameTo(newFile)) {
 +        println("Warning: attempt to rename " + origFileName + " to " + newFileName
 +            + " was unsuccessful!", 1);
 +      }
 +    } else {
 +      println("Warning: file " + origFileName + " does not exist! (in AdaGradCore.renameFile)", 1);
 +    }
 +  }
 +
 +  private void deleteFile(String fileName) {
 +    if (fileExists(fileName)) {
 +      File fd = new File(fileName);
 +      if (!fd.delete()) {
 +        println("Warning: attempt to delete " + fileName + " was unsuccessful!", 1);
 +      }
 +    }
 +  }
 +
 +  private void writeLine(String line, BufferedWriter writer) throws IOException {
 +    writer.write(line, 0, line.length());
 +    writer.newLine();
 +    writer.flush();
 +  }
 +
 +  // need to re-write to handle different forms of lambda
 +  public void finish() {
 +    if (myDecoder != null) {
 +      myDecoder.cleanUp();
 +    }
 +
 +    // create config file with final values
 +    createConfigFile(lambda, decoderConfigFileName + ".AdaGrad.final", decoderConfigFileName
 +        + ".AdaGrad.orig");
 +
 +    // delete current decoder config file and decoder output
 +    deleteFile(decoderConfigFileName);
 +    deleteFile(decoderOutFileName);
 +
 +    // restore original name for config file (name was changed
 +    // in initialize() so it doesn't get overwritten)
 +    renameFile(decoderConfigFileName + ".AdaGrad.orig", decoderConfigFileName);
 +
 +    if (finalLambdaFileName != null) {
 +      try {
 +        PrintWriter outFile_lambdas = new PrintWriter(finalLambdaFileName);
 +        for (int c = 1; c <= numParams; ++c) {
-           outFile_lambdas.println(Vocabulary.word(c) + " ||| " + lambda.get(c).doubleValue());
++          outFile_lambdas.println(Vocabulary.word(c) + " ||| " + lambda.get(c));
 +        }
 +        outFile_lambdas.close();
 +
 +      } catch (IOException e) {
 +        throw new RuntimeException(e);
 +      }
 +    }
 +
 +  }
 +
 +  private String[] cfgFileToArgsArray(String fileName) {
 +    checkFile(fileName);
 +
-     Vector<String> argsVector = new Vector<String>();
++    Vector<String> argsVector = new Vector<>();
 +
 +    BufferedReader inFile = null;
 +    try {
 +      inFile = new BufferedReader(new FileReader(fileName));
 +      String line, origLine;
 +      do {
 +        line = inFile.readLine();
 +        origLine = line; // for error reporting purposes
 +
 +        if (line != null && line.length() > 0 && line.charAt(0) != '#') {
 +
-           if (line.indexOf("#") != -1) { // discard comment
++          if (line.contains("#")) { // discard comment
 +            line = line.substring(0, line.indexOf("#"));
 +          }
 +
 +          line = line.trim();
 +
 +          // now line should look like "-xxx XXX"
 +
 +          /*
 +           * OBSOLETE MODIFICATION //SPECIAL HANDLING FOR AdaGrad CLASSIFIER PARAMETERS String[]
 +           * paramA = line.split("\\s+");
-            * 
++           *
 +           * if( paramA[0].equals("-classifierParams") ) { String classifierParam = ""; for(int p=1;
 +           * p<=paramA.length-1; p++) classifierParam += paramA[p]+" ";
-            * 
++           *
 +           * if(paramA.length>=2) { String[] tmpParamA = new String[2]; tmpParamA[0] = paramA[0];
 +           * tmpParamA[1] = classifierParam; paramA = tmpParamA; } else {
 +           * println("Malformed line in config file:"); println(origLine); System.exit(70); } }//END
 +           * MODIFICATION
 +           */
 +
 +          // cmu modification(from meteor for zmert)
 +          // Parse args
-           ArrayList<String> argList = new ArrayList<String>();
++          ArrayList<String> argList = new ArrayList<>();
 +          StringBuilder arg = new StringBuilder();
 +          boolean quoted = false;
 +          for (int i = 0; i < line.length(); i++) {
 +            if (Character.isWhitespace(line.charAt(i))) {
 +              if (quoted)
 +                arg.append(line.charAt(i));
 +              else if (arg.length() > 0) {
 +                argList.add(arg.toString());
 +                arg = new StringBuilder();
 +              }
 +            } else if (line.charAt(i) == '\'') {
 +              if (quoted) {
 +                argList.add(arg.toString());
 +                arg = new StringBuilder();
 +              }
 +              quoted = !quoted;
 +            } else
 +              arg.append(line.charAt(i));
 +          }
 +          if (arg.length() > 0)
 +            argList.add(arg.toString());
 +          // Create paramA
 +          String[] paramA = new String[argList.size()];
 +          for (int i = 0; i < paramA.length; paramA[i] = argList.get(i++))
 +            ;
 +          // END CMU MODIFICATION
 +
 +          if (paramA.length == 2 && paramA[0].charAt(0) == '-') {
 +            argsVector.add(paramA[0]);
 +            argsVector.add(paramA[1]);
 +          } else if (paramA.length > 2 && (paramA[0].equals("-m") || paramA[0].equals("-docSet"))) {
 +            // -m (metricName), -docSet are allowed to have extra optinos
-             for (int opt = 0; opt < paramA.length; ++opt) {
-               argsVector.add(paramA[opt]);
-             }
++            Collections.addAll(argsVector, paramA);
 +          } else {
 +            String msg = "Malformed line in config file:" + origLine;
 +            throw new RuntimeException(msg);
 +          }
 +
 +        }
 +      } while (line != null);
 +
 +      inFile.close();
 +    } catch (FileNotFoundException e) {
 +      println("AdaGrad configuration file " + fileName + " was not found!");
 +      throw new RuntimeException(e);
 +    } catch (IOException e) {
 +      throw new RuntimeException(e);
 +    }
 +
 +    String[] argsArray = new String[argsVector.size()];
 +
 +    for (int i = 0; i < argsVector.size(); ++i) {
 +      argsArray[i] = argsVector.elementAt(i);
 +    }
 +
 +    return argsArray;
 +  }
 +
 +  private void processArgsArray(String[] args) {
 +    processArgsArray(args, true);
 +  }
 +
 +  private void processArgsArray(String[] args, boolean firstTime) {
 +    /* set default values */
 +    // Relevant files
 +    dirPrefix = null;
 +    sourceFileName = null;
 +    refFileName = "reference.txt";
 +    refsPerSen = 1;
 +    textNormMethod = 1;
 +    paramsFileName = "params.txt";
 +    docInfoFileName = null;
 +    finalLambdaFileName = null;
 +    // MERT specs
 +    metricName = "BLEU";
 +    metricName_display = metricName;
 +    metricOptions = new String[2];
 +    metricOptions[0] = "4";
 +    metricOptions[1] = "closest";
 +    docSubsetInfo = new int[7];
 +    docSubsetInfo[0] = 0;
 +    maxMERTIterations = 20;
 +    prevMERTIterations = 20;
 +    minMERTIterations = 5;
 +    stopMinIts = 3;
 +    stopSigValue = -1;
 +    //
 +    // /* possibly other early stopping criteria here */
 +    //
 +    numOptThreads = 1;
 +    saveInterFiles = 3;
 +    compressFiles = 0;
 +    oneModificationPerIteration = false;
 +    randInit = false;
 +    seed = System.currentTimeMillis();
 +    // useDisk = 2;
 +    // Decoder specs
 +    decoderCommandFileName = null;
 +    passIterationToDecoder = false;
 +    decoderOutFileName = "output.nbest";
 +    validDecoderExitValue = 0;
 +    decoderConfigFileName = "dec_cfg.txt";
 +    sizeOfNBest = 100;
 +    fakeFileNameTemplate = null;
 +    fakeFileNamePrefix = null;
 +    fakeFileNameSuffix = null;
 +    // Output specs
 +    verbosity = 1;
 +    decVerbosity = 0;
 +
 +    int i = 0;
 +
 +    while (i < args.length) {
 +      String option = args[i];
 +      // Relevant files
 +      if (option.equals("-dir")) {
 +        dirPrefix = args[i + 1];
 +      } else if (option.equals("-s")) {
 +        sourceFileName = args[i + 1];
 +      } else if (option.equals("-r")) {
 +        refFileName = args[i + 1];
 +      } else if (option.equals("-rps")) {
 +        refsPerSen = Integer.parseInt(args[i + 1]);
 +        if (refsPerSen < 1) {
 +          throw new RuntimeException("refsPerSen must be positive.");
 +        }
 +      } else if (option.equals("-txtNrm")) {
 +        textNormMethod = Integer.parseInt(args[i + 1]);
 +        if (textNormMethod < 0 || textNormMethod > 4) {
 +          throw new RuntimeException("textNormMethod should be between 0 and 4");
 +        }
 +      } else if (option.equals("-p")) {
 +        paramsFileName = args[i + 1];
 +      } else if (option.equals("-docInfo")) {
 +        docInfoFileName = args[i + 1];
 +      } else if (option.equals("-fin")) {
 +        finalLambdaFileName = args[i + 1];
 +        // MERT specs
 +      } else if (option.equals("-m")) {
 +        metricName = args[i + 1];
 +        metricName_display = metricName;
 +        if (EvaluationMetric.knownMetricName(metricName)) {
 +          int optionCount = EvaluationMetric.metricOptionCount(metricName);
 +          metricOptions = new String[optionCount];
 +         

<TRUNCATED>


[08/50] [abbrv] incubator-joshua git commit: removed debugging output

Posted by mj...@apache.org.
removed debugging output


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/d6820c6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/d6820c6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/d6820c6f

Branch: refs/heads/7
Commit: d6820c6f3bc41ca87dfff4a8ed18172de4f849e6
Parents: 0e49bc5
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 07:01:17 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 07:01:17 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/phrase/Stacks.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/d6820c6f/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
index c642226..dd56eb0 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
@@ -267,7 +267,7 @@ public class Stacks {
       
       float finalTransitionScore = ComputeNodeResult.computeFinalCost(featureFunctions, tailNodes, 0, sentence.length(), null, sentence);
 
-      System.err.println(String.format("createGoalNode: final score: %f -> %f", score, finalTransitionScore));
+//      System.err.println(String.format("createGoalNode: final score: %f -> %f", score, finalTransitionScore));
       
       if (null == this.end)
         this.end = new Hypothesis(null, score + finalTransitionScore, hyp, sentence.length(), null);


[10/50] [abbrv] incubator-joshua git commit: small cleanup

Posted by mj...@apache.org.
small cleanup


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/25d28fe2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/25d28fe2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/25d28fe2

Branch: refs/heads/7
Commit: 25d28fe2ce32a4b130a4412e982d6e16d5af8afc
Parents: cd3ff0c
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 07:24:58 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 07:24:58 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/phrase/Stacks.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/25d28fe2/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
index dd56eb0..077daff 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
@@ -167,15 +167,13 @@ public class Stacks {
               continue;
             }
 
-            /* We have found a permissible phrase start point and length, that fits with the current
-             * coverage vector. Record that in a Span.
-             */
-            Span span = new Span(begin, begin + phrase_length);
-
             // Don't append </s> until the end
             if (begin == sentence.length() - 1 && source_words != sentence.length()) 
               continue;            
 
+            /* We have found a permissible phrase start point and length for the current coverage
+             * vector. Find all the phrases over that span.
+             */
             TargetPhrases phrases = chart.getRange(begin, begin + phrase_length);
             if (phrases == null)
               continue;


[48/50] [abbrv] incubator-joshua git commit: moved resources files

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kbest_extraction/output.scores.gold
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kbest_extraction/output.scores.gold b/joshua-core/src/test/resources/kbest_extraction/output.scores.gold
new file mode 100644
index 0000000..2f8b814
--- /dev/null
+++ b/joshua-core/src/test/resources/kbest_extraction/output.scores.gold
@@ -0,0 +1,3126 @@
+0 ||| A A A A A ||| -195.045
+0 ||| B A A A A ||| -196.045
+0 ||| C A A A A ||| -198.045
+0 ||| A B A A A ||| -199.045
+0 ||| B B A A A ||| -200.045
+0 ||| D A A A A ||| -200.045
+0 ||| A A A A B ||| -201.045
+0 ||| A A A B A ||| -201.045
+0 ||| A A B A A ||| -201.045
+0 ||| A C A A A ||| -201.045
+0 ||| B A A A B ||| -202.045
+0 ||| B A A B A ||| -202.045
+0 ||| B A B A A ||| -202.045
+0 ||| B C A A A ||| -202.045
+0 ||| C B A A A ||| -202.045
+0 ||| A A A C A ||| -203.045
+0 ||| C A A A B ||| -204.045
+0 ||| C A A B A ||| -204.045
+0 ||| B A A C A ||| -204.045
+0 ||| C A B A A ||| -204.045
+0 ||| E A A A A ||| -204.045
+0 ||| C C A A A ||| -204.045
+0 ||| D B A A A ||| -204.045
+0 ||| A A A A C ||| -205.045
+0 ||| A B A B A ||| -205.045
+0 ||| A B A A B ||| -205.045
+0 ||| A A C A A ||| -205.045
+0 ||| A B B A A ||| -205.045
+0 ||| A D A A A ||| -205.045
+0 ||| B A A A C ||| -206.045
+0 ||| B B A A B ||| -206.045
+0 ||| B B A B A ||| -206.045
+0 ||| D A A A B ||| -206.045
+0 ||| B A C A A ||| -206.045
+0 ||| D A A B A ||| -206.045
+0 ||| B B B A A ||| -206.045
+0 ||| C A A C A ||| -206.045
+0 ||| D A B A A ||| -206.045
+0 ||| B D A A A ||| -206.045
+0 ||| D C A A A ||| -206.045
+0 ||| A A B A B ||| -207.045
+0 ||| A A B B A ||| -207.045
+0 ||| A A A B B ||| -207.045
+0 ||| A B A C A ||| -207.045
+0 ||| A C A A B ||| -207.045
+0 ||| A C A B A ||| -207.045
+0 ||| A C B A A ||| -207.045
+0 ||| A A D A A ||| -207.045
+0 ||| C A A A C ||| -208.045
+0 ||| B A A B B ||| -208.045
+0 ||| C B A B A ||| -208.045
+0 ||| B A B A B ||| -208.045
+0 ||| B C A B A ||| -208.045
+0 ||| B C A A B ||| -208.045
+0 ||| B A B B A ||| -208.045
+0 ||| C B A A B ||| -208.045
+0 ||| D A A C A ||| -208.045
+0 ||| C A C A A ||| -208.045
+0 ||| B B A C A ||| -208.045
+0 ||| E B A A A ||| -208.045
+0 ||| B C B A A ||| -208.045
+0 ||| C B B A A ||| -208.045
+0 ||| C D A A A ||| -208.045
+0 ||| B A D A A ||| -208.045
+0 ||| A B A A C ||| -209.045
+0 ||| A A A C B ||| -209.045
+0 ||| A A B C A ||| -209.045
+0 ||| A B C A A ||| -209.045
+0 ||| A C A C A ||| -209.045
+0 ||| A A A D A ||| -209.045
+0 ||| C A A B B ||| -210.045
+0 ||| D A A A C ||| -210.045
+0 ||| C A B A B ||| -210.045
+0 ||| B A A C B ||| -210.045
+0 ||| C C A A B ||| -210.045
+0 ||| D B A A B ||| -210.045
+0 ||| B B A A C ||| -210.045
+0 ||| E A A A B ||| -210.045
+0 ||| D B A B A ||| -210.045
+0 ||| D A C A A ||| -210.045
+0 ||| E A A B A ||| -210.045
+0 ||| B A A D A ||| -210.045
+0 ||| D D A A A ||| -210.045
+0 ||| B C A C A ||| -210.045
+0 ||| C A D A A ||| -210.045
+0 ||| C A B B A ||| -210.045
+0 ||| E A B A A ||| -210.045
+0 ||| C B A C A ||| -210.045
+0 ||| E C A A A ||| -210.045
+0 ||| C C A B A ||| -210.045
+0 ||| B B C A A ||| -210.045
+0 ||| B A B C A ||| -210.045
+0 ||| C C B A A ||| -210.045
+0 ||| D B B A A ||| -210.045
+0 ||| A B A B B ||| -211.045
+0 ||| A B B B A ||| -211.045
+0 ||| A A A B C ||| -211.045
+0 ||| A D A B A ||| -211.045
+0 ||| A C A A C ||| -211.045
+0 ||| A A C B A ||| -211.045
+0 ||| A A C A B ||| -211.045
+0 ||| A C C A A ||| -211.045
+0 ||| A A B A C ||| -211.045
+0 ||| A B D A A ||| -211.045
+0 ||| A A A A D ||| -211.045
+0 ||| A A E A A ||| -211.045
+0 ||| A B B A B ||| -211.045
+0 ||| A E A A A ||| -211.045
+0 ||| A D A A B ||| -211.045
+0 ||| A D B A A ||| -211.045
+0 ||| B D A A B ||| -212.045
+0 ||| C B A A C ||| -212.045
+0 ||| B B B B A ||| -212.045
+0 ||| B A C A B ||| -212.045
+0 ||| D A A B B ||| -212.045
+0 ||| E A A C A ||| -212.045
+0 ||| B B A B B ||| -212.045
+0 ||| C A A D A ||| -212.045
+0 ||| B A A B C ||| -212.045
+0 ||| D C A B A ||| -212.045
+0 ||| B C A A C ||| -212.045
+0 ||| D B A C A ||| -212.045
+0 ||| B A A A D ||| -212.045
+0 ||| B A C B A ||| -212.045
+0 ||| D C A A B ||| -212.045
+0 ||| D A B B A ||| -212.045
+0 ||| B B B A B ||| -212.045
+0 ||| B D A B A ||| -212.045
+0 ||| C A A C B ||| -212.045
+0 ||| B A E A A ||| -212.045
+0 ||| B A B A C ||| -212.045
+0 ||| C C A C A ||| -212.045
+0 ||| D A B A B ||| -212.045
+0 ||| B C C A A ||| -212.045
+0 ||| C A B C A ||| -212.045
+0 ||| B E A A A ||| -212.045
+0 ||| D A D A A ||| -212.045
+0 ||| C B C A A ||| -212.045
+0 ||| B B D A A ||| -212.045
+0 ||| D C B A A ||| -212.045
+0 ||| B D B A A ||| -212.045
+0 ||| A C B A B ||| -213.045
+0 ||| A A D A B ||| -213.045
+0 ||| A A B B B ||| -213.045
+0 ||| A A A C C ||| -213.045
+0 ||| A B A C B ||| -213.045
+0 ||| A C A B B ||| -213.045
+0 ||| A B B C A ||| -213.045
+0 ||| A A A E A ||| -213.045
+0 ||| A C B B A ||| -213.045
+0 ||| A A D B A ||| -213.045
+0 ||| A B A D A ||| -213.045
+0 ||| A D A C A ||| -213.045
+0 ||| A A C C A ||| -213.045
+0 ||| A C D A A ||| -213.045
+0 ||| B C A B B ||| -214.045
+0 ||| B A B B B ||| -214.045
+0 ||| B C B A B ||| -214.045
+0 ||| C B B A B ||| -214.045
+0 ||| E B A A B ||| -214.045
+0 ||| C A A B C ||| -214.045
+0 ||| D A A C B ||| -214.045
+0 ||| C A C A B ||| -214.045
+0 ||| B B A C B ||| -214.045
+0 ||| C A B A C ||| -214.045
+0 ||| C D A A B ||| -214.045
+0 ||| B A D A B ||| -214.045
+0 ||| C B A B B ||| -214.045
+0 ||| E A A A C ||| -214.045
+0 ||| D B A A C ||| -214.045
+0 ||| C A A A D ||| -214.045
+0 ||| D A B C A ||| -214.045
+0 ||| C C A A C ||| -214.045
+0 ||| B A A C C ||| -214.045
+0 ||| B A D B A ||| -214.045
+0 ||| B A C C A ||| -214.045
+0 ||| B B B C A ||| -214.045
+0 ||| D C A C A ||| -214.045
+0 ||| D A A D A ||| -214.045
+0 ||| B B A D A ||| -214.045
+0 ||| C A C B A ||| -214.045
+0 ||| B A A E A ||| -214.045
+0 ||| C C C A A ||| -214.045
+0 ||| B D A C A ||| -214.045
+0 ||| E B A B A ||| -214.045
+0 ||| E B B A A ||| -214.045
+0 ||| B C B B A ||| -214.045
+0 ||| C B B B A ||| -214.045
+0 ||| C A E A A ||| -214.045
+0 ||| C D A B A ||| -214.045
+0 ||| C D B A A ||| -214.045
+0 ||| B C D A A ||| -214.045
+0 ||| E D A A A ||| -214.045
+0 ||| D B C A A ||| -214.045
+0 ||| C E A A A ||| -214.045
+0 ||| E A C A A ||| -214.045
+0 ||| C B D A A ||| -214.045
+0 ||| A B C A B ||| -215.045
+0 ||| A B B A C ||| -215.045
+0 ||| A D A A C ||| -215.045
+0 ||| A A C A C ||| -215.045
+0 ||| A B A B C ||| -215.045
+0 ||| A A B C B ||| -215.045
+0 ||| A C A C B ||| -215.045
+0 ||| A B A A D ||| -215.045
+0 ||| A A A D B ||| -215.045
+0 ||| A B C B A ||| -215.045
+0 ||| A C A D A ||| -215.045
+0 ||| A A D C A ||| -215.045
+0 ||| A C B C A ||| -215.045
+0 ||| A A B D A ||| -215.045
+0 ||| A B E A A ||| -215.045
+0 ||| A D C A A ||| -215.045
+0 ||| B B C A B ||| -216.045
+0 ||| E C A A B ||| -216.045
+0 ||| C C A B B ||| -216.045
+0 ||| B A B C B ||| -216.045
+0 ||| C C B B A ||| -216.045
+0 ||| C C B A B ||| -216.045
+0 ||| D B B A B ||| -216.045
+0 ||| E A A B B ||| -216.045
+0 ||| D A C B A ||| -216.045
+0 ||| B A C A C ||| -216.045
+0 ||| D A C A B ||| -216.045
+0 ||| D D A B A ||| -216.045
+0 ||| D A B A C ||| -216.045
+0 ||| B D A A C ||| -216.045
+0 ||| C C D A A ||| -216.045
+0 ||| D B A B B ||| -216.045
+0 ||| B A B D A ||| -216.045
+0 ||| B A A D B ||| -216.045
+0 ||| C A D B A ||| -216.045
+0 ||| B B A A D ||| -216.045
+0 ||| E A B B A ||| -216.045
+0 ||| D A A A D ||| -216.045
+0 ||| D C C A A ||| -216.045
+0 ||| D A A B C ||| -216.045
+0 ||| E C A B A ||| -216.045
+0 ||| C A D A B ||| -216.045
+0 ||| B B C B A ||| -216.045
+0 ||| B C A C B ||| -216.045
+0 ||| B D C A A ||| -216.045
+0 ||| C A B B B ||| -216.045
+0 ||| C D A C A ||| -216.045
+0 ||| D D A A B ||| -216.045
+0 ||| D B B B A ||| -216.045
+0 ||| C A A C C ||| -216.045
+0 ||| D D B A A ||| -216.045
+0 ||| B B A B C ||| -216.045
+0 ||| B A D C A ||| -216.045
+0 ||| C B A C B ||| -216.045
+0 ||| C A A E A ||| -216.045
+0 ||| E A B A B ||| -216.045
+0 ||| D B D A A ||| -216.045
+0 ||| D C A A C ||| -216.045
+0 ||| B C A D A ||| -216.045
+0 ||| B B B A C ||| -216.045
+0 ||| D E A A A ||| -216.045
+0 ||| C A C C A ||| -216.045
+0 ||| E A D A A ||| -216.045
+0 ||| C B B C A ||| -216.045
+0 ||| E C B A A ||| -216.045
+0 ||| B C B C A ||| -216.045
+0 ||| B B E A A ||| -216.045
+0 ||| C B A D A ||| -216.045
+0 ||| D A E A A ||| -216.045
+0 ||| E B A C A ||| -216.045
+0 ||| A D B A B ||| -217.045
+0 ||| A A C B B ||| -217.045
+0 ||| A C A B C ||| -217.045
+0 ||| A B B B B ||| -217.045
+0 ||| A B A C C ||| -217.045
+0 ||| A B D A B ||| -217.045
+0 ||| A A E A B ||| -217.045
+0 ||| A C C A B ||| -217.045
+0 ||| A E A A B ||| -217.045
+0 ||| A D A B B ||| -217.045
+0 ||| A A B B C ||| -217.045
+0 ||| A B D B A ||| -217.045
+0 ||| A A D A C ||| -217.045
+0 ||| A C B A C ||| -217.045
+0 ||| A B C C A ||| -217.045
+0 ||| A A A B D ||| -217.045
+0 ||| A C C B A ||| -217.045
+0 ||| A A B A D ||| -217.045
+0 ||| A D D A A ||| -217.045
+0 ||| A C A A D ||| -217.045
+0 ||| A D B B A ||| -217.045
+0 ||| A E A B A ||| -217.045
+0 ||| A C E A A ||| -217.045
+0 ||| A A E B A ||| -217.045
+0 ||| A E B A A ||| -217.045
+0 ||| A B A E A ||| -217.045
+0 ||| B B B B B ||| -218.045
+0 ||| E A A C B ||| -218.045
+0 ||| D C A B B ||| -218.045
+0 ||| B C A B C ||| -218.045
+0 ||| B D A B B ||| -218.045
+0 ||| B E A A B ||| -218.045
+0 ||| D A B B B ||| -218.045
+0 ||| B A E A B ||| -218.045
+0 ||| B A C B B ||| -218.045
+0 ||| B C B A C ||| -218.045
+0 ||| C C A C B ||| -218.045
+0 ||| C A B C B ||| -218.045
+0 ||| C A A D B ||| -218.045
+0 ||| D B A C B ||| -218.045
+0 ||| B C C A B ||| -218.045
+0 ||| B B C C A ||| -218.045
+0 ||| B A B B C ||| -218.045
+0 ||| B B D A B ||| -218.045
+0 ||| C B C A B ||| -218.045
+0 ||| C B E A A ||| -218.045
+0 ||| C B A A D ||| -218.045
+0 ||| D A D A B ||| -218.045
+0 ||| D C B A B ||| -218.045
+0 ||| E A B C A ||| -218.045
+0 ||| B D B A B ||| -218.045
+0 ||| E C A C A ||| -218.045
+0 ||| C B A B C ||| -218.045
+0 ||| B A E B A ||| -218.045
+0 ||| D A A C C ||| -218.045
+0 ||| D A C C A ||| -218.045
+0 ||| C B B A C ||| -218.045
+0 ||| C C B C A ||| -218.045
+0 ||| E B A A C ||| -218.045
+0 ||| C A B D A ||| -218.045
+0 ||| B A D A C ||| -218.045
+0 ||| C A D C A ||| -218.045
+0 ||| B B A C C ||| -218.045
+0 ||| C D C A A ||| -218.045
+0 ||| C A C A C ||| -218.045
+0 ||| D D A C A ||| -218.045
+0 ||| C D A A C ||| -218.045
+0 ||| B B D B A ||| -218.045
+0 ||| B A B A D ||| -218.045
+0 ||| E B C A A ||| -218.045
+0 ||| B C A A D ||| -218.045
+0 ||| D A D B A ||| -218.045
+0 ||| B A A B D ||| -218.045
+0 ||| B E A B A ||| -218.045
+0 ||| D C D A A ||| -218.045
+0 ||| D B B C A ||| -218.045
+0 ||| D B A D A ||| -218.045
+0 ||| E A A D A ||| -218.045
+0 ||| B D D A A ||| -218.045
+0 ||| C B C B A ||| -218.045
+0 ||| B C E A A ||| -218.045
+0 ||| B C C B A ||| -218.045
+0 ||| B E B A A ||| -218.045
+0 ||| C C A D A ||| -218.045
+0 ||| B D B B A ||| -218.045
+0 ||| D A A E A ||| -218.045
+0 ||| D C B B A ||| -218.045
+0 ||| B B A E A ||| -218.045
+0 ||| A B B C B ||| -219.045
+0 ||| A A A C D ||| -219.045
+0 ||| A B A D B ||| -219.045
+0 ||| A A A D C ||| -219.045
+0 ||| A C D A B ||| -219.045
+0 ||| A C A C C ||| -219.045
+0 ||| A A A E B ||| -219.045
+0 ||| A C B B B ||| -219.045
+0 ||| A A D B B ||| -219.045
+0 ||| A A C C B ||| -219.045
+0 ||| A D A C B ||| -219.045
+0 ||| A A B E A ||| -219.045
+0 ||| A A A A E ||| -219.045
+0 ||| A B C A C ||| -219.045
+0 ||| A D B C A ||| -219.045
+0 ||| A A B C C ||| -219.045
+0 ||| A E A C A ||| -219.045
+0 ||| A B D C A ||| -219.045
+0 ||| A C C C A ||| -219.045
+0 ||| A C D B A ||| -219.045
+0 ||| A A C D A ||| -219.045
+0 ||| A D A D A ||| -219.045
+0 ||| A B B D A ||| -219.045
+0 ||| A A E C A ||| -219.045
+0 ||| A C A E A ||| -219.045
+0 ||| E A A B C ||| -220.045
+0 ||| D C A C B ||| -220.045
+0 ||| D A C A C ||| -220.045
+0 ||| B B B C B ||| -220.045
+0 ||| B A C C B ||| -220.045
+0 ||| B A D B B ||| -220.045
+0 ||| B A B C C ||| -220.045
+0 ||| C C B A C ||| -220.045
+0 ||| B A A C D ||| -220.045
+0 ||| D A A D B ||| -220.045
+0 ||| E B B A B ||| -220.045
+0 ||| C C A B C ||| -220.045
+0 ||| B C A C C ||| -220.045
+0 ||| C A B A D ||| -220.045
+0 ||| C A A B D ||| -220.045
+0 ||| C C A A D ||| -220.045
+0 ||| D B B A C ||| -220.045
+0 ||| E C A A C ||| -220.045
+0 ||| B B C A C ||| -220.045
+0 ||| B A A D C ||| -220.045
+0 ||| E A A A D ||| -220.045
+0 ||| B B A D B ||| -220.045
+0 ||| C A D A C ||| -220.045
+0 ||| D A B C B ||| -220.045
+0 ||| D C B C A ||| -220.045
+0 ||| D B A B C ||| -220.045
+0 ||| D B A A D ||| -220.045
+0 ||| E B A B B ||| -220.045
+0 ||| C A C B B ||| -220.045
+0 ||| B A C D A ||| -220.045
+0 ||| B D A C B ||| -220.045
+0 ||| C C C A B ||| -220.045
+0 ||| B A A E B ||| -220.045
+0 ||| B A E C A ||| -220.045
+0 ||| D B C A B ||| -220.045
+0 ||| C A E A B ||| -220.045
+0 ||| B A B E A ||| -220.045
+0 ||| C B B B B ||| -220.045
+0 ||| B C B B B ||| -220.045
+0 ||| C D B B A ||| -220.045
+0 ||| D D A A C ||| -220.045
+0 ||| E D A A B ||| -220.045
+0 ||| B B D C A ||| -220.045
+0 ||| C D A B B ||| -220.045
+0 ||| C A B B C ||| -220.045
+0 ||| B D B C A ||| -220.045
+0 ||| B C D A B ||| -220.045
+0 ||| C D B A B ||| -220.045
+0 ||| D A D C A ||| -220.045
+0 ||| E A B A C ||| -220.045
+0 ||| B A A A E ||| -220.045
+0 ||| D A B D A ||| -220.045
+0 ||| C E A A B ||| -220.045
+0 ||| C B A C C ||| -220.045
+0 ||| B E A C A ||| -220.045
+0 ||| C B D A B ||| -220.045
+0 ||| E A C A B ||| -220.045
+0 ||| C B C C A ||| -220.045
+0 ||| E B D A A ||| -220.045
+0 ||| C A E B A ||| -220.045
+0 ||| E D B A A ||| -220.045
+0 ||| C B A E A ||| -220.045
+0 ||| E E A A A ||| -220.045
+0 ||| B C C C A ||| -220.045
+0 ||| D B E A A ||| -220.045
+0 ||| B B B D A ||| -220.045
+0 ||| C D D A A ||| -220.045
+0 ||| D C A D A ||| -220.045
+0 ||| D D C A A ||| -220.045
+0 ||| C C C B A ||| -220.045
+0 ||| C C E A A ||| -220.045
+0 ||| E B B B A ||| -220.045
+0 ||| C E B A A ||| -220.045
+0 ||| B C D B A ||| -220.045
+0 ||| E C C A A ||| -220.045
+0 ||| C E A B A ||| -220.045
+0 ||| E A E A A ||| -220.045
+0 ||| B C A E A ||| -220.045
+0 ||| D B C B A ||| -220.045
+0 ||| E D A B A ||| -220.045
+0 ||| E A C B A ||| -220.045
+0 ||| C B D B A ||| -220.045
+0 ||| B D A D A ||| -220.045
+0 ||| A E A A C ||| -221.045
+0 ||| A B B A D ||| -221.045
+0 ||| A A B D B ||| -221.045
+0 ||| A B B B C ||| -221.045
+0 ||| A A E A C ||| -221.045
+0 ||| A D B A C ||| -221.045
+0 ||| A A C B C ||| -221.045
+0 ||| A C B C B ||| -221.045
+0 ||| A B D A C ||| -221.045
+0 ||| A D A B C ||| -221.045
+0 ||| A C C A C ||| -221.045
+0 ||| A B E A B ||| -221.045
+0 ||| A A D C B ||| -221.045
+0 ||| A C A D B ||| -221.045
+0 ||| A B C B B ||| -221.045
+0 ||| A A C A D ||| -221.045
+0 ||| A D C A B ||| -221.045
+0 ||| A B A B D ||| -221.045
+0 ||| A D C B A ||| -221.045
+0 ||| A D A A D ||| -221.045
+0 ||| A B E B A ||| -221.045
+0 ||| A C D C A ||| -221.045
+0 ||| A E C A A ||| -221.045
+0 ||| A C B D A ||| -221.045
+0 ||| A D E A A ||| -221.045
+0 ||| A A D D A ||| -221.045
+0 ||| D C B A C ||| -222.045
+0 ||| C C D A B ||| -222.045
+0 ||| B A B D B ||| -222.045
+0 ||| B B C B B ||| -222.045
+0 ||| C A D B B ||| -222.045
+0 ||| E A B B B ||| -222.045
+0 ||| E C A B B ||| -222.045
+0 ||| B D A A D ||| -222.045
+0 ||| D C C A B ||| -222.045
+0 ||| D B D A B ||| -222.045
+0 ||| D D B A B ||| -222.045
+0 ||| D B B B B ||| -222.045
+0 ||| E C B A B ||| -222.045
+0 ||| C A A E B ||| -222.045
+0 ||| B A D C B ||| -222.045
+0 ||| C B B C B ||| -222.045
+0 ||| B B B A D ||| -222.045
+0 ||| B C A D B ||| -222.045
+0 ||| E A D A B ||| -222.045
+0 ||| D E A A B ||| -222.045
+0 ||| C A C C B ||| -222.045
+0 ||| C B A D B ||| -222.045
+0 ||| B B E A B ||| -222.045
+0 ||| B C B C B ||| -222.045
+0 ||| D A E A B ||| -222.045
+0 ||| E B A C B ||| -222.045
+0 ||| D C A B C ||| -222.045
+0 ||| C A B C C ||| -222.045
+0 ||| E A A C C ||| -222.045
+0 ||| B B B B C ||| -222.045
+0 ||| B A E A C ||| -222.045
+0 ||| B D A B C ||| -222.045
+0 ||| C C A C C ||| -222.045
+0 ||| D A B B C ||| -222.045
+0 ||| B E A A C ||| -222.045
+0 ||| B A C B C ||| -222.045
+0 ||| D A D A C ||| -222.045
+0 ||| B D B A C ||| -222.045
+0 ||| C A A D C ||| -222.045
+0 ||| B C C A C ||| -222.045
+0 ||| D B A C C ||| -222.045
+0 ||| C B C A C ||| -222.045
+0 ||| B A C A D ||| -222.045
+0 ||| B B D A C ||| -222.045
+0 ||| D A B A D ||| -222.045
+0 ||| D D A B B ||| -222.045
+0 ||| D A C B B ||| -222.045
+0 ||| B D C A B ||| -222.045
+0 ||| D C A A D ||| -222.045
+0 ||| C C B B B ||| -222.045
+0 ||| D A A B D ||| -222.045
+0 ||| B B A B D ||| -222.045
+0 ||| C A A A E ||| -222.045
+0 ||| C A A C D ||| -222.045
+0 ||| C D A C B ||| -222.045
+0 ||| B A D D A ||| -222.045
+0 ||| C C D B A ||| -222.045
+0 ||| D C C B A ||| -222.045
+0 ||| E A D B A ||| -222.045
+0 ||| B D C B A ||| -222.045
+0 ||| D E A B A ||| -222.045
+0 ||| E C B B A ||| -222.045
+0 ||| B B E B A ||| -222.045
+0 ||| E B A D A ||| -222.045
+0 ||| D A E B A ||| -222.045
+0 ||| C A B E A ||| -222.045
+0 ||| E A A E A ||| -222.045
+0 ||| D B D B A ||| -222.045
+0 ||| C A E C A ||| -222.045
+0 ||| C C A E A ||| -222.045
+0 ||| C B D C A ||| -222.045
+0 ||| B C D C A ||| -222.045
+0 ||| E B B C A ||| -222.045
+0 ||| C D A D A ||| -222.045
+0 ||| D D D A A ||| -222.045
+0 ||| C D B C A ||| -222.045
+0 ||| E C D A A ||| -222.045
+0 ||| E A C C A ||| -222.045
+0 ||| B E C A A ||| -222.045
+0 ||| D B A E A ||| -222.045
+0 ||| D E B A A ||| -222.045
+0 ||| D D B B A ||| -222.045
+0 ||| B D E A A ||| -222.045
+0 ||| E D A C A ||| -222.045
+0 ||| D C E A A ||| -222.045
+0 ||| C E A C A ||| -222.045
+0 ||| B C B D A ||| -222.045
+0 ||| D B C C A ||| -222.045
+0 ||| C B B D A ||| -222.045
+0 ||| C A C D A ||| -222.045
+0 ||| C C C C A ||| -222.045
+0 ||| A C A B D ||| -223.045
+0 ||| A D B B B ||| -223.045
+0 ||| A D D A B ||| -223.045
+0 ||| A B C C B ||| -223.045
+0 ||| A E B B A ||| -223.045
+0 ||| A C C B B ||| -223.045
+0 ||| A A B B D ||| -223.045
+0 ||| A D C C A ||| -223.045
+0 ||| A B D B B ||| -223.045
+0 ||| A A E B B ||| -223.045
+0 ||| A C E B A ||| -223.045
+0 ||| A C E A B ||| -223.045
+0 ||| A E B A B ||| -223.045
+0 ||| A D D B A ||| -223.045
+0 ||| A B A E B ||| -223.045
+0 ||| A B E C A ||| -223.045
+0 ||| A A D A D ||| -223.045
+0 ||| A E D A A ||| -223.045
+0 ||| A B A A E ||| -223.045
+0 ||| A A C E A ||| -223.045
+0 ||| A C B B C ||| -223.045
+0 ||| A B B E A ||| -223.045
+0 ||| A C D A C ||| -223.045
+0 ||| A D A E A ||| -223.045
+0 ||| A B A D C ||| -223.045
+0 ||| A B C D A ||| -223.045
+0 ||| A A A E C ||| -223.045
+0 ||| A B A C D ||| -223.045
+0 ||| A E A B B ||| -223.045
+0 ||| A C B A D ||| -223.045
+0 ||| A A D B C ||| -223.045
+0 ||| A B B C C ||| -223.045
+0 ||| A D A C C ||| -223.045
+0 ||| A A C C C ||| -223.045
+0 ||| B B B C C ||| -224.045
+0 ||| D A C C B ||| -224.045
+0 ||| D C B B B ||| -224.045
+0 ||| B A E B B ||| -224.045
+0 ||| E A C A C ||| -224.045
+0 ||| D C D B A ||| -224.045
+0 ||| E C A C B ||| -224.045
+0 ||| D D A C B ||| -224.045
+0 ||| C C D C A ||| -224.045
+0 ||| B B C C B ||| -224.045
+0 ||| D A A E B ||| -224.045
+0 ||| E B C B A ||| -224.045
+0 ||| C D C A B ||| -224.045
+0 ||| B C A B D ||| -224.045
+0 ||| C C B D A ||| -224.045
+0 ||| C A D C B ||| -224.045
+0 ||| B C B A D ||| -224.045
+0 ||| C D C B A ||| -224.045
+0 ||| C B E A B ||| -224.045
+0 ||| C A B D B ||| -224.045
+0 ||| B B E C A ||| -224.045
+0 ||| C C B C B ||| -224.045
+0 ||| D C A C C ||| -224.045
+0 ||| C B E B A ||| -224.045
+0 ||| B D B B B ||| -224.045
+0 ||| E B C A B ||| -224.045
+0 ||| E A D C A ||| -224.045
+0 ||| D B B C B ||| -224.045
+0 ||| B A B B D ||| -224.045
+0 ||| B B C D A ||| -224.045
+0 ||| B B D B B ||| -224.045
+0 ||| D A D B B ||| -224.045
+0 ||| D C C C A ||| -224.045
+0 ||| D C D A B ||| -224.045
+0 ||| B E A B B ||| -224.045
+0 ||| E C B C A ||| -224.045
+0 ||| C C A D B ||| -224.045
+0 ||| B D D A B ||| -224.045
+0 ||| D A C D A ||| -224.045
+0 ||| E A A D B ||| -224.045
+0 ||| D B A D B ||| -224.045
+0 ||| E C A D A ||| -224.045
+0 ||| B E B A B ||| -224.045
+0 ||| C B C B B ||| -224.045
+0 ||| E A B D A ||| -224.045
+0 ||| B C E A B ||| -224.045
+0 ||| D E A C A ||| -224.045
+0 ||| E A B C B ||| -224.045
+0 ||| B D D B A ||| -224.045
+0 ||| B B A E B ||| -224.045
+0 ||| B D C C A ||| -224.045
+0 ||| B B A C D ||| -224.045
+0 ||| B B B E A ||| -224.045
+0 ||| B C C B B ||| -224.045
+0 ||| B D A E A ||| -224.045
+0 ||| C B A B D ||| -224.045
+0 ||| D A E C A ||| -224.045
+0 ||| C A C A D ||| -224.045
+0 ||| D B D C A ||| -224.045
+0 ||| E B B A C ||| -224.045
+0 ||| B C E B A ||| -224.045
+0 ||| D A A C D ||| -224.045
+0 ||| C D E A A ||| -224.045
+0 ||| B A D A D ||| -224.045
+0 ||| D B B D A ||| -224.045
+0 ||| B A C C C ||| -224.045
+0 ||| E D C A A ||| -224.045
+0 ||| D A A D C ||| -224.045
+0 ||| D D A D A ||| -224.045
+0 ||| C B B A D ||| -224.045
+0 ||| C E C A A ||| -224.045
+0 ||| B A D B C ||| -224.045
+0 ||| D A B E A ||| -224.045
+0 ||| E B A A D ||| -224.045
+0 ||| E B E A A ||| -224.045
+0 ||| B B A D C ||| -224.045
+0 ||| D C A E A ||| -224.045
+0 ||| E B A B C ||| -224.045
+0 ||| B E D A A ||| -224.045
+0 ||| B D A C C ||| -224.045
+0 ||| B E B B A ||| -224.045
+0 ||| D A B C C ||| -224.045
+0 ||| B A C E A ||| -224.045
+0 ||| C D A B C ||| -224.045
+0 ||| D D B C A ||| -224.045
+0 ||| C A C B C ||| -224.045
+0 ||| C A D D A ||| -224.045
+0 ||| C E A A C ||| -224.045
+0 ||| D A A A E ||| -224.045
+0 ||| C B B B C ||| -224.045
+0 ||| B A A E C ||| -224.045
+0 ||| C D A A D ||| -224.045
+0 ||| C C C A C ||| -224.045
+0 ||| E D A A C ||| -224.045
+0 ||| C A E A C ||| -224.045
+0 ||| D B C A C ||| -224.045
+0 ||| B C B B C ||| -224.045
+0 ||| B B A A E ||| -224.045
+0 ||| B C D A C ||| -224.045
+0 ||| C D B A C ||| -224.045
+0 ||| C B D A C ||| -224.045
+0 ||| A C D B B ||| -225.045
+0 ||| A A B C D ||| -225.045
+0 ||| A C C C B ||| -225.045
+0 ||| A A C D B ||| -225.045
+0 ||| A D A D B ||| -225.045
+0 ||| A E A C B ||| -225.045
+0 ||| A B D C B ||| -225.045
+0 ||| A B B D B ||| -225.045
+0 ||| A A E D A ||| -225.045
+0 ||| A A E C B ||| -225.045
+0 ||| A C A E B ||| -225.045
+0 ||| A A B A E ||| -225.045
+0 ||| A C E C A ||| -225.045
+0 ||| A A A D D ||| -225.045
+0 ||| A D D C A ||| -225.045
+0 ||| A A B E B ||| -225.045
+0 ||| A A D E A ||| -225.045
+0 ||| A C A C D ||| -225.045
+0 ||| A C C D A ||| -225.045
+0 ||| A B C A D ||| -225.045
+0 ||| A D B D A ||| -225.045
+0 ||| A D B C B ||| -225.045
+0 ||| A E A D A ||| -225.045
+0 ||| A C A A E ||| -225.045
+0 ||| A C B E A ||| -225.045
+0 ||| A D C A C ||| -225.045
+0 ||| A B D D A ||| -225.045
+0 ||| A A A B E ||| -225.045
+0 ||| A E B C A ||| -225.045
+0 ||| A A B D C ||| -225.045
+0 ||| A C A D C ||| -225.045
+0 ||| A C B C C ||| -225.045
+0 ||| A A D C C ||| -225.045
+0 ||| A B E A C ||| -225.045
+0 ||| A B C B C ||| -225.045
+0 ||| C C E A B ||| -226.045
+0 ||| B B C B C ||| -226.045
+0 ||| B A B D C ||| -226.045
+0 ||| C C D A C ||| -226.045
+0 ||| D C C A C ||| -226.045
+0 ||| C B B C C ||| -226.045
+0 ||| E A B B C ||| -226.045
+0 ||| E C A B C ||| -226.045
+0 ||| B C C C B ||| -226.045
+0 ||| B A D C C ||| -226.045
+0 ||| C B A D C ||| -226.045
+0 ||| D B D A C ||| -226.045
+0 ||| D D B A C ||| -226.045
+0 ||| D B B B C ||| -226.045
+0 ||| C A A E C ||| -226.045
+0 ||| E C B A C ||| -226.045
+0 ||| C D A C C ||| -226.045
+0 ||| C A C C C ||| -226.045
+0 ||| B C A D C ||| -226.045
+0 ||| E E A A B ||| -226.045
+0 ||| C B A E B ||| -226.045
+0 ||| D E A A C ||| -226.045
+0 ||| E A D A C ||| -226.045
+0 ||| C B C C B ||| -226.045
+0 ||| E B D A B ||| -226.045
+0 ||| B B E A C ||| -226.045
+0 ||| D B E A B ||| -226.045
+0 ||| C D D A B ||| -226.045
+0 ||| B C B C C ||| -226.045
+0 ||| C A E B B ||| -226.045
+0 ||| B B B D B ||| -226.045
+0 ||| C C C B B ||| -226.045
+0 ||| D A C A D ||| -226.045
+0 ||| D A E A C ||| -226.045
+0 ||| C B A A E ||| -226.045
+0 ||| C A D B C ||| -226.045
+0 ||| E D B A B ||| -226.045
+0 ||| E B A C C ||| -226.045
+0 ||| D C D C A ||| -226.045
+0 ||| D D C A B ||| -226.045
+0 ||| B A A B E ||| -226.045
+0 ||| E A A B D ||| -226.045
+0 ||| E B A E A ||| -226.045
+0 ||| D C A D B ||| -226.045
+0 ||| D A D D A ||| -226.045
+0 ||| C C A B D ||| -226.045
+0 ||| E D B B A ||| -226.045
+0 ||| B A C D B ||| -226.045
+0 ||| B C E C A ||| -226.045
+0 ||| B A B C D ||| -226.045
+0 ||| C D A E A ||| -226.045
+0 ||| C C B A D ||| -226.045
+0 ||| B A D E A ||| -226.045
+0 ||| B B C A D ||| -226.045
+0 ||| C E B B A ||| -226.045
+0 ||| B C A C D ||| -226.045
+0 ||| C A C E A ||| -226.045
+0 ||| E C A A D ||| -226.045
+0 ||| C D C C A ||| -226.045
+0 ||| D B B A D ||| -226.045
+0 ||| E B D B A ||| -226.045
+0 ||| B A E C B ||| -226.045
+0 ||| E B C C A ||| -226.045
+0 ||| C A D A D ||| -226.045
+0 ||| C B E C A ||| -226.045
+0 ||| B A B E B ||| -226.045
+0 ||| E E A B A ||| -226.045
+0 ||| B C D B B ||| -226.045
+0 ||| D B E B A ||| -226.045
+0 ||| B D B C B ||| -226.045
+0 ||| D D C B A ||| -226.045
+0 ||| C D B B B ||| -226.045
+0 ||| C D D B A ||| -226.045
+0 ||| B B D C B ||| -226.045
+0 ||| C C E B A ||| -226.045
+0 ||| B E A C B ||| -226.045
+0 ||| E C C B A ||| -226.045
+0 ||| D A B D B ||| -226.045
+0 ||| B E B C A ||| -226.045
+0 ||| C E B A B ||| -226.045
+0 ||| B D D C A ||| -226.045
+0 ||| D B A B D ||| -226.045
+0 ||| D E C A A ||| -226.045
+0 ||| E B B B B ||| -226.045
+0 ||| B E A D A ||| -226.045
+0 ||| B C A A E ||| -226.045
+0 ||| D D E A A ||| -226.045
+0 ||| E A C B B ||| -226.045
+0 ||| C B B E A ||| -226.045
+0 ||| C E A B B ||| -226.045
+0 ||| E C E A A ||| -226.045
+0 ||| B A B A E ||| -226.045
+0 ||| B B D D A ||| -226.045
+0 ||| E C C A B ||| -226.045
+0 ||| C E D A A ||| -226.045
+0 ||| E D A B B ||| -226.045
+0 ||| C B C D A ||| -226.045
+0 ||| B A A D D ||| -226.045
+0 ||| E E B A A ||| -226.045
+0 ||| E A E A B ||| -226.045
+0 ||| B A E D A ||| -226.045
+0 ||| D B C B B ||| -226.045
+0 ||| E D D A A ||| -226.045
+0 ||| B C A E B ||| -226.045
+0 ||| B C C D A ||| -226.045
+0 ||| B D A D B ||| -226.045
+0 ||| D C B D A ||| -226.045
+0 ||| C B D B B ||| -226.045
+0 ||| B D B D A ||| -226.045
+0 ||| D C B C B ||| -226.045
+0 ||| B C B E A ||| -226.045
+0 ||| D D A A D ||| -226.045
+0 ||| E A E B A ||| -226.045
+0 ||| C A B B D ||| -226.045
+0 ||| E A B A D ||| -226.045
+0 ||| B D C A C ||| -226.045
+0 ||| D A D C B ||| -226.045
+0 ||| D A C B C ||| -226.045
+0 ||| D D A B C ||| -226.045
+0 ||| C C B B C ||| -226.045
+0 ||| C B A C D ||| -226.045
+0 ||| A C E A C ||| -227.045
+0 ||| A B D B C ||| -227.045
+0 ||| A E B A C ||| -227.045
+0 ||| A A E B C ||| -227.045
+0 ||| A D D A C ||| -227.045
+0 ||| A B C C C ||| -227.045
+0 ||| A E C A B ||| -227.045
+0 ||| A A D D B ||| -227.045
+0 ||| A D E A B ||| -227.045
+0 ||| A D B B C ||| -227.045
+0 ||| A C D C B ||| -227.045
+0 ||| A B E B B ||| -227.045
+0 ||| A D E B A ||| -227.045
+0 ||| A D C B B ||| -227.045
+0 ||| A B C E A ||| -227.045
+0 ||| A B A E C ||| -227.045
+0 ||| A E C B A ||| -227.045
+0 ||| A A A C E ||| -227.045
+0 ||| A E E A A ||| -227.045
+0 ||| A A C B D ||| -227.045
+0 ||| A C D D A ||| -227.045
+0 ||| A D B A D ||| -227.045
+0 ||| A E A A D ||| -227.045
+0 ||| A C C B C ||| -227.045
+0 ||| A A E A D ||| -227.045
+0 ||| A B B B D ||| -227.045
+0 ||| A D A B D ||| -227.045
+0 ||| A B D A D ||| -227.045
+0 ||| A C C A D ||| -227.045
+0 ||| A E A B C ||| -227.045
+0 ||| A C B D B ||| -227.045
+0 ||| E C B B B ||| -228.045
+0 ||| E C D A B ||| -228.045
+0 ||| B B E B B ||| -228.045
+0 ||| C A B E B ||| -228.045
+0 ||| E B A D B ||| -228.045
+0 ||| D A E B B ||| -228.045
+0 ||| C B D C B ||| -228.045
+0 ||| E A A E B ||| -228.045
+0 ||| D B D B B ||| -228.045
+0 ||| C D B C B ||| -228.045
+0 ||| C A E C B ||| -228.045
+0 ||| C C A E B ||| -228.045
+0 ||| B C D C B ||| -228.045
+0 ||| D D D A B ||| -228.045
+0 ||| E B B C B ||| -228.045
+0 ||| C D A D B ||| -228.045
+0 ||| B E C A B ||| -228.045
+0 ||| B D E A B ||| -228.045
+0 ||| E A C C B ||| -228.045
+0 ||| D B A E B ||| -228.045
+0 ||| D E B A B ||| -228.045
+0 ||| D D B B B ||| -228.045
+0 ||| B C B D B ||| -228.045
+0 ||| C E A C B ||| -228.045
+0 ||| E D A C B ||| -228.045
+0 ||| D C E A B ||| -228.045
+0 ||| D B C C B ||| -228.045
+0 ||| C A C D B ||| -228.045
+0 ||| D C B A D ||| -228.045
+0 ||| C B B D B ||| -228.045
+0 ||| C C C C B ||| -228.045
+0 ||| D C B B C ||| -228.045
+0 ||| D A C C C ||| -228.045
+0 ||| D C D A C ||| -228.045
+0 ||| C B C B C ||| -228.045
+0 ||| E A A D C ||| -228.045
+0 ||| B A D D B ||| -228.045
+0 ||| D C C B B ||| -228.045
+0 ||| C C D B B ||| -228.045
+0 ||| B D C B B ||| -228.045
+0 ||| B E B A C ||| -228.045
+0 ||| C B C A D ||| -228.045
+0 ||| B D A B D ||| -228.045
+0 ||| E A A C D ||| -228.045
+0 ||| C A B C D ||| -228.045
+0 ||| E C A C C ||| -228.045
+0 ||| D C A B D ||| -228.045
+0 ||| B B C C C ||| -228.045
+0 ||| B A E A D ||| -228.045
+0 ||| D D A C C ||| -228.045
+0 ||| B B B B D ||| -228.045
+0 ||| C D C A C ||| -228.045
+0 ||| D A A E C ||| -228.045
+0 ||| E A D B B ||| -228.045
+0 ||| D B A C D ||| -228.045
+0 ||| B A C B D ||| -228.045
+0 ||| C B E A C ||| -228.045
+0 ||| B D B B C ||| -228.045
+0 ||| D B B C C ||| -228.045
+0 ||| B E A A D ||| -228.045
+0 ||| D A B B D ||| -228.045
+0 ||| D B A D C ||| -228.045
+0 ||| E B C A C ||| -228.045
+0 ||| D E A B B ||| -228.045
+0 ||| B A E B C ||| -228.045
+0 ||| B C C A D ||| -228.045
+0 ||| C C A C D ||| -228.045
+0 ||| C C B C C ||| -228.045
+0 ||| D A D A D ||| -228.045
+0 ||| B B D B C ||| -228.045
+0 ||| E D B C A ||| -228.045
+0 ||| B D D A C ||| -228.045
+0 ||| B E A B C ||| -228.045
+0 ||| C A A D D ||| -228.045
+0 ||| C C A D C ||| -228.045
+0 ||| B D B A D ||| -228.045
+0 ||| B E C B A ||| -228.045
+0 ||| E A B C C ||| -228.045
+0 ||| D D D B A ||| -228.045
+0 ||| B C E A C ||| -228.045
+0 ||| C C E C A ||| -228.045
+0 ||| B B A E C ||| -228.045
+0 ||| D E B B A ||| -228.045
+0 ||| B C C B C ||| -228.045
+0 ||| E A B E A ||| -228.045
+0 ||| B A A C E ||| -228.045
+0 ||| E B B D A ||| -228.045
+0 ||| C A A B E ||| -228.045
+0 ||| D E D A A ||| -228.045
+0 ||| C A B A E ||| -228.045
+0 ||| E C A E A ||| -228.045
+0 ||| C C A A E ||| -228.045
+0 ||| E C D B A ||| -228.045
+0 ||| E A A A E ||| -228.045
+0 ||| B E E A A ||| -228.045
+0 ||| D B A A E ||| -228.045
+0 ||| C C B E A ||| -228.045
+0 ||| C A B D C ||| -228.045
+0 ||| C E B C A ||| -228.045
+0 ||| D A D B C ||| -228.045
+0 ||| D A C E A ||| -228.045
+0 ||| B B D A D ||| -228.045
+0 ||| B B C E A ||| -228.045
+0 ||| C A D C C ||| -228.045
+0 ||| E A E C A ||| -228.045
+0 ||| D B E C A ||| -228.045
+0 ||| B D E B A ||| -228.045
+0 ||| E B D C A ||| -228.045
+0 ||| C A E D A ||| -228.045
+0 ||| C D D C A ||| -228.045
+0 ||| E E A C A ||| -228.045
+0 ||| D D C C A ||| -228.045
+0 ||| D B B E A ||| -228.045
+0 ||| C A D E A ||| -228.045
+0 ||| C B D D A ||| -228.045
+0 ||| E C C C A ||| -228.045
+0 ||| C C C D A ||| -228.045
+0 ||| E A C D A ||| -228.045
+0 ||| C D B D A ||| -228.045
+0 ||| D D A E A ||| -228.045
+0 ||| B C D D A ||| -228.045
+0 ||| D B C D A ||| -228.045
+0 ||| D C E B A ||| -228.045
+0 ||| E D A D A ||| -228.045
+0 ||| C E A D A ||| -228.045
+0 ||| A B E C B ||| -229.045
+0 ||| A A C E B ||| -229.045
+0 ||| A D A E B ||| -229.045
+0 ||| A C B B D ||| -229.045
+0 ||| A C D B C ||| -229.045
+0 ||| A D C C B ||| -229.045
+0 ||| A C C C C ||| -229.045
+0 ||| A A C C D ||| -229.045
+0 ||| A D D B B ||| -229.045
+0 ||| A D A C D ||| -229.045
+0 ||| A B B C D ||| -229.045
+0 ||| A C E B B ||| -229.045
+0 ||| A A C D C ||| -229.045
+0 ||| A B B E B ||| -229.045
+0 ||| A D A D C ||| -229.045
+0 ||| A E A C C ||| -229.045
+0 ||| A B D C C ||| -229.045
+0 ||| A A B E C ||| -229.045
+0 ||| A C D A D ||| -229.045
+0 ||| A A E C C ||| -229.045
+0 ||| A E B B B ||| -229.045
+0 ||| A E D A B ||| -229.045
+0 ||| A B D E A ||| -229.045
+0 ||| A C A E C ||| -229.045
+0 ||| A B A B E ||| -229.045
+0 ||| A D E C A ||| -229.045
+0 ||| A A C A E ||| -229.045
+0 ||| A D B C C ||| -229.045
+0 ||| A C C E A ||| -229.045
+0 ||| A A D B D ||| -229.045
+0 ||| A B B D C ||| -229.045
+0 ||| A A E E A ||| -229.045
+0 ||| A B B A E ||| -229.045
+0 ||| A D A A E ||| -229.045
+0 ||| A D B E A ||| -229.045
+0 ||| A B A D D ||| -229.045
+0 ||| A A A E D ||| -229.045
+0 ||| A B E D A ||| -229.045
+0 ||| A B C D B ||| -229.045
+0 ||| A E C C A ||| -229.045
+0 ||| A E A E A ||| -229.045
+0 ||| A D C D A ||| -229.045
+0 ||| A E D B A ||| -229.045
+0 ||| B A C A E ||| -230.045
+0 ||| E E A A C ||| -230.045
+0 ||| D C D B B ||| -230.045
+0 ||| E B C B B ||| -230.045
+0 ||| C C D C B ||| -230.045
+0 ||| D C C C B ||| -230.045
+0 ||| B B B C D ||| -230.045
+0 ||| C C E A C ||| -230.045
+0 ||| B B C D B ||| -230.045
+0 ||| B C C C C ||| -230.045
+0 ||| C D C B B ||| -230.045
+0 ||| E A D C B ||| -230.045
+0 ||| C B E B B ||| -230.045
+0 ||| B B E C B ||| -230.045
+0 ||| B D C C B ||| -230.045
+0 ||| E C A D B ||| -230.045
+0 ||| C E C A B ||| -230.045
+0 ||| E C B C B ||| -230.045
+0 ||| B D D B B ||| -230.045
+0 ||| D E A C B ||| -230.045
+0 ||| E A B D B ||| -230.045
+0 ||| D B D C B ||| -230.045
+0 ||| B B B E B ||| -230.045
+0 ||| D D A D B ||| -230.045
+0 ||| D A E C B ||| -230.045
+0 ||| B D A E B ||| -230.045
+0 ||| E D C A B ||| -230.045
+0 ||| B C E B B ||| -230.045
+0 ||| D B B D B ||| -230.045
+0 ||| C D E A B ||| -230.045
+0 ||| C A E B C ||| -230.045
+0 ||| D C A E B ||| -230.045
+0 ||| C D B A D ||| -230.045
+0 ||| B B B D C ||| -230.045
+0 ||| D D B C B ||| -230.045
+0 ||| B E D A B ||| -230.045
+0 ||| B A C E B ||| -230.045
+0 ||| D A B E B ||| -230.045
+0 ||| C B D A D ||| -230.045
+0 ||| B E B B B ||| -230.045
+0 ||| C B A E C ||| -230.045
+0 ||| C D D A C ||| -230.045
+0 ||| C B C C C ||| -230.045
+0 ||| D B E A C ||| -230.045
+0 ||| E B D A C ||| -230.045
+0 ||| C C C B C ||| -230.045
+0 ||| D D C A C ||| -230.045
+0 ||| C D B B C ||| -230.045
+0 ||| D C A C D ||| -230.045
+0 ||| B E A C C ||| -230.045
+0 ||| C E B A C ||| -230.045
+0 ||| B B B A E ||| -230.045
+0 ||| C B D B C ||| -230.045
+0 ||| E D B A C ||| -230.045
+0 ||| D A C D B ||| -230.045
+0 ||| C C B D B ||| -230.045
+0 ||| B D A A E ||| -230.045
+0 ||| E B E A B ||| -230.045
+0 ||| C A A C E ||| -230.045
+0 ||| D C A D C ||| -230.045
+0 ||| B A C C D ||| -230.045
+0 ||| B C D A D ||| -230.045
+0 ||| D A A D D ||| -230.045
+0 ||| C A D D B ||| -230.045
+0 ||| E B B A D ||| -230.045
+0 ||| E D E A A ||| -230.045
+0 ||| D A B D C ||| -230.045
+0 ||| B A C D C ||| -230.045
+0 ||| C A C B D ||| -230.045
+0 ||| B E C C A ||| -230.045
+0 ||| B A D B D ||| -230.045
+0 ||| B A E C C ||| -230.045
+0 ||| C D A B D ||| -230.045
+0 ||| C B C E A ||| -230.045
+0 ||| B C D B C ||| -230.045
+0 ||| B A B E C ||| -230.045
+0 ||| B B D C C ||| -230.045
+0 ||| C D E B A ||| -230.045
+0 ||| D A B C D ||| -230.045
+0 ||| E B A B D ||| -230.045
+0 ||| B B A D D ||| -230.045
+0 ||| C E E A A ||| -230.045
+0 ||| B D A C D ||| -230.045
+0 ||| B D B C C ||| -230.045
+0 ||| C E C B A ||| -230.045
+0 ||| E B B B C ||| -230.045
+0 ||| C C C A D ||| -230.045
+0 ||| D A D E A ||| -230.045
+0 ||| C E A A D ||| -230.045
+0 ||| E D A B C ||| -230.045
+0 ||| D E B C A ||| -230.045
+0 ||| B D A D C ||| -230.045
+0 ||| E C C A C ||| -230.045
+0 ||| E E C A A ||| -230.045
+0 ||| E A C B C ||| -230.045
+0 ||| D C A A E ||| -230.045
+0 ||| D D D C A ||| -230.045
+0 ||| C E A B C ||| -230.045
+0 ||| B C A E C ||| -230.045
+0 ||| E D C B A ||| -230.045
+0 ||| C B B B D ||| -230.045
+0 ||| E A C A D ||| -230.045
+0 ||| B D C D A ||| -230.045
+0 ||| D B C B C ||| -230.045
+0 ||| B A A E D ||| -230.045
+0 ||| C C D D A ||| -230.045
+0 ||| E A E A C ||| -230.045
+0 ||| B C B B D ||| -230.045
+0 ||| E C D C A ||| -230.045
+0 ||| D A D C C ||| -230.045
+0 ||| C A E A D ||| -230.045
+0 ||| B B E D A ||| -230.045
+0 ||| E D A A D ||| -230.045
+0 ||| B B A B E ||| -230.045
+0 ||| E C B D A ||| -230.045
+0 ||| D B C A D ||| -230.045
+0 ||| D A B A E ||| -230.045
+0 ||| E B E B A ||| -230.045
+0 ||| D A A B E ||| -230.045
+0 ||| D C B C C ||| -230.045
+0 ||| D B D D A ||| -230.045
+0 ||| D C E C A ||| -230.045
+0 ||| B D E C A ||| -230.045
+0 ||| D E A D A ||| -230.045
+0 ||| D C C D A ||| -230.045
+0 ||| D D B D A ||| -230.045
+0 ||| D A E D A ||| -230.045
+0 ||| B B D E A ||| -230.045
+0 ||| B E A E A ||| -230.045
+0 ||| E A D D A ||| -230.045
+0 ||| B D B E A ||| -230.045
+0 ||| B A E E A ||| -230.045
+0 ||| D C B E A ||| -230.045
+0 ||| B E D B A ||| -230.045
+0 ||| B C C E A ||| -230.045
+0 ||| A D E A C ||| -231.045
+0 ||| A A D D C ||| -231.045
+0 ||| A E C A C ||| -231.045
+0 ||| A A B B E ||| -231.045
+0 ||| A C A B E ||| -231.045
+0 ||| A C B E B ||| -231.045
+0 ||| A B C B D ||| -231.045
+0 ||| A A D A E ||| -231.045
+0 ||| A D C B C ||| -231.045
+0 ||| A A D C D ||| -231.045
+0 ||| A B E B C ||| -231.045
+0 ||| A E A D B ||| -231.045
+0 ||| A C B D C ||| -231.045
+0 ||| A D B D B ||| -231.045
+0 ||| A C D C C ||| -231.045
+0 ||| A D D C B ||| -231.045
+0 ||| A C C D B ||| -231.045
+0 ||| A A D E B ||| -231.045
+0 ||| A C E C B ||| -231.045
+0 ||| A B D D B ||| -231.045
+0 ||| A B E A D ||| -231.045
+0 ||| A E D C A ||| -231.045
+0 ||| A A E D B ||| -231.045
+0 ||| A C B C D ||| -231.045
+0 ||| A C E D A ||| -231.045
+0 ||| A E B C B ||| -231.045
+0 ||| A C A D D ||| -231.045
+0 ||| A E B D A ||| -231.045
+0 ||| A C B A E ||| -231.045
+0 ||| A D C A D ||| -231.045
+0 ||| A C D E A ||| -231.045
+0 ||| A A B D D ||| -231.045
+0 ||| A B A C E ||| -231.045
+0 ||| A D D D A ||| -231.045
+0 ||| B A B B E ||| -232.045
+0 ||| C A C A E ||| -232.045
+0 ||| D E C B A ||| -232.045
+0 ||| D C E A C ||| -232.045
+0 ||| C A C E B ||| -232.045
+0 ||| B C E C B ||| -232.045
+0 ||| C A E C C ||| -232.045
+0 ||| C D B C C ||| -232.045
+0 ||| E C B B C ||| -232.045
+0 ||| E B A D C ||| -232.045
+0 ||| C A B E C ||| -232.045
+0 ||| E C D A C ||| -232.045
+0 ||| B B E B C ||| -232.045
+0 ||| D A E B C ||| -232.045
+0 ||| D B D B C ||| -232.045
+0 ||| E A A E C ||| -232.045
+0 ||| C B D C C ||| -232.045
+0 ||| E D A C C ||| -232.045
+0 ||| C D A D C ||| -232.045
+0 ||| E B B C C ||| -232.045
+0 ||| C C A E C ||| -232.045
+0 ||| E D B B B ||| -232.045
+0 ||| D D D A C ||| -232.045
+0 ||| B C D C C ||| -232.045
+0 ||| C E A C C ||| -232.045
+0 ||| E A C C C ||| -232.045
+0 ||| B D E A C ||| -232.045
+0 ||| D A D D B ||| -232.045
+0 ||| B E C A C ||| -232.045
+0 ||| B C B D C ||| -232.045
+0 ||| E B A E B ||| -232.045
+0 ||| D D B B C ||| -232.045
+0 ||| D B A E C ||| -232.045
+0 ||| D E B A C ||| -232.045
+0 ||| C E B B B ||| -232.045
+0 ||| B A D E B ||| -232.045
+0 ||| C B A D D ||| -232.045
+0 ||| B B C B D ||| -232.045
+0 ||| C D A E B ||| -232.045
+0 ||| D B C C C ||| -232.045
+0 ||| B C A D D ||| -232.045
+0 ||| B C B A E ||| -232.045
+0 ||| B A D C D ||| -232.045
+0 ||| C B B C D ||| -232.045
+0 ||| D C C A D ||| -232.045
+0 ||| B A B D D ||| -232.045
+0 ||| C C D A D ||| -232.045
+0 ||| E A B B D ||| -232.045
+0 ||| E C A B D ||| -232.045
+0 ||| C B B D C ||| -232.045
+0 ||| D B D A D ||| -232.045
+0 ||| D B B B D ||| -232.045
+0 ||| C A C C D ||| -232.045
+0 ||| D D B A D ||| -232.045
+0 ||| C A C D C ||| -232.045
+0 ||| C A A E D ||| -232.045
+0 ||| C D A C D ||| -232.045
+0 ||| E C B A D ||| -232.045
+0 ||| C C C C C ||| -232.045
+0 ||| B A D A E ||| -232.045
+0 ||| E C E A B ||| -232.045
+0 ||| B A D D C ||| -232.045
+0 ||| B C B C D ||| -232.045
+0 ||| D E A A D ||| -232.045
+0 ||| D C D C B ||| -232.045
+0 ||| E A D A D ||| -232.045
+0 ||| B B E A D ||| -232.045
+0 ||| C B B E B ||| -232.045
+0 ||| E B D B B ||| -232.045
+0 ||| D D C B B ||| -232.045
+0 ||| C D C C B ||| -232.045
+0 ||| B D C B C ||| -232.045
+0 ||| D C C B C ||| -232.045
+0 ||| E B C C B ||| -232.045
+0 ||| D B E B B ||| -232.045
+0 ||| C C D B C ||| -232.045
+0 ||| E E A B B ||| -232.045
+0 ||| C B E C B ||| -232.045
+0 ||| D D E A B ||| -232.045
+0 ||| B C A B E ||| -232.045
+0 ||| E C C B B ||| -232.045
+0 ||| C C E B B ||| -232.045
+0 ||| C D D B B ||| -232.045
+0 ||| B E B C B ||| -232.045
+0 ||| B E A D B ||| -232.045
+0 ||| D E C A B ||| -232.045
+0 ||| B D D C B ||| -232.045
+0 ||| B B D D B ||| -232.045
+0 ||| B C C D B ||| -232.045
+0 ||| E D D A B ||| -232.045
+0 ||| C E D A B ||| -232.045
+0 ||| B A E D B ||| -232.045
+0 ||| C B C D B ||| -232.045
+0 ||| E E B A B ||| -232.045
+0 ||| D C B D B ||| -232.045
+0 ||| C C B B D ||| -232.045
+0 ||| B C B E B ||| -232.045
+0 ||| B D B D B ||| -232.045
+0 ||| E A D B C ||| -232.045
+0 ||| D E A B C ||| -232.045
+0 ||| D A A C E ||| -232.045
+0 ||| B B A C E ||| -232.045
+0 ||| E B A A E ||| -232.045
+0 ||| C B A B E ||| -232.045
+0 ||| D D A B D ||| -232.045
+0 ||| D A E A D ||| -232.045
+0 ||| D D E B A ||| -232.045
+0 ||| C B B A E ||| -232.045
+0 ||| C A D B D ||| -232.045
+0 ||| C D C D A ||| -232.045
+0 ||| D A C B D ||| -232.045
+0 ||| C D A A E ||| -232.045
+0 ||| D C D D A ||| -232.045
+0 ||| E B A C D ||| -232.045
+0 ||| E A E B B ||| -232.045
+0 ||| C D E C A ||| -232.045
+0 ||| B D C A D ||| -232.045
+0 ||| C E C C A ||| -232.045
+0 ||| B E D C A ||| -232.045
+0 ||| B C E D A ||| -232.045
+0 ||| E D C C A ||| -232.045
+0 ||| D E E A A ||| -232.045
+0 ||| E E B B A ||| -232.045
+0 ||| E B E C A ||| -232.045
+0 ||| E E D A A ||| -232.045
+0 ||| C A E E A ||| -232.045
+0 ||| C E A E A ||| -232.045
+0 ||| E D A E A ||| -232.045
+0 ||| C B D E A ||| -232.045
+0 ||| B E B D A ||| -232.045
+0 ||| C B E D A ||| -232.045
+0 ||| E C E B A ||| -232.045
+0 ||| C E D B A ||| -232.045
+0 ||| C C C E A ||| -232.045
+0 ||| E B B E A ||| -232.045
+0 ||| B D D D A ||| -232.045
+0 ||| E B C D A ||| -232.045
+0 ||| D B C E A ||| -232.045
+0 ||| E A C E A ||| -232.045
+0 ||| C D B E A ||| -232.045
+0 ||| B C D E A ||| -232.045
+0 ||| E D D B A ||| -232.045
+0 ||| A B C C D ||| -233.045
+0 ||| A A C E C ||| -233.045
+0 ||| A C E B C ||| -233.045
+0 ||| A C A C E ||| -233.045
+0 ||| A B E C C ||| -233.045
+0 ||| A D B B D ||| -233.045
+0 ||| A E A B D ||| -233.045
+0 ||| A D E B B ||| -233.045
+0 ||| A A B C E ||| -233.045
+0 ||| A E E A B ||| -233.045
+0 ||| A E C B B ||| -233.045
+0 ||| A B C E B ||| -233.045
+0 ||| A B C D C ||| -233.045
+0 ||| A E B A D ||| -233.045
+0 ||| A A E B D ||| -233.045
+0 ||| A D D A D ||| -233.045
+0 ||| A B B E C ||| -233.045
+0 ||| A B D B D ||| -233.045
+0 ||| A D D B C ||| -233.045
+0 ||| A D A E C ||| -233.045
+0 ||| A E D A C ||| -233.045
+0 ||| A E B B C ||| -233.045
+0 ||| A D C C C ||| -233.045
+0 ||| A A A D E ||| -233.045
+0 ||| A B A E D ||| -233.045
+0 ||| A B C A E ||| -233.045
+0 ||| A C E A D ||| -233.045
+0 ||| A D C E A ||| -233.045
+0 ||| A C D D B ||| -233.045
+0 ||| A C C B D ||| -233.045
+0 ||| A E E B A ||| -233.045
+0 ||| A B E E A ||| -233.045
+0 ||| C D B D B ||| -234.045
+0 ||| C C E C B ||| -234.045
+0 ||| C C B E B ||| -234.045
+0 ||| E A A D D ||| -234.045
+0 ||| C C A D D ||| -234.045
+0 ||| B E C B B ||| -234.045
+0 ||| E A A B E ||| -234.045
+0 ||| B B C D C ||| -234.045
+0 ||| E C D B B ||| -234.045
+0 ||| E B B D B ||| -234.045
+0 ||| E A B E B ||| -234.045
+0 ||| B E E A B ||| -234.045
+0 ||| C B C B D ||| -234.045
+0 ||| D E D A B ||| -234.045
+0 ||| E C A E B ||| -234.045
+0 ||| B E A B D ||| -234.045
+0 ||| E B C B C ||| -234.045
+0 ||| D C D B C ||| -234.045
+0 ||| D C C C C ||| -234.045
+0 ||| C C D C C ||| -234.045
+0 ||| B D A E C ||| -234.045
+0 ||| B D C C C ||| -234.045
+0 ||| D A E C C ||| -234.045
+0 ||| C D C B C ||| -234.045
+0 ||| D C D A D ||| -234.045
+0 ||| B B E C C ||| -234.045
+0 ||| C B E B C ||| -234.045
+0 ||| E A D C C ||| -234.045
+0 ||| D D A D C ||| -234.045
+0 ||| D A C C D ||| -234.045
+0 ||| B D D B C ||| -234.045
+0 ||| E C B C C ||| -234.045
+0 ||| E C A D C ||| -234.045
+0 ||| C E C A C ||| -234.045
+0 ||| B B B E C ||| -234.045
+0 ||| D E A C C ||| -234.045
+0 ||| D C B B D ||| -234.045
+0 ||| D B D C C ||| -234.045
+0 ||| E A B D C ||| -234.045
+0 ||| E A E C B ||| -234.045
+0 ||| B E B B C ||| -234.045
+0 ||| C A D C D ||| -234.045
+0 ||| D C A E C ||| -234.045
+0 ||| B C E B C ||| -234.045
+0 ||| E A C D B ||| -234.045
+0 ||| D B B D C ||| -234.045
+0 ||| C D E A C ||| -234.045
+0 ||| C E B C B ||| -234.045
+0 ||| D A B E C ||| -234.045
+0 ||| D A C E B ||| -234.045
+0 ||| D D B C C ||| -234.045
+0 ||| B A C E C ||| -234.045
+0 ||| B E D A C ||| -234.045
+0 ||| D A C A E ||| -234.045
+0 ||| B B C C D ||| -234.045
+0 ||| B E B A D ||| -234.045
+0 ||| E C A C D ||| -234.045
+0 ||| C C C D B ||| -234.045
+0 ||| B D B B D ||| -234.045
+0 ||| D D A C D ||| -234.045
+0 ||| C B E A D ||| -234.045
+0 ||| D A A E D ||| -234.045
+0 ||| C D C A D ||| -234.045
+0 ||| C B A C E ||| -234.045
+0 ||| D B B C D ||| -234.045
+0 ||| E C C C B ||| -234.045
+0 ||| B D D A D ||| -234.045
+0 ||| E B C A D ||| -234.045
+0 ||| D B A D D ||| -234.045
+0 ||| B A E B D ||| -234.045
+0 ||| C B D D B ||| -234.045
+0 ||| E B D C B ||| -234.045
+0 ||| E D B C B ||| -234.045
+0 ||| B B D B D ||| -234.045
+0 ||| B D E B B ||| -234.045
+0 ||| D D D B B ||| -234.045
+0 ||| D B E C B ||| -234.045
+0 ||| C A D E B ||| -234.045
+0 ||| E E A C B ||| -234.045
+0 ||| C A E D B ||| -234.045
+0 ||| D B B E B ||| -234.045
+0 ||| C C B C D ||| -234.045
+0 ||| D D C C B ||| -234.045
+0 ||| E D C A C ||| -234.045
+0 ||| D B C D B ||| -234.045
+0 ||| B C D D B ||| -234.045
+0 ||| D D A E B ||| -234.045
+0 ||| B C E A D ||| -234.045
+0 ||| D C E B B ||| -234.045
+0 ||| C E A D B ||| -234.045
+0 ||| C D D C B ||| -234.045
+0 ||| E D A D B ||| -234.045
+0 ||| C C A B E ||| -234.045
+0 ||| E A B C D ||| -234.045
+0 ||| C C B D C ||| -234.045
+0 ||| D A C D C ||| -234.045
+0 ||| E B E A C ||| -234.045
+0 ||| E C A A E ||| -234.045
+0 ||| B A B C E ||| -234.045
+0 ||| B B A E D ||| -234.045
+0 ||| D B B A E ||| -234.045
+0 ||| D E B B B ||| -234.045
+0 ||| C A D D C ||| -234.045
+0 ||| B C C B D ||| -234.045
+0 ||| B B C A E ||| -234.045
+0 ||| C A D A E ||| -234.045
+0 ||| B B C E B ||| -234.045
+0 ||| D B A B E ||| -234.045
+0 ||| D A D B D ||| -234.045
+0 ||| E D D C A ||| -234.045
+0 ||| B A A D E ||| -234.045
+0 ||| C C B A E ||| -234.045
+0 ||| C C D E A ||| -234.045
+0 ||| B C A C E ||| -234.045
+0 ||| C A B D D ||| -234.045
+0 ||| C E B D A ||| -234.045
+0 ||| D D A A E ||| -234.045
+0 ||| E A B A E ||| -234.045
+0 ||| E D B D A ||| -234.045
+0 ||| C A B B E ||| -234.045
+0 ||| E C E C A ||| -234.045
+0 ||| B E E B A ||| -234.045
+0 ||| D D E C A ||| -234.045
+0 ||| E C B E A ||| -234.045
+0 ||| D D C D A ||| -234.045
+0 ||| D B D E A ||| -234.045
+0 ||| B B E E A ||| -234.045
+0 ||| E A E D A ||| -234.045
+0 ||| E E A D A ||| -234.045
+0 ||| E B D D A ||| -234.045
+0 ||| E E B C A ||| -234.045
+0 ||| C D D D A ||| -234.045
+0 ||| D E D B A ||| -234.045
+0 ||| D D B E A ||| -234.045
+0 ||| D E C C A ||| -234.045
+0 ||| C E D C A ||| -234.045
+0 ||| D C C E A ||| -234.045
+0 ||| E C C D A ||| -234.045
+0 ||| D E A E A ||| -234.045
+0 ||| D A E E A ||| -234.045
+0 ||| B D C E A ||| -234.045
+0 ||| E A D E A ||| -234.045
+0 ||| C C E D A ||| -234.045
+0 ||| D B E D A ||| -234.045
+0 ||| A C C A E ||| -235.045
+0 ||| A C B E C ||| -235.045
+0 ||| A B D E B ||| -235.045
+0 ||| A C C D C ||| -235.045
+0 ||| A D A D D ||| -235.045
+0 ||| A B E D B ||| -235.045
+0 ||| A C C C D ||| -235.045
+0 ||| A C D B D ||| -235.045
+0 ||| A A D E C ||| -235.045
+0 ||| A C E C C ||| -235.045
+0 ||| A A E E B ||| -235.045
+0 ||| A D B C D ||| -235.045
+0 ||| A D B A E ||| -235.045
+0 ||| A C A E D ||| -235.045
+0 ||| A E D B B ||| -235.045
+0 ||| A E A C D ||| -235.045
+0 ||| A D D C C ||| -235.045
+0 ||| A D B E B ||| -235.045
+0 ||| A A C D D ||| -235.045
+0 ||| A B D C D ||| -235.045
+0 ||| A D B D C ||| -235.045
+0 ||| A D C D B ||| -235.045
+0 ||| A E C C B ||| -235.045
+0 ||| A E A E B ||| -235.045
+0 ||| A A E C D ||| -235.045
+0 ||| A E A D C ||| -235.045
+0 ||| A D E C B ||| -235.045
+0 ||| A B D D C ||| -235.045
+0 ||| A D E D A ||| -235.045
+0 ||| A B D A E ||| -235.045
+0 ||| A A C B E ||| -235.045
+0 ||| A E B C C ||| -235.045
+0 ||| A E E C A ||| -235.045
+0 ||| A C C E B ||| -235.045
+0 ||| A A E D C ||| -235.045
+0 ||| A E A A E ||| -235.045
+0 ||| A E B E A ||| -235.045
+0 ||| A D A B E ||| -235.045
+0 ||| A A B E D ||| -235.045
+0 ||| A B B D D ||| -235.045
+0 ||| A C E E A ||| -235.045
+0 ||| A B B B E ||| -235.045
+0 ||| A A E A E ||| -235.045
+0 ||| A E C D A ||| -235.045
+0 ||| A D D E A ||| -235.045
+0 ||| B E A E B ||| -236.045
+0 ||| B D E C B ||| -236.045
+0 ||| B D B D C ||| -236.045
+0 ||| B C E C C ||| -236.045
+0 ||| D C E C B ||| -236.045
+0 ||| C A C E C ||| -236.045
+0 ||| C B D B D ||| -236.045
+0 ||| D B D D B ||| -236.045
+0 ||| D C B C D ||| -236.045
+0 ||| B D B A E ||| -236.045
+0 ||| B B D E B ||| -236.045
+0 ||| B C C A E ||| -236.045
+0 ||| D C C D B ||| -236.045
+0 ||| D A D D C ||| -236.045
+0 ||| D A E D B ||| -236.045
+0 ||| E D B B C ||| -236.045
+0 ||| D D B D B ||| -236.045
+0 ||| B A D E C ||| -236.045
+0 ||| E E A A D ||| -236.045
+0 ||| E B A E C ||| -236.045
+0 ||| E A D D B ||| -236.045
+0 ||| C E B B C ||| -236.045
+0 ||| D A D A E ||| -236.045
+0 ||| C C E A D ||| -236.045
+0 ||| C D A E C ||| -236.045
+0 ||| B C C C D ||| -236.045
+0 ||| D C B A E ||| -236.045
+0 ||| C A A D E ||| -236.045
+0 ||| B A E A E ||| -236.045
+0 ||| B C B E C ||| -236.045
+0 ||| C B C C D ||| -236.045
+0 ||| B C C E B ||| -236.045
+0 ||| C A E B D ||| -236.045
+0 ||| C D D B C ||| -236.045
+0 ||| E C E A C ||| -236.045
+0 ||| B B B D D ||| -236.045
+0 ||| B B D A E ||| -236.045
+0 ||| C B A E D ||| -236.045
+0 ||| C C E B C ||| -236.045
+0 ||| C D D A D ||| -236.045
+0 ||| C D C C C ||| -236.045
+0 ||| D C D C C ||| -236.045
+0 ||| D D C B C ||| -236.045
+0 ||| C B B E C ||| -236.045
+0 ||| E B D B C ||| -236.045
+0 ||| B D A B E ||| -236.045
+0 ||| D C A B E ||| -236.045
+0 ||| D B E B C ||| -236.045
+0 ||| C B C A E ||| -236.045
+0 ||| E B C C C ||| -236.045
+0 ||| E C C B C ||| -236.045
+0 ||| E A A C E ||| -236.045
+0 ||| E E A B C ||| -236.045
+0 ||| D D E A C ||| -236.045
+0 ||| C A B C E ||| -236.045
+0 ||| C B E C C ||| -236.045
+0 ||| B B D D C ||| -236.045
+0 ||| E B D A D ||| -236.045
+0 ||| B B B B E ||| -236.045
+0 ||| E E B A C ||| -236.045
+0 ||| C C C B D ||| -236.045
+0 ||| C E B A D ||| -236.045
+0 ||| B D D C C ||| -236.045
+0 ||| D B E A D ||| -236.045
+0 ||| D E C A C ||| -236.045
+0 ||| B E B C C ||| -236.045
+0 ||| B E A D C ||| -236.045
+0 ||| C E D A C ||| -236.045
+0 ||| C B C D C ||| -236.045
+0 ||| E D D A C ||| -236.045
+0 ||| B C C D C ||| -236.045
+0 ||| B A E D C ||| -236.045
+0 ||| B A C B E ||| -236.045
+0 ||| D B A C E ||| -236.045
+0 ||| D C B E B ||| -236.045
+0 ||| D D C A D ||| -236.045
+0 ||| B E A C D ||| -236.045
+0 ||| C D B B D ||| -236.045
+0 ||| D C B D C ||| -236.045
+0 ||| D A B B E ||| -236.045
+0 ||| B E A A E ||| -236.045
+0 ||| C C A C E ||| -236.045
+0 ||| B D B E B ||| -236.045
+0 ||| C C D D B ||| -236.045
+0 ||| E A E B C ||| -236.045
+0 ||| B E C C B ||| -236.045
+0 ||| C B C E B ||| -236.045
+0 ||| B D C D B ||| -236.045
+0 ||| E D C B B ||| -236.045
+0 ||| E D B A D ||| -236.045
+0 ||| C D E B B ||| -236.045
+0 ||| D A D E B ||| -236.045
+0 ||| C E E A B ||| -236.045
+0 ||| C E C B B ||| -236.045
+0 ||| D D D C B ||| -236.045
+0 ||| D C A D D ||| -236.045
+0 ||| E E C A B ||| -236.045
+0 ||| E C B D B ||| -236.045
+0 ||| E B E B B ||| -236.045
+0 ||| B E D B B ||| -236.045
+0 ||| D E A D B ||| -236.045
+0 ||| B A E E B ||| -236.045
+0 ||| D A B D D ||| -236.045
+0 ||| B D A D D ||| -236.045
+0 ||| B A C D D ||| -236.045
+0 ||| B B D C D ||| -236.045
+0 ||| B A B E D ||| -236.045
+0 ||| B C D B D ||| -236.045
+0 ||| E D E A B ||| -236.045
+0 ||| B B E D B ||| -236.045
+0 ||| B A E C D ||| -236.045
+0 ||| B D B C D ||| -236.045
+0 ||| E B B B D ||| -236.045
+0 ||| E D A B D ||| -236.045
+0 ||| E B C E A ||| -236.045
+0 ||| E C C A D ||| -236.045
+0 ||| E A C B D ||| -236.045
+0 ||| D C E D A ||| -236.045
+0 ||| B C A E D ||| -236.045
+0 ||| C E A B D ||| -236.045
+0 ||| B D D E A ||| -236.045
+0 ||| D E B C B ||| -236.045
+0 ||| D B C B D ||| -236.045
+0 ||| C D C E A ||| -236.045
+0 ||| E A E A D ||| -236.045
+0 ||| E C D C B ||| -236.045
+0 ||| D A D C D ||| -236.045
+0 ||| D C D E A ||| -236.045
+0 ||| D D D D A ||| -236.045
+0 ||| C E E B A ||| -236.045
+0 ||| E C D D A ||| -236.045
+0 ||| B E E C A ||| -236.045
+0 ||| B C E E A ||| -236.045
+0 ||| E E C B A ||| -236.045
+0 ||| B E C D A ||| -236.045
+0 ||| D E B D A ||| -236.045
+0 ||| B E B E A ||| -236.045
+0 ||| E E E A A ||| -236.045
+0 ||| D E D C A ||| -236.045
+0 ||| C B E E A ||| -236.045
+0 ||| E D E B A ||| -236.045
+0 ||| B D E D A ||| -236.045
+0 ||| A C D D C ||| -237.045
+0 ||| A B C E C ||| -237.045
+0 ||| A C D A E ||| -237.045
+0 ||| A E C A D ||| -237.045
+0 ||| A E D D A ||| -237.045
+0 ||| A B E B D ||| -237.045
+0 ||| A C D E B ||| -237.045
+0 ||| A C B D D ||| -237.045
+0 ||| A E C B C ||| -237.045
+0 ||| A D A C E ||| -237.045
+0 ||| A E E A C ||| -237.045
+0 ||| A D D D B ||| -237.045
+0 ||| A B A D E ||| -237.045
+0 ||| A D E A D ||| -237.045
+0 ||| A C B B E ||| -237.045
+0 ||| A A D D D ||| -237.045
+0 ||| A A A E E ||| -237.045
+0 ||| A E D C B ||| -237.045
+0 ||| A A C C E ||| -237.045
+0 ||| A B B C E ||| -237.045
+0 ||| A E B D B ||| -237.045
+0 ||| A C E D B ||| -237.045
+0 ||| A A D B E ||| -237.045
+0 ||| A D C B D ||| -237.045
+0 ||| A C D C D ||| -237.045
+0 ||| A D E B C ||| -237.045
+0 ||| C B D E B ||| -238.045
+0 ||| C E C C B ||| -238.045
+0 ||| B C E D B ||| -238.045
+0 ||| B E D C B ||| -238.045
+0 ||| E C D A D ||| -238.045
+0 ||| B C B D D ||| -238.045
+0 ||| C A B E D ||| -238.045
+0 ||| C C B E C ||| -238.045
+0 ||| D E C B B ||| -238.045
+0 ||| D C E A D ||| -238.045
+0 ||| C A E C D ||| -238.045
+0 ||| E B A D D ||| -238.045
+0 ||| E C B B D ||| -238.045
+0 ||| C D B C D ||| -238.045
+0 ||| C E A A E ||| -238.045
+0 ||| D B B E C ||| -238.045
+0 ||| E D A C D ||| -238.045
+0 ||| B E C A D ||| -238.045
+0 ||| C C E C C ||| -238.045
+0 ||| D A E B D ||| -238.045
+0 ||| E B A B E ||| -238.045
+0 ||| B B E B D ||| -238.045
+0 ||| C B D C D ||| -238.045
+0 ||| E A A E D ||| -238.045
+0 ||| D B D B D ||| -238.045
+0 ||| C D B D C ||| -238.045
+0 ||| B A D B E ||| -238.045
+0 ||| C C A E D ||| -238.045
+0 ||| C D A D D ||| -238.045
+0 ||| E B B C D ||| -238.045
+0 ||| B D E A D ||| -238.045
+0 ||| D D D A D ||| -238.045
+0 ||| E A C C D ||| -238.045
+0 ||| B C D C D ||| -238.045
+0 ||| C E A C D ||| -238.045
+0 ||| D D B B D ||| -238.045
+0 ||| C A C D D ||| -238.045
+0 ||| E C A E C ||| -238.045
+0 ||| B E C B C ||| -238.045
+0 ||| D B A E D ||| -238.045
+0 ||| D E B A D ||| -238.045
+0 ||| D B C C D ||| -238.045
+0 ||| D E D A C ||| -238.045
+0 ||| E B B D C ||| -238.045
+0 ||| B B B C E ||| -238.045
+0 ||| E C D B C ||| -238.045
+0 ||| B E E A C ||| -238.045
+0 ||| E A B E C ||| -238.045
+0 ||| C B B D D ||| -238.045
+0 ||| E D C C B ||| -238.045
+0 ||| C A E D C ||| -238.045
+0 ||| B A D D D ||| -238.045
+0 ||| E A E C C ||| -238.045
+0 ||| E D A E B ||| -238.045
+0 ||| C B D A E ||| -238.045
+0 ||| C E B C C ||| -238.045
+0 ||| C D B A E ||| -238.045
+0 ||| E A C D C ||| -238.045
+0 ||| C C C C D ||| -238.045
+0 ||| B D C B D ||| -238.045
+0 ||| D A C E C ||| -238.045
+0 ||| D C C B D ||| -238.045
+0 ||| C C D B D ||| -238.045
+0 ||| E E D A B ||| -238.045
+0 ||| D A B C E ||| -238.045
+0 ||| C E A E B ||| -238.045
+0 ||| C C C D C ||| -238.045
+0 ||| E B E C B ||| -238.045
+0 ||| E E B B B ||| -238.045
+0 ||| D E E A B ||| -238.045
+0 ||| E E A C C ||| -238.045
+0 ||| C A E E B ||| -238.045
+0 ||| C A C B E ||| -238.045
+0 ||| C A D E C ||| -238.045
+0 ||| E C C C C ||| -238.045
+0 ||| D C A C E ||| -238.045
+0 ||| D B E C C ||| -238.045
+0 ||| D D D B C ||| -238.045
+0 ||| C B D D C ||| -238.045
+0 ||| E B D C C ||| -238.045
+0 ||| B D E B C ||| -238.045
+0 ||| E D B C C ||| -238.045
+0 ||| D D E B B ||| -238.045
+0 ||| B C D D C ||| -238.045
+0 ||| C C C E B ||| -238.045
+0 ||| B E B D B ||| -238.045
+0 ||| D B C D C ||| -238.045
+0 ||| D D C C C ||| -238.045
+0 ||| C D C D B ||| -238.045
+0 ||| D D A E C ||| -238.045
+0 ||| D C D D B ||| -238.045
+0 ||| C D E C B ||| -238.045
+0 ||| B C D A E ||| -238.045
+0 ||| C E A D C ||| -238.045
+0 ||| C E D B B ||| -238.045
+0 ||| E D A D C ||| -238.045
+0 ||| C B E D B ||| -238.045
+0 ||| D C E B C ||| -238.045
+0 ||| E A C A E ||| -238.045
+0 ||| C D D C C ||| -238.045
+0 ||| B B A D E ||| -238.045
+0 ||| E C E B B ||| -238.045
+0 ||| B A C C E ||| -238.045
+0 ||| D A A D E ||| -238.045
+0 ||| B C D E B ||| -238.045
+0 ||| E B B A E ||| -238.045
+0 ||| D E B B C ||| -238.045
+0 ||| C D B E B ||| -238.045
+0 ||| E B B E B ||| -238.045
+0 ||| B D D D B ||| -238.045
+0 ||| E A C E B ||| -238.045
+0 ||| D B C E B ||| -238.045
+0 ||| E B C D B ||| -238.045
+0 ||| E A D B D ||| -238.045
+0 ||| D E A B D ||| -238.045
+0 ||| E D D B B ||| -238.045
+0 ||| B D A C E ||| -238.045
+0 ||| D B E E A ||| -238.045
+0 ||| B B C E C ||| -238.045
+0 ||| C B B B E ||| -238.045
+0 ||| E B D E A ||| -238.045
+0 ||| B C B B E ||| -238.045
+0 ||| C C C A E ||| -238.045
+0 ||| E D B E A ||| -238.045
+0 ||| B A A E E ||| -238.045
+0 ||| D B C A E ||| -238.045
+0 ||| E D C D A ||| -238.045
+0 ||| E D A A E ||| -238.045
+0 ||| C A E A E ||| -238.045
+0 ||| E B E D A ||| -238.045
+0 ||| C D A B E ||| -238.045
+0 ||| C C E E A ||| -238.045
+0 ||| C E C D A ||| -238.045
+0 ||| C E B E A ||| -238.045
+0 ||| C D E D A ||| -238.045
+0 ||| E E D B A ||| -238.045
+0 ||| E E A E A ||| -238.045
+0 ||| D D C E A ||| -238.045
+0 ||| C E E C A ||| -238.045
+0 ||| E A E E A ||| -238.045
+0 ||| E E C C A ||| -238.045
+0 ||| E D E C A ||| -238.045
+0 ||| E C C E A ||| -238.045
+0 ||| D E E B A ||| -238.045
+0 ||| B E D D A ||| -238.045
+0 ||| C D D E A ||| -238.045
+0 ||| A A D C E ||| -239.045
+0 ||| A E B B D ||| -239.045
+0 ||| A B E C D ||| -239.045
+0 ||| A A B D E ||| -239.045
+0 ||| A D C E B ||| -239.045
+0 ||| A A E E C ||| -239.045
+0 ||| A B C B E ||| -239.045
+0 ||| A D C C D ||| -239.045
+0 ||| A B D E C ||| -239.045
+0 ||| A C E B D ||| -239.045
+0 ||| A B B E D ||| -239.045
+0 ||| A A C E D ||| -239.045
+0 ||| A E E B B ||| -239.045
+0 ||| A B E E B ||| -239.045
+0 ||| A D A E D ||| -239.045
+0 ||| A B E D C ||| -239.045
+0 ||| A E D A D ||| -239.045
+0 ||| A B C D D ||| -239.045
+0 ||| A D E E A ||| -239.045
+0 ||| A D E C C ||| -239.045
+0 ||| A E D B C ||| -239.045
+0 ||| A D C D C ||| -239.045
+0 ||| A E C C C ||| -239.045
+0 ||| A E C E A ||| -239.045
+0 ||| A E A E C ||| -239.045
+0 ||| A C B C E ||| -239.045
+0 ||| A D D B D ||| -239.045
+0 ||| A D B E C ||| -239.045
+0 ||| A B E A E ||| -239.045
+0 ||| A D C A E ||| -239.045
+0 ||| A C A D E ||| -239.045
+0 ||| A C C E C ||| -239.045
+0 ||| B E E B B ||| -240.045
+0 ||| B D C A E ||| -240.045
+0 ||| D E A C D ||| -240.045
+0 ||| E A D E B ||| -240.045
+0 ||| D D E C B ||| -240.045
+0 ||| D B D E B ||| -240.045
+0 ||| C A A E E ||| -240.045
+0 ||| D C C D C ||| -240.045
+0 ||| B D E C C ||| -240.045
+0 ||| B E A E C ||| -240.045
+0 ||| D C E C C ||| -240.045
+0 ||| E C E C B ||| -240.045
+0 ||| B B D E C ||| -240.045
+0 ||| D B D D C ||| -240.045
+0 ||| D D B D C ||| -240.045
+0 ||| C B B C E ||| -240.045
+0 ||| B B B E D ||| -240.045
+0 ||| D A E D C ||| -240.045
+0 ||| B A D C E ||| -240.045
+0 ||| B B C D D ||| -240.045
+0 ||| C B A D E ||| -240.045
+0 ||| B B C B E ||| -240.045
+0 ||| B C A D E ||| -240.045
+0 ||| E A D D C ||| -240.045
+0 ||| B D C C D ||| -240.045
+0 ||| D D B A E ||| -240.045
+0 ||| D C C A E ||| -240.045
+0 ||| E C A B E ||| -240.045
+0 ||| D C D B D ||| -240.045
+0 ||| E B C B D ||| -240.045
+0 ||| C E C A D ||| -240.045
+0 ||| B D A E D ||| -240.045
+0 ||| E A B B E ||| -240.045
+0 ||| B A B D E ||| -240.045
+0 ||| C C D C D ||| -240.045
+0 ||| C C D A E ||| -240.045
+0 ||| D C C C D ||| -240.045
+0 ||| E C A D D ||| -240.045
+0 ||| C B E B D ||| -240.045
+0 ||| D A E C D ||| -240.045
+0 ||| C A C C E ||| -240.045
+0 ||| B B E C D ||| -240.045
+0 ||| C D C B D ||| -240.045
+0 ||| E C B C D ||| -240.045
+0 ||| D D A D D ||| -240.045
+0 ||| D B B B E ||| -240.045
+0 ||| E A D C D ||| -240.045
+0 ||| B D D B D ||| -240.045
+0 ||| D B D A E ||| -240.045
+0 ||| D D C D B ||| -240.045
+0 ||| C D A C E ||| -240.045
+0 ||| B E B B D ||| -240.045
+0 ||| E C C D B ||| -240.045
+0 ||| B C C E C ||| -240.045
+0 ||| B E D A D ||| -240.045
+0 ||| E A B D D ||| -240.045
+0 ||| D B D C D ||| -240.045
+0 ||| E C B A E ||| -240.045
+0 ||| D B B D D ||| -240.045
+0 ||| D C A E D ||| -240.045
+0 ||| C D E A D ||| -240.045
+0 ||| B C E B D ||| -240.045
+0 ||| D A B E D ||| -240.045
+0 ||| D E A A E ||| -240.045
+0 ||| B C B C E ||| -240.045
+0 ||| B A C E D ||| -240.045
+0 ||| B B E A E ||| -240.045
+0 ||| E A D A E ||| -240.045
+0 ||| D D B C D ||| -240.045
+0 ||| E C B E B ||| -240.045
+0 ||| E E A D B ||| -240.045
+0 ||| C C B B E ||| -240.045
+0 ||| D C B E C ||| -240.045
+0 ||| D A D E C ||| -240.045
+0 ||| E C D C C ||| -240.045
+0 ||| C C E D B ||| -240.045
+0 ||| D A E A E ||| -240.045
+0 ||| E D C A D ||| -240.045
+0 ||| E D D C B ||| -240.045
+0 ||| C C D E B ||| -240.045
+0 ||| C A D D D ||| -240.045
+0 ||| E E B C B ||| -240.045
+0 ||| E A E D B ||| -240.045
+0 ||| D B E D B ||| -240.045
+0 ||| C E B D B ||| -240.045
+0 ||| E D B D B ||| -240.045
+0 ||| C D E B C ||| -240.045
+0 ||| E B D D B ||| -240.045
+0 ||| C C D D C ||| -240.045
+0 ||| B D B E C ||| -240.045
+0 ||| E D C B C ||| -240.045
+0 ||| B E C C C ||| -240.045
+0 ||| B D C D C ||| -240.045
+0 ||| C B C E C ||| -240.045
+0 ||| B B E D C ||| -240.045
+0 ||| D E A D C ||| -240.045
+0 ||| D E D B B ||| -240.045
+0 ||| D D A B E ||| -240.045
+0 ||| C D D D B ||| -240.045
+0 ||| E E C A C ||| -240.045
+0 ||| C E C B C ||| -240.045
+0 ||| C E E A C ||| -240.045
+0 ||| D D D C C ||| -240.045
+0 ||| C C B D D ||| -240.045
+0 ||| D C C E B ||| -240.045
+0 ||| D A C D D ||| -240.045
+0 ||| E B E A D ||| -240.045
+0 ||| E B E B C ||| -240.045
+0 ||| E C B D C ||| -240.045
+0 ||| D E A E B ||| -240.045
+0 ||| B D C E B ||| -240.045
+0 ||| B A E E C ||| -240.045
+0 ||| B E D B C ||| -240.045
+0 ||| D E B C C ||| -240.045
+0 ||| B B E E B ||| -240.045
+0 ||| D D B E B ||| -240.045
+0 ||| B D E E A ||| -240.045
+0 ||| D E C C B ||| -240.045
+0 ||| E D E A C ||| -240.045
+0 ||| E E B D A ||| -240.045
+0 ||| E B A C E ||| -240.045
+0 ||| C E D C B ||| -240.045
+0 ||| D E E C A ||| -240.045
+0 ||| D A C B E ||| -240.045
+0 ||| D A E E B ||| -240.045
+0 ||| D D E D A ||| -240.045
+0 ||| C A D B E ||| -240.045
+0 ||| D C E E A ||| -240.045
+0 ||| E C D E A ||| -240.045
+0 ||| E D D D A ||| -240.045
+0 ||| E E D C A ||| -240.045
+0 ||| D D D E A ||| -240.045
+0 ||| E C E D A ||| -240.045
+0 ||| B E C E A ||| -240.045
+0 ||| D E B E A ||| -240.045
+0 ||| C E D D A ||| -240.045
+0 ||| D E C D A ||| -240.045
+0 ||| A C E A E ||| -241.045
+0 ||| A C E C D ||| -241.045
+0 ||| A E E D A ||| -241.045
+0 ||| A A D E D ||| -241.045
+0 ||| A D E D B ||| -241.045
+0 ||| A C E E B ||| -241.045
+0 ||| A D D E B ||| -241.045
+0 ||| A C C D D ||| -241.045
+0 ||| A D D A E ||| -241.045
+0 ||| A D D C D ||| -241.045
+0 ||| A E D E A ||| -241.045
+0 ||| A E A B E ||| -241.045
+0 ||| A E C D B ||| -241.045
+0 ||| A C C B E ||| -241.045
+0 ||| A D B D D ||| -241.045
+0 ||| A A E B E ||| -241.045
+0 ||| A D B B E ||| -241.045
+0 ||| A B C C E ||| -241.045
+0 ||| A E D C C ||| -241.045
+0 ||| A C D E C ||| -241.045
+0 ||| A B D B E ||| -241.045
+0 ||| A E A D D ||| -241.045
+0 ||| A C B E D ||| -241.045
+0 ||| A E B C D ||| -241.045
+0 ||| A B D D D ||| -241.045
+0 ||| A B A E E ||| -241.045
+0 ||| A C E D C ||| -241.045
+0 ||| A E B E B ||| -241.045
+0 ||| A E B D C ||| -241.045
+0 ||| A E E C B ||| -241.045
+0 ||| A D D D C ||| -241.045
+0 ||| A E B A E ||| -241.045
+0 ||| A A E D D ||| -241.045
+0 ||| B C E C D ||| -242.045
+0 ||| D E C B C ||| -242.045
+0 ||| D D D D B ||| -242.045
+0 ||| B C E D C ||| -242.045
+0 ||| B D B D D ||| -242.045
+0 ||| C E C C C ||| -242.045
+0 ||| C B D E C ||| -242.045
+0 ||| B E D C C ||| -242.045
+0 ||| E D C C C ||| -242.045
+0 ||| C A C E D ||| -242.045
+0 ||| C B E E B ||| -242.045
+0 ||| B D E D B ||| -242.045
+0 ||| D A D D D ||| -242.045
+0 ||| E B A E D ||| -242.045
+0 ||| E D B B D ||| -242.045
+0 ||| E A A D E ||| -242.045
+0 ||| C C A D E ||| -242.045
+0 ||| B A D E D ||| -242.045
+0 ||| C B C B E ||| -242.045
+0 ||| B E A B E ||| -242.045
+0 ||| C E B B D ||| -242.045
+0 ||| D C D A E ||| -242.045
+0 ||| D A C C E ||| -242.045
+0 ||| E D A E C ||| -242.045
+0 ||| E B B E C ||| -242.045
+0 ||| D C D E B ||| -242.045
+0 ||| D C B B E ||| -242.045
+0 ||| C D A E D ||| -242.045
+0 ||| B C B E D ||| -242.045
+0 ||| C A D C E ||| -242.045
+0 ||| E C C B D ||| -242.045
+0 ||| B C D E C ||| -242.045
+0 ||| C C E B D ||| -242.045
+0 ||| C D D B D ||| -242.045
+0 ||| E C E A D ||| -242.045
+0 ||| E B C C D ||| -242.045
+0 ||| D D C B D ||| -242.045
+0 ||| D C D C D ||| -242.045
+0 ||| C D C C D ||| -242.045
+0 ||| E D E B B ||| -242.045
+0 ||| E B D B D ||| -242.045
+0 ||| C B B E D ||| -242.045
+0 ||| D B E B D ||| -242.045
+0 ||| B E C D B ||| -242.045
+0 ||| B D B B E ||| -242.045
+0 ||| C B C D D ||| -242.045
+0 ||| D D E A D ||| -242.045
+0 ||| E E A B D ||| -242.045
+0 ||| C B E C D ||| -242.045
+0 ||| E E B A D ||| -242.045
+0 ||| D C B D D ||| -242.045
+0 ||| B B D D D ||| -242.045
+0 ||| C E D A D ||| -242.045
+0 ||| B E B A E ||| -242.045
+0 ||| B D D C D ||| -242.045
+0 ||| B B C C E ||| -242.045
+0 ||| E E D A C ||| -242.045
+0 ||| B E A D D ||| -242.045
+0 ||| D E C A D ||| -242.045
+0 ||| E C A C E ||| -242.045
+0 ||| B E B C D ||| -242.045
+0 ||| D E B D B ||| -242.045
+0 ||| D D A C E ||| -242.045
+0 ||| B A E D D ||| -242.045
+0 ||| B C C D D ||| -242.045
+0 ||| E D D A D ||| -242.045
+0 ||| C E A E C ||| -242.045
+0 ||| C D C A E ||| -242.045
+0 ||| D A A E E ||| -242.045
+0 ||| C B E A E ||| -242.045
+0 ||| C D C E B ||| -242.045
+0 ||| E E B B C ||| -242.045
+0 ||| E B E C C ||| -242.045
+0 ||| B A E B E ||| -242.045
+0 ||| D B B C E ||| -242.045
+0 ||| D B A D E ||| -242.045
+0 ||| B D D A E ||| -242.045
+0 ||| E B C A E ||| -242.045
+0 ||| C A E E C ||| -242.045
+0 ||| C E E B B ||| -242.045
+0 ||| D E E A C ||| -242.045
+0 ||| B B D B E ||| -242.045
+0 ||| B C E A E ||| -242.045
+0 ||| E B C D C ||| -242.045
+0 ||| E E C B B ||| -242.045
+0 ||| C C B C E ||| -242.045
+0 ||| D D E B C ||| -242.045
+0 ||| D C E D B ||| -242.045
+0 ||| B E B D C ||| -242.045
+0 ||| E B C E B ||| -242.045
+0 ||| C C C E C ||| -242.045
+0 ||| D E D C B ||| -242.045
+0 ||| E C D D B ||| -242.045
+0 ||| C D C D C ||| -242.045
+0 ||| B C E E B ||| -242.045
+0 ||| C D E C C ||| -242.045
+0 ||| D C D D C ||| -242.045
+0 ||| B C C B E ||| -242.045
+0 ||| B E E C B ||| -242.045
+0 ||| C E D B C ||| -242.045
+0 ||| C B E D C ||| -242.045
+0 ||| E A E B D ||| -242.045
+0 ||| E A C E C ||| -242.045
+0 ||| E A B C E ||| -242.045
+0 ||| C D B E C ||| -242.045
+0 ||| B B A E E ||| -242.045
+0 ||| D B C E C ||| -242.045
+0 ||| E C E B C ||| -242.045
+0 ||| B E B E B ||| -242.045
+0 ||| D E D D A ||| -242.045
+0 ||| B D D D C ||| -242.045
+0 ||| E D D B C ||| -242.045
+0 ||| B E D E A ||| -242.045
+0 ||| E E E A B ||| -242.045
+0 ||| C A B D E ||| -242.045
+0 ||| B E E D A ||| -242.045
+0 ||| D A D B E ||| -242.045
+0 ||| B D D E B ||| -242.045
+0 ||| E D C E A ||| -242.045
+0 ||| C E C E A ||| -242.045
+0 ||| C D E E A ||| -242.045
+0 ||| E E E B A ||| -242.045
+0 ||| E B E E A ||| -242.045
+0 ||| A E A C E ||| -243.045
+0 ||| A B D C E ||| -243.045
+0 ||| A C D B E ||| -243.045
+0 ||| A D A D E ||| -243.045
+0 ||| A E C B D ||| -243.045
+0 ||| A C C C E ||| -243.045
+0 ||| A D B C E ||| -243.045
+0 ||| A E D D B ||| -243.045
+0 ||| A C A E E ||| -243.045
+0 ||| A A C D E ||| -243.045
+0 ||| A D E B D ||| -243.045
+0 ||| A B C E D ||| -243.045
+0 ||| A B B D E ||| -243.045
+0 ||| A C D D D ||| -243.045
+0 ||| A D C E C ||| -243.045
+0 ||| A E E B C ||| -243.045
+0 ||| A B E E C ||| -243.045
+0 ||| A A E C E ||| -243.045
+0 ||| A A B E E ||| -243.045
+0 ||| A E E A D ||| -243.045
+0 ||| D E C C C ||| -244.045
+0 ||| C C E A E ||| -244.045
+0 ||| D D E C C ||| -244.045
+0 ||| E B D C D ||| -244.045
+0 ||| C E B E B ||| -244.045
+0 ||| C C E E B ||| -244.045
+0 ||| D A D C E ||| -244.045
+0 ||| E E A D C ||| -244.045
+0 ||| C C B E D ||| -244.045
+0 ||| D E D B C ||| -244.045
+0 ||| E A D E C ||| -244.045
+0 ||| C E E C B ||| -244.045
+0 ||| D B D E C ||| -244.045
+0 ||| E C D B D ||| -244.045
+0 ||| C B D B E ||| -244.045
+0 ||| C C E C D ||| -244.045
+0 ||| D B B E D ||| -244.045
+0 ||| D C B C E ||| -244.045
+0 ||| C D B D D ||| -244.045
+0 ||| E B E D B ||| -244.045
+0 ||| E C E C C ||| -244.045
+0 ||| D E D A D ||| -244.045
+0 ||| E E A A E ||| -244.045
+0 ||| E C A E D ||| -244.045
+0 ||| B E C B D ||| -244.045
+0 ||| E B B D D ||| -244.045
+0 ||| C D D E B ||| -244.045
+0 ||| E E C C B ||| -244.045
+0 ||| E C C E B ||| -244.045
+0 ||| D E E B B ||| -244.045
+0 ||| E A E E B ||| -244.045
+0 ||| E E D B B ||| -244.045
+0 ||| C D E D B ||| -244.045
+0 ||| B B D C E ||| -244.045
+0 ||| D A B D E ||| -244.045
+0 ||| B A E C E ||| -244.045
+0 ||| D D C D C ||| -244.045
+0 ||| E A B E D ||| -244.045
+0 ||| C B D D D ||| -244.045
+0 ||| C E C D B ||| -244.045
+0 ||| E C B E C ||| -244.045
+0 ||| B C C C E ||| -244.045
+0 ||| B E E A D ||| -244.045
+0 ||| C B C C E ||| -244.045
+0 ||| E A E C D ||| -244.045
+0 ||| E D B E B ||| -244.045
+0 ||| C A E D D ||| -244.045
+0 ||| E C C D C ||| -244.045
+0 ||| C A E B E ||| -244.045
+0 ||| C B A E E ||| -244.045
+0 ||| C A D E D ||| -244.045
+0 ||| B B B D E ||| -244.045
+0 ||| C E B C D ||| -244.045
+0 ||| E E A C D ||| -244.045
+0 ||| E A C D D ||| -244.045
+0 ||| C D D A E ||| -244.045
+0 ||| C C C B E ||| -244.045
+0 ||| D D D B D ||| -244.045
+0 ||| C E A D D ||| -244.045
+0 ||| C E B D C ||| -244.045
+0 ||| C D B B E ||| -244.045
+0 ||| E B D A E ||| -244.045
+0 ||| D B E A E ||| -244.045
+0 ||| D A C E D ||| -244.045
+0 ||| C E B A E ||| -244.045
+0 ||| D D A E D ||| -244.045
+0 ||| B E A C E ||| -244.045
+0 ||| D B E C D ||| -244.045
+0 ||| D D C A E ||| -244.045
+0 ||| E D D C C ||| -244.045
+0 ||| E D B A E ||| -244.045
+0 ||| C C C D D ||| -244.045
+0 ||| E D A D D ||| -244.045
+0 ||| D C E B D ||| -244.045
+0 ||| D B E D C ||| -244.045
+0 ||| E A E D C ||| -244.045
+0 ||| E C C C D ||| -244.045
+0 ||| B C D B E ||| -244.045
+0 ||| D B C D D ||| -244.045
+0 ||| E D B C D ||| -244.045
+0 ||| D E B B D ||| -244.045
+0 ||| D D C C D ||| -244.045
+0 ||| E B D E B ||| -244.045
+0 ||| B D E B D ||| -244.045
+0 ||| C D D C D ||| -244.045
+0 ||| B A B E E ||| -244.045
+0 ||| E A C B E ||| -244.045
+0 ||| B A C D E ||| -244.045
+0 ||| D C A D E ||| -244.045
+0 ||| B C D D D ||| -244.045
+0 ||| C C E D C ||| -244.045
+0 ||| D E A E C ||| -244.045
+0 ||| C C D E C ||| -244.045
+0 ||| D B E E B ||| -244.045
+0 ||| D E C E A ||| -244.045
+0 ||| E B D D C ||| -244.045
+0 ||| E D E D A ||| -244.045
+0 ||| E D B D C ||| -244.045
+0 ||| D D E E A ||| -244.045
+0 ||| D A E E C ||| -244.045
+0 ||| E E B E A ||| -244.045
+0 ||| B D A D E ||| -244.045
+0 ||| E D D E A ||| -244.045
+0 ||| E D C D B ||| -244.045
+0 ||| E E C D A ||| -244.045
+0 ||| C D D D C ||| -244.045
+0 ||| C E E D A ||| -244.045
+0 ||| D D C E B ||| -244.045
+0 ||| C E D E A ||| -244.045
+0 ||| E E A E B ||| -244.045
+0 ||| E E E C A ||| -244.045
+0 ||| E E B C C ||| -244.045
+0 ||| E C E E A ||| -244.045
+0 ||| E D E C B ||| -244.045
+0 ||| B E D D B ||| -244.045
+0 ||| D C C E C ||| -244.045
+0 ||| D D B E C ||| -244.045
+0 ||| B E E B C ||| -244.045
+0 ||| B D C E C ||| -244.045
+0 ||| B B E E C ||| -244.045
+0 ||| E A E A E ||| -244.045
+0 ||| E D A B E ||| -244.045
+0 ||| E C C A E ||| -244.045
+0 ||| E B B B E ||| -244.045
+0 ||| B D B C E ||| -244.045
+0 ||| C E D C C ||| -244.045
+0 ||| D B C B E ||| -244.045
+0 ||| B C A E E ||| -244.045
+0 ||| B B C E D ||| -244.045
+0 ||| C E A B E ||| -244.045
+0 ||| A A E E D ||| -245.045
+0 ||| A E C A E ||| -245.045
+0 ||| A D D E C ||| -245.045
+0 ||| A C B D E ||| -245.045
+0 ||| A B D E D ||| -245.045
+0 ||| A A D D E ||| -245.045
+0 ||| A C D C E ||| -245.045
+0 ||| A C C E D ||| -245.045
+0 ||| A B E B E ||| -245.045
+0 ||| A D C B E ||| -245.045
+0 ||| A C E E C ||| -245.045
+0 ||| A D E D C ||| -245.045
+0 ||| A E C D C ||| -245.045
+0 ||| A E E E A ||| -245.045
+0 ||| A E E C C ||| -245.045
+0 ||| A B E D D ||| -245.045
+0 ||| A E C E B ||| -245.045
+0 ||| A E D B D ||| -245.045
+0 ||| A D E A E ||| -245.045
+0 ||| A D E C D ||| -245.045
+0 ||| A D B E D ||| -245.045
+0 ||| A E C C D ||| -245.045
+0 ||| A D C D D ||| -245.045
+0 ||| A E B E C ||| -245.045
+0 ||| A E A E D ||| -245.045
+0 ||| A D E E B ||| -245.045
+0 ||| E D D D B ||| -246.045
+0 ||| B D D E C ||| -246.045
+0 ||| E C D E B ||| -246.045
+0 ||| E E C B C ||| -246.045
+0 ||| D C B E D ||| -246.045
+0 ||| D D D D C ||| -246.045
+0 ||| B E A E D ||| -246.045
+0 ||| C E D D B ||| -246.045
+0 ||| C A B E E ||| -246.045
+0 ||| B C B D E ||| -246.045
+0 ||| E C D A E ||| -246.045
+0 ||| C A E C E ||| -246.045
+0 ||| D C E A E ||| -246.045
+0 ||| E B B C E ||| -246.045
+0 ||| C D B C E ||| -246.045
+0 ||| E B A D E ||| -246.045
+0 ||| E C B B E ||| -246.045
+0 ||| D C E E B ||| -246.045
+0 ||| E D A C E ||| -246.045
+0 ||| B E C A E ||| -246.045
+0 ||| C B D C E ||| -246.045
+0 ||| B D E A E ||| -246.045
+0 ||| D A E B E ||| -246.045
+0 ||| B B E B E ||| -246.045
+0 ||| C D A D E ||| -246.045
+0 ||| E A A E E ||| -246.045
+0 ||| C C A E E ||| -246.045
+0 ||| B D E C D ||| -246.045
+0 ||| D B D B E ||| -246.045
+0 ||| D C C D D ||| -246.045
+0 ||| C B E E C ||| -246.045
+0 ||| D A E D D ||| -246.045
+0 ||| C E A C E ||| -246.045
+0 ||| C E E B C ||| -246.045
+0 ||| D D D A E ||| -246.045
+0 ||| D C E C D ||| -246.045
+0 ||| B C D C E ||| -246.045
+0 ||| E A C C E ||| -246.045
+0 ||| D D B D D ||| -246.045
+0 ||| D B C C E ||| -246.045
+0 ||| D D B B E ||| -246.045
+0 ||| D B D D D ||| -246.045
+0 ||| B B D E D ||| -246.045
+0 ||| B D E D C ||| -246.045
+0 ||| C A C D E ||| -246.045
+0 ||| D B A E E ||| -246.045
+0 ||| D E B A E ||| -246.045
+0 ||| B B E D D ||| -246.045
+0 ||| E A D D D ||| -246.045
+0 ||| C C D D D ||| -246.045
+0 ||| D E A D D ||| -246.045
+0 ||| E C E D B ||| -246.045
+0 ||| D E B E B ||| -246.045
+0 ||| C B B D E ||| -246.045
+0 ||| B A D D E ||| -246.045
+0 ||| B C C E D ||| -246.045
+0 ||| D C D E C ||| -246.045
+0 ||| D D D E B ||| -246.045
+0 ||| C C C C E ||| -246.045
+0 ||| E D C B D ||| -246.045
+0 ||| E E D C B ||| -246.045
+0 ||| D D E D B ||| -246.045
+0 ||| B D C B E ||| -246.045
+0 ||| B E C E B ||| -246.045
+0 ||| D C E D C ||| -246.045
+0 ||| C E E A D ||| -246.045
+0 ||| B E C D C ||| -246.045
+0 ||| E D E B C ||| -246.045
+0 ||| D E D E A ||| -246.045
+0 ||| B E C C D ||| -246.045
+0 ||| C C D B E ||| -246.045
+0 ||| C D E B D ||| -246.045
+0 ||| D E E D A ||| -246.045
+0 ||| C D C E C ||| -246.045
+0 ||| D C C B E ||| -246.045
+0 ||| B E E E A ||| -246.045
+0 ||| D A D E D ||| -246.045
+0 ||| E E D D A ||| -246.045
+0 ||| B D E E B ||| -246.045
+0 ||| B D B E D ||| -246.045
+0 ||| E C D C D ||| -246.045
+0 ||| B E E C C ||| -246.045
+0 ||| E B C E C ||| -246.045
+0 ||| E C D D C ||| -246.045
+0 ||| D E D C C ||| -246.045
+0 ||| B C E E C ||| -246.045
+0 ||| E C B D D ||| -246.045
+0 ||| C B C E D ||| -246.045
+0 ||| E B E B D ||| -246.045
+0 ||| D D D C D ||| -246.045
+0 ||| B A E E D ||| -246.045
+0 ||| B E B E C ||| -246.045
+0 ||| B E D B D ||| -246.045
+0 ||| D E B C D ||| -246.045
+0 ||| E A D B E ||| -246.045
+0 ||| D E A B E ||| -246.045
+0 ||| D E E C B ||| -246.045
+0 ||| E E C A D ||| -246.045
+0 ||| E E E A C ||| -246.045
+0 ||| D E B D C ||| -246.045
+0 ||| B D C D D ||| -246.045
+0 ||| E E B D B ||| -246.045
+0 ||| C E C B D ||| -246.045
+0 ||| E D E A D ||| -246.045
+0 ||| D E C D B ||| -246.045
+0 ||| A C E B E ||| -247.045
+0 ||| A E B B E ||| -247.045
+0 ||| A B E C E ||| -247.045
+0 ||| A D C C E ||| -247.045
+0 ||| A B B E E ||| -247.045
+0 ||| A D D D D ||| -247.045
+0 ||| A E D D C ||| -247.045
+0 ||| A E D E B ||| -247.045
+0 ||| A E E D B ||| -247.045
+0 ||| A D A E E ||| -247.045
+0 ||| A E D A E ||| -247.045
+0 ||| A B C D E ||| -247.045
+0 ||| A A C E E ||| -247.045
+0 ||| A E B D D ||| -247.045
+0 ||| A C D E D ||| -247.045
+0 ||| A E D C D ||| -247.045
+0 ||| A D D B E ||| -247.045
+0 ||| A C E D D ||| -247.045
+0 ||| B C D E D ||| -248.045
+0 ||| B C E D D ||| -248.045
+0 ||| C D E D C ||| -248.045
+0 ||| B E D C D ||| -248.045
+0 ||| C C E E C ||| -248.045
+0 ||| D D E B D ||| -248.045
+0 ||| C E B E C ||| -248.045
+0 ||| D E C B D ||| -248.045
+0 ||| D E A C E ||| -248.045
+0 ||| C B D E D ||| -248.045
+0 ||| B B E C E ||| -248.045
+0 ||| C E C C D ||| -248.045
+0 ||| C E E C C ||| -248.045
+0 ||| E E D B C ||| -248.045
+0 ||| E B E D C ||| -248.045
+0 ||| D D A D E ||| -248.045
+0 ||| E D C C D ||| -248.045
+0 ||| E C A D E ||| -248.045
+0 ||| C D E E B ||| -248.045
+0 ||| D C C C E ||| -248.045
+0 ||| C D E A E ||| -248.045
+0 ||| C C D C E ||| -248.045
+0 ||| C D C B E ||| -248.045
+0 ||| B B B E E ||| -248.045
+0 ||| E B E C D ||| -248.045
+0 ||| E C B C E ||| -248.045
+0 ||| B B C D E ||| -248.045
+0 ||| C E C A E ||| -248.045
+0 ||| C D D E C ||| -248.045
+0 ||| E B C B E ||| -248.045
+0 ||| B D C C E ||| -248.045
+0 ||| D C D B E ||| -248.045
+0 ||| E A E E C ||| -248.045
+0 ||| E E C C C ||| -248.045
+0 ||| B D A E E ||| -248.045
+0 ||| D E E B C ||| -248.045
+0 ||| E C C E C ||| -248.045
+0 ||| C B E B E ||| -248.045
+0 ||| D A E C E ||| -248.045
+0 ||| D E D D B ||| -248.045
+0 ||| E A D C E ||| -248.045
+0 ||| D B D C E ||| -248.045
+0 ||| E D C E B ||| -248.045
+0 ||| B E E D B ||| -248.045
+0 ||| B D D B E ||| -248.045
+0 ||| E E E B B ||| -248.045
+0 ||| E B B E D ||| -248.045
+0 ||| C E C D C ||| -248.045
+0 ||| B E D A E ||| -248.045
+0 ||| B E B B E ||| -248.045
+0 ||| D B B D E ||| -248.045
+0 ||| B C E B E ||| -248.045
+0 ||| D C A E E ||| -248.045
+0 ||| E C E B D ||| -248.045
+0 ||| C E C E B ||| -248.045
+0 ||| E D B E C ||| -248.045
+0 ||| D A B E E ||| -248.045
+0 ||| E D A E D ||| -248.045
+0 ||| E B E E B ||| -248.045
+0 ||| C A D D E ||| -248.045
+0 ||| B A C E E ||| -248.045
+0 ||| D D B C E ||| -248.045
+0 ||| C E A E D ||| -248.045
+0 ||| E D E C C ||| -248.045
+0 ||| B E D D C ||| -248.045
+0 ||| E A B D E ||| -248.045
+0 ||| E B D E C ||| -248.045
+0 ||| D C D D D ||| -248.045
+0 ||| C D E C D ||| -248.045
+0 ||| C D C D D ||| -248.045
+0 ||| D B C E D ||| -248.045
+0 ||| E D C A E ||| -248.045
+0 ||| C C C E D ||| -248.045
+0 ||| C E D B D ||| -248.045
+0 ||| E A C E D ||| -248.045
+0 ||| C B E D D ||| -248.045
+0 ||| D B E E C ||| -248.045
+0 ||| B E B D D ||| -248.045
+0 ||| D E E A D ||| -248.045
+0 ||| C D B E D ||| -248.045
+0 ||| D D C E C ||| -248.045
+0 ||| E D C D C ||| -248.045
+0 ||| E B E A E ||| -248.045
+0 ||| E E D A D ||| -248.045
+0 ||| C C B D E ||| -248.045
+0 ||| D A C D E ||| -248.045
+0 ||| B E D E B ||| -248.045
+0 ||| E B C D D ||| -248.045
+0 ||| C A E E D ||| -248.045
+0 ||| E E A E C ||| -248.045
+0 ||| B D D D D ||| -248.045
+0 ||| E D E E A ||| -248.045
+0 ||| E E B B D ||| -248.045
+0 ||| E E C E A ||| -248.045
+0 ||| E D D B D ||| -248.045
+0 ||| C E E E A ||| -248.045
+0 ||| A D D C E ||| -249.045
+0 ||| A A E D E ||| -249.045
+0 ||| A D E E C ||| -249.045
+0 ||| A C E C E ||| -249.045
+0 ||| A C C D E ||| -249.045
+0 ||| A D B D E ||| -249.045
+0 ||| A B E E D ||| -249.045
+0 ||| A A D E E ||| -249.045
+0 ||| A E E B D ||| -249.045
+0 ||| A E A D E ||| -249.045
+0 ||| A E C E C ||| -249.045
+0 ||| A D C E D ||| -249.045
+0 ||| A C B E E ||| -249.045
+0 ||| A E B C E ||| -249.045
+0 ||| A B D D E ||| -249.045
+0 ||| D C E E C ||| -250.045
+0 ||| C C E B E ||| -250.045
+0 ||| C E E D B ||| -250.045
+0 ||| C E D D C ||| -250.045
+0 ||| E A E D D ||| -250.045
+0 ||| D E C C D ||| -250.045
+0 ||| E E B A E ||| -250.045
+0 ||| E E C D B ||| -250.045
+0 ||| E D E D B ||| -250.045
+0 ||| E D D D C ||| -250.045
+0 ||| D D E C D ||| -250.045
+0 ||| E C D E C ||| -250.045
+0 ||| B C E C E ||| -250.045
+0 ||| E E A D D ||| -250.045
+0 ||| E A D E D ||| -250.045
+0 ||| C B E C E ||| -250.045
+0 ||| D E D B D ||| -250.045
+0 ||| D B E B E ||| -250.045
+0 ||| D E C E B ||| -250.045
+0 ||| E B D B E ||| -250.045
+0 ||| D B D E D ||| -250.045
+0 ||| C E B D D ||| -250.045
+0 ||| B D B D E ||| -250.045
+0 ||| C D D B E ||| -250.045
+0 ||| E C C B E ||| -250.045
+0 ||| E E E D A ||| -250.045
+0 ||| E D D E B ||| -250.045
+0 ||| E B A E E ||| -250.045
+0 ||| C A C E E ||| -250.045
+0 ||| E E D E A ||| -250.045
+0 ||| D E C D C ||| -250.045
+0 ||| D A D D E ||| -250.045
+0 ||| D C D C E ||| -250.045
+0 ||| D E E E A ||| -250.045
+0 ||| B C B E E ||| -250.045
+0 ||| E E B E B ||| -250.045
+0 ||| B A D E E ||| -250.045
+0 ||| E C E C D ||| -250.045
+0 ||| E D B B E ||| -250.045
+0 ||| D D E E B ||| -250.045
+0 ||| D D D E C ||| -250.045
+0 ||| D D C D D ||| -250.045
+0 ||| D B E D D ||| -250.045
+0 ||| C D C C E ||| -250.045
+0 ||| E C E D C ||| -250.045
+0 ||| C D A E E ||| -250.045
+0 ||| D E B E C ||| -250.045
+0 ||| E C B E D ||| -250.045
+0 ||| E B C C E ||| -250.045
+0 ||| E C C D D ||| -250.045
+0 ||| C B C D E ||| -250.045
+0 ||| E E D C C ||| -250.045
+0 ||| C B B E E ||| -250.045
+0 ||| B D D C E ||| -250.045
+0 ||| D D E D C ||| -250.045
+0 ||| B E C E C ||| -250.045
+0 ||| B B D D E ||| -250.045
+0 ||| C E D A E ||| -250.045
+0 ||| B C C D E ||| -250.045
+0 ||| E D D C D ||| -250.045
+0 ||| D D C B E ||| -250.045
+0 ||| C E B B E ||| -250.045
+0 ||| D D E A E ||| -250.045
+0 ||| B E A D E ||| -250.045
+0 ||| C C D E D ||| -250.045
+0 ||| E D D A E ||| -250.045
+0 ||| D E C A E ||| -250.045
+0 ||| D E A E D ||| -250.045
+0 ||| C C E D D ||| -250.045
+0 ||| B D E E C ||| -250.045
+0 ||| E E A B E ||| -250.045
+0 ||| E E B C D ||| -250.045
+0 ||| E A E B E ||| -250.045
+0 ||| E D B D D ||| -250.045
+0 ||| E B D D D ||| -250.045
+0 ||| D A E E D ||| -250.045
+0 ||| C E D E B ||| -250.045
+0 ||| C D D D D ||| -250.045
+0 ||| E E B D C ||| -250.045
+0 ||| E C E E B ||| -250.045
+0 ||| E E E C B ||| -250.045
+0 ||| B A E D E ||| -250.045
+0 ||| B D C E D ||| -250.045
+0 ||| B B E E D ||| -250.045
+0 ||| B E E B D ||| -250.045
+0 ||| D C C E D ||| -250.045
+0 ||| D D B E D ||| -250.045
+0 ||| B E B C E ||| -250.045
+0 ||| D C B D E ||| -250.045
+0 ||| E C E A E ||| -250.045
+0 ||| C E D C D ||| -250.045
+0 ||| D E E C C ||| -250.045
+0 ||| A E C B E ||| -251.045
+0 ||| A E E A E ||| -251.045
+0 ||| A B C E E ||| -251.045
+0 ||| A D D E D ||| -251.045
+0 ||| A E B E D ||| -251.045
+0 ||| A D E B E ||| -251.045
+0 ||| A E D E C ||| -251.045
+0 ||| A D E D D ||| -251.045
+0 ||| A C D D E ||| -251.045
+0 ||| A C E E D ||| -251.045
+0 ||| A E C D D ||| -251.045
+0 ||| A E E E B ||| -251.045
+0 ||| A E E D C ||| -251.045
+0 ||| A E E C D ||| -251.045
+0 ||| E A E C E ||| -252.045
+0 ||| B E E E B ||| -252.045
+0 ||| D D D D D ||| -252.045
+0 ||| D D D B E ||| -252.045
+0 ||| E B D C E ||| -252.045
+0 ||| E E C B D ||| -252.045
+0 ||| B D D E D ||| -252.045
+0 ||| E E A C E ||| -252.045
+0 ||| C C B E E ||| -252.045
+0 ||| C D C E D ||| -252.045
+0 ||| C C E C E ||| -252.045
+0 ||| C D E E C ||| -252.045
+0 ||| C B E E D ||| -252.045
+0 ||| C D B D E ||| -252.045
+0 ||| B D E D D ||| -252.045
+0 ||| D B B E E ||| -252.045
+0 ||| E C A E E ||| -252.045
+0 ||| E B B D E ||| -252.045
+0 ||| B E C B E ||| -252.045
+0 ||| D E D A E ||| -252.045
+0 ||| C E B C E ||| -252.045
+0 ||| C E E B D ||| -252.045
+0 ||| D E E D B ||| -252.045
+0 ||| B E E D C ||| -252.045
+0 ||| D E D D C ||| -252.045
+0 ||| E D C E C ||| -252.045
+0 ||| D C D E D ||| -252.045
+0 ||| E E E B C ||| -252.045
+0 ||| E A B E E ||| -252.045
+0 ||| D C E D D ||| -252.045
+0 ||| C E C E C ||| -252.045
+0 ||| C B D D E ||| -252.045
+0 ||| E D E B D ||| -252.045
+0 ||| B E C D D ||| -252.045
+0 ||| B B C E E ||| -252.045
+0 ||| C C C D E ||| -252.045
+0 ||| D A C E E ||| -252.045
+0 ||| E B E E C ||| -252.045
+0 ||| E C D B E ||| -252.045
+0 ||| D B E C E ||| -252.045
+0 ||| C A E D E ||| -252.045
+0 ||| E C C C E ||| -252.045
+0 ||| D B C D E ||| -252.045
+0 ||| D D C C E ||| -252.045
+0 ||| E D B C E ||| -252.045
+0 ||| D E B B E ||| -252.045
+0 ||| B D E B E ||| -252.045
+0 ||| C D D C E ||| -252.045
+0 ||| E E E A D ||| -252.045
+0 ||| B E E C D ||| -252.045
+0 ||| C E A D E ||| -252.045
+0 ||| D D A E E ||| -252.045
+0 ||| E E D D B ||| -252.045
+0 ||| B C D D E ||| -252.045
+0 ||| E C D D D ||| -252.045
+0 ||| E B C E D ||| -252.045
+0 ||| D E D C D ||| -252.045
+0 ||| B C E E D ||| -252.045
+0 ||| B E B E D ||| -252.045
+0 ||| E A C D E ||| -252.045
+0 ||| B E D E C ||| -252.045
+0 ||| D C E B E ||| -252.045
+0 ||| E D A D E ||| -252.045
+0 ||| B E E A E ||| -252.045
+0 ||| D E B D D ||| -252.045
+0 ||| D E D E B ||| -252.045
+0 ||| C A D E E ||| -252.045
+0 ||| A B D E E ||| -253.045
+0 ||| A E A E E ||| -253.045
+0 ||| A A E E E ||| -253.045
+0 ||| A D B E E ||| -253.045
+0 ||| A C C E E ||| -253.045
+0 ||| A D C D E ||| -253.045
+0 ||| A B E D E ||| -253.045
+0 ||| A E D D D ||| -253.045
+0 ||| A E D B E ||| -253.045
+0 ||| A E C C E ||| -253.045
+0 ||| A D E C E ||| -253.045
+0 ||| D C B E E ||| -254.045
+0 ||| D E A D E ||| -254.045
+0 ||| E E C D C ||| -254.045
+0 ||| C C D D E ||| -254.045
+0 ||| D E E B D ||| -254.045
+0 ||| E E C E B ||| -254.045
+0 ||| E D E D C ||| -254.045
+0 ||| D E C E C ||| -254.045
+0 ||| C E B E D ||| -254.045
+0 ||| B E A E E ||| -254.045
+0 ||| E D E E B ||| -254.045
+0 ||| C E E E B ||| -254.045
+0 ||| B E D B E ||| -254.045
+0 ||| E B E D D ||| -254.045
+0 ||| E D D E C ||| -254.045
+0 ||| E E B E C ||| -254.045
+0 ||| E E C C D ||| -254.045
+0 ||| E E E E A ||| -254.045
+0 ||| C D E D D ||| -254.045
+0 ||| E A E E D ||| -254.045
+0 ||| C D D E D ||| -254.045
+0 ||| B B D E E ||| -254.045
+0 ||| D D E E C ||| -254.045
+0 ||| D C C D E ||| -254.045
+0 ||| E D E A E ||| -254.045
+0 ||| D B D D E ||| -254.045
+0 ||| D D B D E ||| -254.045
+0 ||| E C C E D ||| -254.045
+0 ||| C B C E E ||| -254.045
+0 ||| E E D B D ||| -254.045
+0 ||| B B E D E ||| -254.045
+0 ||| E A D D E ||| -254.045
+0 ||| C E C D D ||| -254.045
+0 ||| D C E C E ||| -254.045
+0 ||| B C C E E ||| -254.045
+0 ||| C E E C D ||| -254.045
+0 ||| E D B E D ||| -254.045
+0 ||| C E E A E ||| -254.045
+0 ||| E D C B E ||| -254.045
+0 ||| B D E C E ||| -254.045
+0 ||| B E C C E ||| -254.045
+0 ||| C E E D C ||| -254.045
+0 ||| D D C E D ||| -254.045
+0 ||| E E A E D ||| -254.045
+0 ||| E E C A E ||| -254.045
+0 ||| E C B D E ||| -254.045
+0 ||| D A D E E ||| -254.045
+0 ||| B E D D D ||| -254.045
+0 ||| E C D C E ||| -254.045
+0 ||| C E C B E ||| -254.045
+0 ||| E D E C D ||| -254.045
+0 ||| E D C D D ||| -254.045
+0 ||| D A E D E ||| -254.045
+0 ||| E B D E D ||| -254.045
+0 ||| D B E E D ||| -254.045
+0 ||| C C E E D ||| -254.045
+0 ||| D E B C E ||| -254.045
+0 ||| E B E B E ||| -254.045
+0 ||| B A E E E ||| -254.045
+0 ||| D D D C E ||| -254.045
+0 ||| E E E C C ||| -254.045
+0 ||| C E D E C ||| -254.045
+0 ||| E C E E C ||| -254.045
+0 ||| B D C D E ||| -254.045
+0 ||| C D E B E ||| -254.045
+0 ||| B D B E E ||| -254.045
+0 ||| A C E D E ||| -255.045
+0 ||| A D D D E ||| -255.045
+0 ||| A E B D E ||| -255.045
+0 ||| A D E E D ||| -255.045
+0 ||| A E E E C ||| -255.045
+0 ||| A E D C E ||| -255.045
+0 ||| A C D E E ||| -255.045
+0 ||| A E C E D ||| -255.045
+0 ||| D E E A E ||| -256.045
+0 ||| C E A E E ||| -256.045
+0 ||| D E E C D ||| -256.045
+0 ||| B E E E C ||| -256.045
+0 ||| E E B D D ||| -256.045
+0 ||| E C D E D ||| -256.045
+0 ||| E D D D D ||| -256.045
+0 ||| E D A E E ||| -256.045
+0 ||| B C D E E ||| -256.045
+0 ||| B C E D E ||| -256.045
+0 ||| E E E D B ||| -256.045
+0 ||| B D D D E ||| -256.045
+0 ||| C B D E E ||| -256.045
+0 ||| D E C D D ||| -256.045
+0 ||| D E E E B ||| -256.045
+0 ||| E E D E B ||| -256.045
+0 ||| E B E C E ||| -256.045
+0 ||| D E C B E ||| -256.045
+0 ||| D D E D D ||| -256.045
+0 ||| D E E D C ||| -256.045
+0 ||| D D D E D ||| -256.045
+0 ||| E B B E E ||| -256.045
+0 ||| C E C C E ||| -256.045
+0 ||| C E D D D ||| -256.045
+0 ||| D E B E D ||| -256.045
+0 ||| E E D C D ||| -256.045
+0 ||| E C E B E ||| -256.045
+0 ||| D E D E C ||| -256.045
+0 ||| D C E E D ||| -256.045
+0 ||| E D C C E ||| -256.045
+0 ||| B E B D E ||| -256.045
+0 ||| B E C E D ||| -256.045
+0 ||| E D D B E ||| -256.045
+0 ||| B E D C E ||| -256.045
+0 ||| C B E D E ||| -256.045
+0 ||| C E D B E ||| -256.045
+0 ||| C C C E E ||| -256.045
+0 ||| D B C E E ||| -256.045
+0 ||| E C E D D ||| -256.045
+0 ||| D C D D E ||| -256.045
+0 ||| C D E C E ||| -256.045
+0 ||| C D C D E ||| -256.045
+0 ||| E E D D C ||| -256.045
+0 ||| B D E E D ||| -256.045
+0 ||| C A E E E ||| -256.045
+0 ||| E A C E E ||| -256.045
+0 ||| C D B E E ||| -256.045
+0 ||| E B C D E ||| -256.045
+0 ||| E E D A E ||| -256.045
+0 ||| E E B B E ||| -256.045
+0 ||| D D E B E ||| -256.045
+0 ||| A E E D D ||| -257.045
+0 ||| A D C E E ||| -257.045
+0 ||| A B E E E ||| -257.045
+0 ||| A E D E D ||| -257.045
+0 ||| A E E B E ||| -257.045
+0 ||| C C E D E ||| -258.045
+

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/19b557bc/joshua-core/src/test/resources/kenlm/oilers.kenlm
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/resources/kenlm/oilers.kenlm b/joshua-core/src/test/resources/kenlm/oilers.kenlm
new file mode 100644
index 0000000..e343d7d
Binary files /dev/null and b/joshua-core/src/test/resources/kenlm/oilers.kenlm differ



[09/50] [abbrv] incubator-joshua git commit: removed alignments from test, created new test with alignments (currently not working...)

Posted by mj...@apache.org.
removed alignments from test, created new test with alignments (currently not working...)


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/cd3ff0c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/cd3ff0c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/cd3ff0c6

Branch: refs/heads/7
Commit: cd3ff0c6d0d2ad959cd4f292d9ee02f4e7da8b0a
Parents: d6820c6
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 07:01:38 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 07:01:38 2016 -0500

----------------------------------------------------------------------
 .../phrase/decode/PhraseDecodingTest.java       | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/cd3ff0c6/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
index e81b0de..d3db223 100644
--- a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
+++ b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
@@ -18,8 +18,6 @@
  */
  package org.apache.joshua.decoder.phrase.decode;
 
-import static com.google.common.base.Charsets.UTF_8;
-import static java.nio.file.Files.readAllBytes;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
@@ -42,8 +40,9 @@ public class PhraseDecodingTest {
 
   private static final String CONFIG = "resources/phrase_decoder/config";
   private static final String INPUT = "una estrategia republicana para obstaculizar la reelecci�n de Obama";
-  private static final Path GOLD_PATH = Paths.get("resources/phrase_decoder/output.gold");
-
+  private static final String OUTPUT = "0 ||| a strategy republican to hinder reelection Obama ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";
+  private static final String OUTPUT_WITH_ALIGNMENTS = "0 ||| a strategy |0-1| republican |2-2| to hinder |3-4| reelection |5-6| Obama |7-8| ||| tm_pt_0=-9.702 tm_pt_1=-10.800 tm_pt_2=-7.543 tm_pt_3=-8.555 lm_0=-19.117 OOVPenalty=0.000 WordPenalty=-3.040 Distortion=0.000 PhrasePenalty=5.000 ||| -7.496";
+  
   private JoshuaConfiguration joshuaConfig = null;
   private Decoder decoder = null;
 
@@ -62,14 +61,21 @@ public class PhraseDecodingTest {
 
   @Test(enabled = true)
   public void givenInput_whenPhraseDecoding_thenOutputIsAsExpected() throws IOException {
-    final String translation = decode(INPUT).toString();
-    final String gold = new String(readAllBytes(GOLD_PATH), UTF_8);
+    final String translation = decode(INPUT).toString().trim();
+    final String gold = OUTPUT;
+    assertEquals(translation, gold);
+  }
+  
+  @Test(enabled = false)
+  public void givenInput_whenPhraseDecodingWithAlignments_thenOutputHasAlignments() throws IOException {
+    final String translation = decode(INPUT).toString().trim();
+    final String gold = OUTPUT_WITH_ALIGNMENTS;
     assertEquals(translation, gold);
   }
 
   private Translation decode(String input) {
     final Sentence sentence = new Sentence(input, 0, joshuaConfig);
-    joshuaConfig.setVerbosity(2);
+//    joshuaConfig.setVerbosity(2);
     return decoder.decode(sentence);
   }
 


[16/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kbest_extraction/output.scores.gold
----------------------------------------------------------------------
diff --git a/src/test/resources/kbest_extraction/output.scores.gold b/src/test/resources/kbest_extraction/output.scores.gold
new file mode 100644
index 0000000..2f8b814
--- /dev/null
+++ b/src/test/resources/kbest_extraction/output.scores.gold
@@ -0,0 +1,3126 @@
+0 ||| A A A A A ||| -195.045
+0 ||| B A A A A ||| -196.045
+0 ||| C A A A A ||| -198.045
+0 ||| A B A A A ||| -199.045
+0 ||| B B A A A ||| -200.045
+0 ||| D A A A A ||| -200.045
+0 ||| A A A A B ||| -201.045
+0 ||| A A A B A ||| -201.045
+0 ||| A A B A A ||| -201.045
+0 ||| A C A A A ||| -201.045
+0 ||| B A A A B ||| -202.045
+0 ||| B A A B A ||| -202.045
+0 ||| B A B A A ||| -202.045
+0 ||| B C A A A ||| -202.045
+0 ||| C B A A A ||| -202.045
+0 ||| A A A C A ||| -203.045
+0 ||| C A A A B ||| -204.045
+0 ||| C A A B A ||| -204.045
+0 ||| B A A C A ||| -204.045
+0 ||| C A B A A ||| -204.045
+0 ||| E A A A A ||| -204.045
+0 ||| C C A A A ||| -204.045
+0 ||| D B A A A ||| -204.045
+0 ||| A A A A C ||| -205.045
+0 ||| A B A B A ||| -205.045
+0 ||| A B A A B ||| -205.045
+0 ||| A A C A A ||| -205.045
+0 ||| A B B A A ||| -205.045
+0 ||| A D A A A ||| -205.045
+0 ||| B A A A C ||| -206.045
+0 ||| B B A A B ||| -206.045
+0 ||| B B A B A ||| -206.045
+0 ||| D A A A B ||| -206.045
+0 ||| B A C A A ||| -206.045
+0 ||| D A A B A ||| -206.045
+0 ||| B B B A A ||| -206.045
+0 ||| C A A C A ||| -206.045
+0 ||| D A B A A ||| -206.045
+0 ||| B D A A A ||| -206.045
+0 ||| D C A A A ||| -206.045
+0 ||| A A B A B ||| -207.045
+0 ||| A A B B A ||| -207.045
+0 ||| A A A B B ||| -207.045
+0 ||| A B A C A ||| -207.045
+0 ||| A C A A B ||| -207.045
+0 ||| A C A B A ||| -207.045
+0 ||| A C B A A ||| -207.045
+0 ||| A A D A A ||| -207.045
+0 ||| C A A A C ||| -208.045
+0 ||| B A A B B ||| -208.045
+0 ||| C B A B A ||| -208.045
+0 ||| B A B A B ||| -208.045
+0 ||| B C A B A ||| -208.045
+0 ||| B C A A B ||| -208.045
+0 ||| B A B B A ||| -208.045
+0 ||| C B A A B ||| -208.045
+0 ||| D A A C A ||| -208.045
+0 ||| C A C A A ||| -208.045
+0 ||| B B A C A ||| -208.045
+0 ||| E B A A A ||| -208.045
+0 ||| B C B A A ||| -208.045
+0 ||| C B B A A ||| -208.045
+0 ||| C D A A A ||| -208.045
+0 ||| B A D A A ||| -208.045
+0 ||| A B A A C ||| -209.045
+0 ||| A A A C B ||| -209.045
+0 ||| A A B C A ||| -209.045
+0 ||| A B C A A ||| -209.045
+0 ||| A C A C A ||| -209.045
+0 ||| A A A D A ||| -209.045
+0 ||| C A A B B ||| -210.045
+0 ||| D A A A C ||| -210.045
+0 ||| C A B A B ||| -210.045
+0 ||| B A A C B ||| -210.045
+0 ||| C C A A B ||| -210.045
+0 ||| D B A A B ||| -210.045
+0 ||| B B A A C ||| -210.045
+0 ||| E A A A B ||| -210.045
+0 ||| D B A B A ||| -210.045
+0 ||| D A C A A ||| -210.045
+0 ||| E A A B A ||| -210.045
+0 ||| B A A D A ||| -210.045
+0 ||| D D A A A ||| -210.045
+0 ||| B C A C A ||| -210.045
+0 ||| C A D A A ||| -210.045
+0 ||| C A B B A ||| -210.045
+0 ||| E A B A A ||| -210.045
+0 ||| C B A C A ||| -210.045
+0 ||| E C A A A ||| -210.045
+0 ||| C C A B A ||| -210.045
+0 ||| B B C A A ||| -210.045
+0 ||| B A B C A ||| -210.045
+0 ||| C C B A A ||| -210.045
+0 ||| D B B A A ||| -210.045
+0 ||| A B A B B ||| -211.045
+0 ||| A B B B A ||| -211.045
+0 ||| A A A B C ||| -211.045
+0 ||| A D A B A ||| -211.045
+0 ||| A C A A C ||| -211.045
+0 ||| A A C B A ||| -211.045
+0 ||| A A C A B ||| -211.045
+0 ||| A C C A A ||| -211.045
+0 ||| A A B A C ||| -211.045
+0 ||| A B D A A ||| -211.045
+0 ||| A A A A D ||| -211.045
+0 ||| A A E A A ||| -211.045
+0 ||| A B B A B ||| -211.045
+0 ||| A E A A A ||| -211.045
+0 ||| A D A A B ||| -211.045
+0 ||| A D B A A ||| -211.045
+0 ||| B D A A B ||| -212.045
+0 ||| C B A A C ||| -212.045
+0 ||| B B B B A ||| -212.045
+0 ||| B A C A B ||| -212.045
+0 ||| D A A B B ||| -212.045
+0 ||| E A A C A ||| -212.045
+0 ||| B B A B B ||| -212.045
+0 ||| C A A D A ||| -212.045
+0 ||| B A A B C ||| -212.045
+0 ||| D C A B A ||| -212.045
+0 ||| B C A A C ||| -212.045
+0 ||| D B A C A ||| -212.045
+0 ||| B A A A D ||| -212.045
+0 ||| B A C B A ||| -212.045
+0 ||| D C A A B ||| -212.045
+0 ||| D A B B A ||| -212.045
+0 ||| B B B A B ||| -212.045
+0 ||| B D A B A ||| -212.045
+0 ||| C A A C B ||| -212.045
+0 ||| B A E A A ||| -212.045
+0 ||| B A B A C ||| -212.045
+0 ||| C C A C A ||| -212.045
+0 ||| D A B A B ||| -212.045
+0 ||| B C C A A ||| -212.045
+0 ||| C A B C A ||| -212.045
+0 ||| B E A A A ||| -212.045
+0 ||| D A D A A ||| -212.045
+0 ||| C B C A A ||| -212.045
+0 ||| B B D A A ||| -212.045
+0 ||| D C B A A ||| -212.045
+0 ||| B D B A A ||| -212.045
+0 ||| A C B A B ||| -213.045
+0 ||| A A D A B ||| -213.045
+0 ||| A A B B B ||| -213.045
+0 ||| A A A C C ||| -213.045
+0 ||| A B A C B ||| -213.045
+0 ||| A C A B B ||| -213.045
+0 ||| A B B C A ||| -213.045
+0 ||| A A A E A ||| -213.045
+0 ||| A C B B A ||| -213.045
+0 ||| A A D B A ||| -213.045
+0 ||| A B A D A ||| -213.045
+0 ||| A D A C A ||| -213.045
+0 ||| A A C C A ||| -213.045
+0 ||| A C D A A ||| -213.045
+0 ||| B C A B B ||| -214.045
+0 ||| B A B B B ||| -214.045
+0 ||| B C B A B ||| -214.045
+0 ||| C B B A B ||| -214.045
+0 ||| E B A A B ||| -214.045
+0 ||| C A A B C ||| -214.045
+0 ||| D A A C B ||| -214.045
+0 ||| C A C A B ||| -214.045
+0 ||| B B A C B ||| -214.045
+0 ||| C A B A C ||| -214.045
+0 ||| C D A A B ||| -214.045
+0 ||| B A D A B ||| -214.045
+0 ||| C B A B B ||| -214.045
+0 ||| E A A A C ||| -214.045
+0 ||| D B A A C ||| -214.045
+0 ||| C A A A D ||| -214.045
+0 ||| D A B C A ||| -214.045
+0 ||| C C A A C ||| -214.045
+0 ||| B A A C C ||| -214.045
+0 ||| B A D B A ||| -214.045
+0 ||| B A C C A ||| -214.045
+0 ||| B B B C A ||| -214.045
+0 ||| D C A C A ||| -214.045
+0 ||| D A A D A ||| -214.045
+0 ||| B B A D A ||| -214.045
+0 ||| C A C B A ||| -214.045
+0 ||| B A A E A ||| -214.045
+0 ||| C C C A A ||| -214.045
+0 ||| B D A C A ||| -214.045
+0 ||| E B A B A ||| -214.045
+0 ||| E B B A A ||| -214.045
+0 ||| B C B B A ||| -214.045
+0 ||| C B B B A ||| -214.045
+0 ||| C A E A A ||| -214.045
+0 ||| C D A B A ||| -214.045
+0 ||| C D B A A ||| -214.045
+0 ||| B C D A A ||| -214.045
+0 ||| E D A A A ||| -214.045
+0 ||| D B C A A ||| -214.045
+0 ||| C E A A A ||| -214.045
+0 ||| E A C A A ||| -214.045
+0 ||| C B D A A ||| -214.045
+0 ||| A B C A B ||| -215.045
+0 ||| A B B A C ||| -215.045
+0 ||| A D A A C ||| -215.045
+0 ||| A A C A C ||| -215.045
+0 ||| A B A B C ||| -215.045
+0 ||| A A B C B ||| -215.045
+0 ||| A C A C B ||| -215.045
+0 ||| A B A A D ||| -215.045
+0 ||| A A A D B ||| -215.045
+0 ||| A B C B A ||| -215.045
+0 ||| A C A D A ||| -215.045
+0 ||| A A D C A ||| -215.045
+0 ||| A C B C A ||| -215.045
+0 ||| A A B D A ||| -215.045
+0 ||| A B E A A ||| -215.045
+0 ||| A D C A A ||| -215.045
+0 ||| B B C A B ||| -216.045
+0 ||| E C A A B ||| -216.045
+0 ||| C C A B B ||| -216.045
+0 ||| B A B C B ||| -216.045
+0 ||| C C B B A ||| -216.045
+0 ||| C C B A B ||| -216.045
+0 ||| D B B A B ||| -216.045
+0 ||| E A A B B ||| -216.045
+0 ||| D A C B A ||| -216.045
+0 ||| B A C A C ||| -216.045
+0 ||| D A C A B ||| -216.045
+0 ||| D D A B A ||| -216.045
+0 ||| D A B A C ||| -216.045
+0 ||| B D A A C ||| -216.045
+0 ||| C C D A A ||| -216.045
+0 ||| D B A B B ||| -216.045
+0 ||| B A B D A ||| -216.045
+0 ||| B A A D B ||| -216.045
+0 ||| C A D B A ||| -216.045
+0 ||| B B A A D ||| -216.045
+0 ||| E A B B A ||| -216.045
+0 ||| D A A A D ||| -216.045
+0 ||| D C C A A ||| -216.045
+0 ||| D A A B C ||| -216.045
+0 ||| E C A B A ||| -216.045
+0 ||| C A D A B ||| -216.045
+0 ||| B B C B A ||| -216.045
+0 ||| B C A C B ||| -216.045
+0 ||| B D C A A ||| -216.045
+0 ||| C A B B B ||| -216.045
+0 ||| C D A C A ||| -216.045
+0 ||| D D A A B ||| -216.045
+0 ||| D B B B A ||| -216.045
+0 ||| C A A C C ||| -216.045
+0 ||| D D B A A ||| -216.045
+0 ||| B B A B C ||| -216.045
+0 ||| B A D C A ||| -216.045
+0 ||| C B A C B ||| -216.045
+0 ||| C A A E A ||| -216.045
+0 ||| E A B A B ||| -216.045
+0 ||| D B D A A ||| -216.045
+0 ||| D C A A C ||| -216.045
+0 ||| B C A D A ||| -216.045
+0 ||| B B B A C ||| -216.045
+0 ||| D E A A A ||| -216.045
+0 ||| C A C C A ||| -216.045
+0 ||| E A D A A ||| -216.045
+0 ||| C B B C A ||| -216.045
+0 ||| E C B A A ||| -216.045
+0 ||| B C B C A ||| -216.045
+0 ||| B B E A A ||| -216.045
+0 ||| C B A D A ||| -216.045
+0 ||| D A E A A ||| -216.045
+0 ||| E B A C A ||| -216.045
+0 ||| A D B A B ||| -217.045
+0 ||| A A C B B ||| -217.045
+0 ||| A C A B C ||| -217.045
+0 ||| A B B B B ||| -217.045
+0 ||| A B A C C ||| -217.045
+0 ||| A B D A B ||| -217.045
+0 ||| A A E A B ||| -217.045
+0 ||| A C C A B ||| -217.045
+0 ||| A E A A B ||| -217.045
+0 ||| A D A B B ||| -217.045
+0 ||| A A B B C ||| -217.045
+0 ||| A B D B A ||| -217.045
+0 ||| A A D A C ||| -217.045
+0 ||| A C B A C ||| -217.045
+0 ||| A B C C A ||| -217.045
+0 ||| A A A B D ||| -217.045
+0 ||| A C C B A ||| -217.045
+0 ||| A A B A D ||| -217.045
+0 ||| A D D A A ||| -217.045
+0 ||| A C A A D ||| -217.045
+0 ||| A D B B A ||| -217.045
+0 ||| A E A B A ||| -217.045
+0 ||| A C E A A ||| -217.045
+0 ||| A A E B A ||| -217.045
+0 ||| A E B A A ||| -217.045
+0 ||| A B A E A ||| -217.045
+0 ||| B B B B B ||| -218.045
+0 ||| E A A C B ||| -218.045
+0 ||| D C A B B ||| -218.045
+0 ||| B C A B C ||| -218.045
+0 ||| B D A B B ||| -218.045
+0 ||| B E A A B ||| -218.045
+0 ||| D A B B B ||| -218.045
+0 ||| B A E A B ||| -218.045
+0 ||| B A C B B ||| -218.045
+0 ||| B C B A C ||| -218.045
+0 ||| C C A C B ||| -218.045
+0 ||| C A B C B ||| -218.045
+0 ||| C A A D B ||| -218.045
+0 ||| D B A C B ||| -218.045
+0 ||| B C C A B ||| -218.045
+0 ||| B B C C A ||| -218.045
+0 ||| B A B B C ||| -218.045
+0 ||| B B D A B ||| -218.045
+0 ||| C B C A B ||| -218.045
+0 ||| C B E A A ||| -218.045
+0 ||| C B A A D ||| -218.045
+0 ||| D A D A B ||| -218.045
+0 ||| D C B A B ||| -218.045
+0 ||| E A B C A ||| -218.045
+0 ||| B D B A B ||| -218.045
+0 ||| E C A C A ||| -218.045
+0 ||| C B A B C ||| -218.045
+0 ||| B A E B A ||| -218.045
+0 ||| D A A C C ||| -218.045
+0 ||| D A C C A ||| -218.045
+0 ||| C B B A C ||| -218.045
+0 ||| C C B C A ||| -218.045
+0 ||| E B A A C ||| -218.045
+0 ||| C A B D A ||| -218.045
+0 ||| B A D A C ||| -218.045
+0 ||| C A D C A ||| -218.045
+0 ||| B B A C C ||| -218.045
+0 ||| C D C A A ||| -218.045
+0 ||| C A C A C ||| -218.045
+0 ||| D D A C A ||| -218.045
+0 ||| C D A A C ||| -218.045
+0 ||| B B D B A ||| -218.045
+0 ||| B A B A D ||| -218.045
+0 ||| E B C A A ||| -218.045
+0 ||| B C A A D ||| -218.045
+0 ||| D A D B A ||| -218.045
+0 ||| B A A B D ||| -218.045
+0 ||| B E A B A ||| -218.045
+0 ||| D C D A A ||| -218.045
+0 ||| D B B C A ||| -218.045
+0 ||| D B A D A ||| -218.045
+0 ||| E A A D A ||| -218.045
+0 ||| B D D A A ||| -218.045
+0 ||| C B C B A ||| -218.045
+0 ||| B C E A A ||| -218.045
+0 ||| B C C B A ||| -218.045
+0 ||| B E B A A ||| -218.045
+0 ||| C C A D A ||| -218.045
+0 ||| B D B B A ||| -218.045
+0 ||| D A A E A ||| -218.045
+0 ||| D C B B A ||| -218.045
+0 ||| B B A E A ||| -218.045
+0 ||| A B B C B ||| -219.045
+0 ||| A A A C D ||| -219.045
+0 ||| A B A D B ||| -219.045
+0 ||| A A A D C ||| -219.045
+0 ||| A C D A B ||| -219.045
+0 ||| A C A C C ||| -219.045
+0 ||| A A A E B ||| -219.045
+0 ||| A C B B B ||| -219.045
+0 ||| A A D B B ||| -219.045
+0 ||| A A C C B ||| -219.045
+0 ||| A D A C B ||| -219.045
+0 ||| A A B E A ||| -219.045
+0 ||| A A A A E ||| -219.045
+0 ||| A B C A C ||| -219.045
+0 ||| A D B C A ||| -219.045
+0 ||| A A B C C ||| -219.045
+0 ||| A E A C A ||| -219.045
+0 ||| A B D C A ||| -219.045
+0 ||| A C C C A ||| -219.045
+0 ||| A C D B A ||| -219.045
+0 ||| A A C D A ||| -219.045
+0 ||| A D A D A ||| -219.045
+0 ||| A B B D A ||| -219.045
+0 ||| A A E C A ||| -219.045
+0 ||| A C A E A ||| -219.045
+0 ||| E A A B C ||| -220.045
+0 ||| D C A C B ||| -220.045
+0 ||| D A C A C ||| -220.045
+0 ||| B B B C B ||| -220.045
+0 ||| B A C C B ||| -220.045
+0 ||| B A D B B ||| -220.045
+0 ||| B A B C C ||| -220.045
+0 ||| C C B A C ||| -220.045
+0 ||| B A A C D ||| -220.045
+0 ||| D A A D B ||| -220.045
+0 ||| E B B A B ||| -220.045
+0 ||| C C A B C ||| -220.045
+0 ||| B C A C C ||| -220.045
+0 ||| C A B A D ||| -220.045
+0 ||| C A A B D ||| -220.045
+0 ||| C C A A D ||| -220.045
+0 ||| D B B A C ||| -220.045
+0 ||| E C A A C ||| -220.045
+0 ||| B B C A C ||| -220.045
+0 ||| B A A D C ||| -220.045
+0 ||| E A A A D ||| -220.045
+0 ||| B B A D B ||| -220.045
+0 ||| C A D A C ||| -220.045
+0 ||| D A B C B ||| -220.045
+0 ||| D C B C A ||| -220.045
+0 ||| D B A B C ||| -220.045
+0 ||| D B A A D ||| -220.045
+0 ||| E B A B B ||| -220.045
+0 ||| C A C B B ||| -220.045
+0 ||| B A C D A ||| -220.045
+0 ||| B D A C B ||| -220.045
+0 ||| C C C A B ||| -220.045
+0 ||| B A A E B ||| -220.045
+0 ||| B A E C A ||| -220.045
+0 ||| D B C A B ||| -220.045
+0 ||| C A E A B ||| -220.045
+0 ||| B A B E A ||| -220.045
+0 ||| C B B B B ||| -220.045
+0 ||| B C B B B ||| -220.045
+0 ||| C D B B A ||| -220.045
+0 ||| D D A A C ||| -220.045
+0 ||| E D A A B ||| -220.045
+0 ||| B B D C A ||| -220.045
+0 ||| C D A B B ||| -220.045
+0 ||| C A B B C ||| -220.045
+0 ||| B D B C A ||| -220.045
+0 ||| B C D A B ||| -220.045
+0 ||| C D B A B ||| -220.045
+0 ||| D A D C A ||| -220.045
+0 ||| E A B A C ||| -220.045
+0 ||| B A A A E ||| -220.045
+0 ||| D A B D A ||| -220.045
+0 ||| C E A A B ||| -220.045
+0 ||| C B A C C ||| -220.045
+0 ||| B E A C A ||| -220.045
+0 ||| C B D A B ||| -220.045
+0 ||| E A C A B ||| -220.045
+0 ||| C B C C A ||| -220.045
+0 ||| E B D A A ||| -220.045
+0 ||| C A E B A ||| -220.045
+0 ||| E D B A A ||| -220.045
+0 ||| C B A E A ||| -220.045
+0 ||| E E A A A ||| -220.045
+0 ||| B C C C A ||| -220.045
+0 ||| D B E A A ||| -220.045
+0 ||| B B B D A ||| -220.045
+0 ||| C D D A A ||| -220.045
+0 ||| D C A D A ||| -220.045
+0 ||| D D C A A ||| -220.045
+0 ||| C C C B A ||| -220.045
+0 ||| C C E A A ||| -220.045
+0 ||| E B B B A ||| -220.045
+0 ||| C E B A A ||| -220.045
+0 ||| B C D B A ||| -220.045
+0 ||| E C C A A ||| -220.045
+0 ||| C E A B A ||| -220.045
+0 ||| E A E A A ||| -220.045
+0 ||| B C A E A ||| -220.045
+0 ||| D B C B A ||| -220.045
+0 ||| E D A B A ||| -220.045
+0 ||| E A C B A ||| -220.045
+0 ||| C B D B A ||| -220.045
+0 ||| B D A D A ||| -220.045
+0 ||| A E A A C ||| -221.045
+0 ||| A B B A D ||| -221.045
+0 ||| A A B D B ||| -221.045
+0 ||| A B B B C ||| -221.045
+0 ||| A A E A C ||| -221.045
+0 ||| A D B A C ||| -221.045
+0 ||| A A C B C ||| -221.045
+0 ||| A C B C B ||| -221.045
+0 ||| A B D A C ||| -221.045
+0 ||| A D A B C ||| -221.045
+0 ||| A C C A C ||| -221.045
+0 ||| A B E A B ||| -221.045
+0 ||| A A D C B ||| -221.045
+0 ||| A C A D B ||| -221.045
+0 ||| A B C B B ||| -221.045
+0 ||| A A C A D ||| -221.045
+0 ||| A D C A B ||| -221.045
+0 ||| A B A B D ||| -221.045
+0 ||| A D C B A ||| -221.045
+0 ||| A D A A D ||| -221.045
+0 ||| A B E B A ||| -221.045
+0 ||| A C D C A ||| -221.045
+0 ||| A E C A A ||| -221.045
+0 ||| A C B D A ||| -221.045
+0 ||| A D E A A ||| -221.045
+0 ||| A A D D A ||| -221.045
+0 ||| D C B A C ||| -222.045
+0 ||| C C D A B ||| -222.045
+0 ||| B A B D B ||| -222.045
+0 ||| B B C B B ||| -222.045
+0 ||| C A D B B ||| -222.045
+0 ||| E A B B B ||| -222.045
+0 ||| E C A B B ||| -222.045
+0 ||| B D A A D ||| -222.045
+0 ||| D C C A B ||| -222.045
+0 ||| D B D A B ||| -222.045
+0 ||| D D B A B ||| -222.045
+0 ||| D B B B B ||| -222.045
+0 ||| E C B A B ||| -222.045
+0 ||| C A A E B ||| -222.045
+0 ||| B A D C B ||| -222.045
+0 ||| C B B C B ||| -222.045
+0 ||| B B B A D ||| -222.045
+0 ||| B C A D B ||| -222.045
+0 ||| E A D A B ||| -222.045
+0 ||| D E A A B ||| -222.045
+0 ||| C A C C B ||| -222.045
+0 ||| C B A D B ||| -222.045
+0 ||| B B E A B ||| -222.045
+0 ||| B C B C B ||| -222.045
+0 ||| D A E A B ||| -222.045
+0 ||| E B A C B ||| -222.045
+0 ||| D C A B C ||| -222.045
+0 ||| C A B C C ||| -222.045
+0 ||| E A A C C ||| -222.045
+0 ||| B B B B C ||| -222.045
+0 ||| B A E A C ||| -222.045
+0 ||| B D A B C ||| -222.045
+0 ||| C C A C C ||| -222.045
+0 ||| D A B B C ||| -222.045
+0 ||| B E A A C ||| -222.045
+0 ||| B A C B C ||| -222.045
+0 ||| D A D A C ||| -222.045
+0 ||| B D B A C ||| -222.045
+0 ||| C A A D C ||| -222.045
+0 ||| B C C A C ||| -222.045
+0 ||| D B A C C ||| -222.045
+0 ||| C B C A C ||| -222.045
+0 ||| B A C A D ||| -222.045
+0 ||| B B D A C ||| -222.045
+0 ||| D A B A D ||| -222.045
+0 ||| D D A B B ||| -222.045
+0 ||| D A C B B ||| -222.045
+0 ||| B D C A B ||| -222.045
+0 ||| D C A A D ||| -222.045
+0 ||| C C B B B ||| -222.045
+0 ||| D A A B D ||| -222.045
+0 ||| B B A B D ||| -222.045
+0 ||| C A A A E ||| -222.045
+0 ||| C A A C D ||| -222.045
+0 ||| C D A C B ||| -222.045
+0 ||| B A D D A ||| -222.045
+0 ||| C C D B A ||| -222.045
+0 ||| D C C B A ||| -222.045
+0 ||| E A D B A ||| -222.045
+0 ||| B D C B A ||| -222.045
+0 ||| D E A B A ||| -222.045
+0 ||| E C B B A ||| -222.045
+0 ||| B B E B A ||| -222.045
+0 ||| E B A D A ||| -222.045
+0 ||| D A E B A ||| -222.045
+0 ||| C A B E A ||| -222.045
+0 ||| E A A E A ||| -222.045
+0 ||| D B D B A ||| -222.045
+0 ||| C A E C A ||| -222.045
+0 ||| C C A E A ||| -222.045
+0 ||| C B D C A ||| -222.045
+0 ||| B C D C A ||| -222.045
+0 ||| E B B C A ||| -222.045
+0 ||| C D A D A ||| -222.045
+0 ||| D D D A A ||| -222.045
+0 ||| C D B C A ||| -222.045
+0 ||| E C D A A ||| -222.045
+0 ||| E A C C A ||| -222.045
+0 ||| B E C A A ||| -222.045
+0 ||| D B A E A ||| -222.045
+0 ||| D E B A A ||| -222.045
+0 ||| D D B B A ||| -222.045
+0 ||| B D E A A ||| -222.045
+0 ||| E D A C A ||| -222.045
+0 ||| D C E A A ||| -222.045
+0 ||| C E A C A ||| -222.045
+0 ||| B C B D A ||| -222.045
+0 ||| D B C C A ||| -222.045
+0 ||| C B B D A ||| -222.045
+0 ||| C A C D A ||| -222.045
+0 ||| C C C C A ||| -222.045
+0 ||| A C A B D ||| -223.045
+0 ||| A D B B B ||| -223.045
+0 ||| A D D A B ||| -223.045
+0 ||| A B C C B ||| -223.045
+0 ||| A E B B A ||| -223.045
+0 ||| A C C B B ||| -223.045
+0 ||| A A B B D ||| -223.045
+0 ||| A D C C A ||| -223.045
+0 ||| A B D B B ||| -223.045
+0 ||| A A E B B ||| -223.045
+0 ||| A C E B A ||| -223.045
+0 ||| A C E A B ||| -223.045
+0 ||| A E B A B ||| -223.045
+0 ||| A D D B A ||| -223.045
+0 ||| A B A E B ||| -223.045
+0 ||| A B E C A ||| -223.045
+0 ||| A A D A D ||| -223.045
+0 ||| A E D A A ||| -223.045
+0 ||| A B A A E ||| -223.045
+0 ||| A A C E A ||| -223.045
+0 ||| A C B B C ||| -223.045
+0 ||| A B B E A ||| -223.045
+0 ||| A C D A C ||| -223.045
+0 ||| A D A E A ||| -223.045
+0 ||| A B A D C ||| -223.045
+0 ||| A B C D A ||| -223.045
+0 ||| A A A E C ||| -223.045
+0 ||| A B A C D ||| -223.045
+0 ||| A E A B B ||| -223.045
+0 ||| A C B A D ||| -223.045
+0 ||| A A D B C ||| -223.045
+0 ||| A B B C C ||| -223.045
+0 ||| A D A C C ||| -223.045
+0 ||| A A C C C ||| -223.045
+0 ||| B B B C C ||| -224.045
+0 ||| D A C C B ||| -224.045
+0 ||| D C B B B ||| -224.045
+0 ||| B A E B B ||| -224.045
+0 ||| E A C A C ||| -224.045
+0 ||| D C D B A ||| -224.045
+0 ||| E C A C B ||| -224.045
+0 ||| D D A C B ||| -224.045
+0 ||| C C D C A ||| -224.045
+0 ||| B B C C B ||| -224.045
+0 ||| D A A E B ||| -224.045
+0 ||| E B C B A ||| -224.045
+0 ||| C D C A B ||| -224.045
+0 ||| B C A B D ||| -224.045
+0 ||| C C B D A ||| -224.045
+0 ||| C A D C B ||| -224.045
+0 ||| B C B A D ||| -224.045
+0 ||| C D C B A ||| -224.045
+0 ||| C B E A B ||| -224.045
+0 ||| C A B D B ||| -224.045
+0 ||| B B E C A ||| -224.045
+0 ||| C C B C B ||| -224.045
+0 ||| D C A C C ||| -224.045
+0 ||| C B E B A ||| -224.045
+0 ||| B D B B B ||| -224.045
+0 ||| E B C A B ||| -224.045
+0 ||| E A D C A ||| -224.045
+0 ||| D B B C B ||| -224.045
+0 ||| B A B B D ||| -224.045
+0 ||| B B C D A ||| -224.045
+0 ||| B B D B B ||| -224.045
+0 ||| D A D B B ||| -224.045
+0 ||| D C C C A ||| -224.045
+0 ||| D C D A B ||| -224.045
+0 ||| B E A B B ||| -224.045
+0 ||| E C B C A ||| -224.045
+0 ||| C C A D B ||| -224.045
+0 ||| B D D A B ||| -224.045
+0 ||| D A C D A ||| -224.045
+0 ||| E A A D B ||| -224.045
+0 ||| D B A D B ||| -224.045
+0 ||| E C A D A ||| -224.045
+0 ||| B E B A B ||| -224.045
+0 ||| C B C B B ||| -224.045
+0 ||| E A B D A ||| -224.045
+0 ||| B C E A B ||| -224.045
+0 ||| D E A C A ||| -224.045
+0 ||| E A B C B ||| -224.045
+0 ||| B D D B A ||| -224.045
+0 ||| B B A E B ||| -224.045
+0 ||| B D C C A ||| -224.045
+0 ||| B B A C D ||| -224.045
+0 ||| B B B E A ||| -224.045
+0 ||| B C C B B ||| -224.045
+0 ||| B D A E A ||| -224.045
+0 ||| C B A B D ||| -224.045
+0 ||| D A E C A ||| -224.045
+0 ||| C A C A D ||| -224.045
+0 ||| D B D C A ||| -224.045
+0 ||| E B B A C ||| -224.045
+0 ||| B C E B A ||| -224.045
+0 ||| D A A C D ||| -224.045
+0 ||| C D E A A ||| -224.045
+0 ||| B A D A D ||| -224.045
+0 ||| D B B D A ||| -224.045
+0 ||| B A C C C ||| -224.045
+0 ||| E D C A A ||| -224.045
+0 ||| D A A D C ||| -224.045
+0 ||| D D A D A ||| -224.045
+0 ||| C B B A D ||| -224.045
+0 ||| C E C A A ||| -224.045
+0 ||| B A D B C ||| -224.045
+0 ||| D A B E A ||| -224.045
+0 ||| E B A A D ||| -224.045
+0 ||| E B E A A ||| -224.045
+0 ||| B B A D C ||| -224.045
+0 ||| D C A E A ||| -224.045
+0 ||| E B A B C ||| -224.045
+0 ||| B E D A A ||| -224.045
+0 ||| B D A C C ||| -224.045
+0 ||| B E B B A ||| -224.045
+0 ||| D A B C C ||| -224.045
+0 ||| B A C E A ||| -224.045
+0 ||| C D A B C ||| -224.045
+0 ||| D D B C A ||| -224.045
+0 ||| C A C B C ||| -224.045
+0 ||| C A D D A ||| -224.045
+0 ||| C E A A C ||| -224.045
+0 ||| D A A A E ||| -224.045
+0 ||| C B B B C ||| -224.045
+0 ||| B A A E C ||| -224.045
+0 ||| C D A A D ||| -224.045
+0 ||| C C C A C ||| -224.045
+0 ||| E D A A C ||| -224.045
+0 ||| C A E A C ||| -224.045
+0 ||| D B C A C ||| -224.045
+0 ||| B C B B C ||| -224.045
+0 ||| B B A A E ||| -224.045
+0 ||| B C D A C ||| -224.045
+0 ||| C D B A C ||| -224.045
+0 ||| C B D A C ||| -224.045
+0 ||| A C D B B ||| -225.045
+0 ||| A A B C D ||| -225.045
+0 ||| A C C C B ||| -225.045
+0 ||| A A C D B ||| -225.045
+0 ||| A D A D B ||| -225.045
+0 ||| A E A C B ||| -225.045
+0 ||| A B D C B ||| -225.045
+0 ||| A B B D B ||| -225.045
+0 ||| A A E D A ||| -225.045
+0 ||| A A E C B ||| -225.045
+0 ||| A C A E B ||| -225.045
+0 ||| A A B A E ||| -225.045
+0 ||| A C E C A ||| -225.045
+0 ||| A A A D D ||| -225.045
+0 ||| A D D C A ||| -225.045
+0 ||| A A B E B ||| -225.045
+0 ||| A A D E A ||| -225.045
+0 ||| A C A C D ||| -225.045
+0 ||| A C C D A ||| -225.045
+0 ||| A B C A D ||| -225.045
+0 ||| A D B D A ||| -225.045
+0 ||| A D B C B ||| -225.045
+0 ||| A E A D A ||| -225.045
+0 ||| A C A A E ||| -225.045
+0 ||| A C B E A ||| -225.045
+0 ||| A D C A C ||| -225.045
+0 ||| A B D D A ||| -225.045
+0 ||| A A A B E ||| -225.045
+0 ||| A E B C A ||| -225.045
+0 ||| A A B D C ||| -225.045
+0 ||| A C A D C ||| -225.045
+0 ||| A C B C C ||| -225.045
+0 ||| A A D C C ||| -225.045
+0 ||| A B E A C ||| -225.045
+0 ||| A B C B C ||| -225.045
+0 ||| C C E A B ||| -226.045
+0 ||| B B C B C ||| -226.045
+0 ||| B A B D C ||| -226.045
+0 ||| C C D A C ||| -226.045
+0 ||| D C C A C ||| -226.045
+0 ||| C B B C C ||| -226.045
+0 ||| E A B B C ||| -226.045
+0 ||| E C A B C ||| -226.045
+0 ||| B C C C B ||| -226.045
+0 ||| B A D C C ||| -226.045
+0 ||| C B A D C ||| -226.045
+0 ||| D B D A C ||| -226.045
+0 ||| D D B A C ||| -226.045
+0 ||| D B B B C ||| -226.045
+0 ||| C A A E C ||| -226.045
+0 ||| E C B A C ||| -226.045
+0 ||| C D A C C ||| -226.045
+0 ||| C A C C C ||| -226.045
+0 ||| B C A D C ||| -226.045
+0 ||| E E A A B ||| -226.045
+0 ||| C B A E B ||| -226.045
+0 ||| D E A A C ||| -226.045
+0 ||| E A D A C ||| -226.045
+0 ||| C B C C B ||| -226.045
+0 ||| E B D A B ||| -226.045
+0 ||| B B E A C ||| -226.045
+0 ||| D B E A B ||| -226.045
+0 ||| C D D A B ||| -226.045
+0 ||| B C B C C ||| -226.045
+0 ||| C A E B B ||| -226.045
+0 ||| B B B D B ||| -226.045
+0 ||| C C C B B ||| -226.045
+0 ||| D A C A D ||| -226.045
+0 ||| D A E A C ||| -226.045
+0 ||| C B A A E ||| -226.045
+0 ||| C A D B C ||| -226.045
+0 ||| E D B A B ||| -226.045
+0 ||| E B A C C ||| -226.045
+0 ||| D C D C A ||| -226.045
+0 ||| D D C A B ||| -226.045
+0 ||| B A A B E ||| -226.045
+0 ||| E A A B D ||| -226.045
+0 ||| E B A E A ||| -226.045
+0 ||| D C A D B ||| -226.045
+0 ||| D A D D A ||| -226.045
+0 ||| C C A B D ||| -226.045
+0 ||| E D B B A ||| -226.045
+0 ||| B A C D B ||| -226.045
+0 ||| B C E C A ||| -226.045
+0 ||| B A B C D ||| -226.045
+0 ||| C D A E A ||| -226.045
+0 ||| C C B A D ||| -226.045
+0 ||| B A D E A ||| -226.045
+0 ||| B B C A D ||| -226.045
+0 ||| C E B B A ||| -226.045
+0 ||| B C A C D ||| -226.045
+0 ||| C A C E A ||| -226.045
+0 ||| E C A A D ||| -226.045
+0 ||| C D C C A ||| -226.045
+0 ||| D B B A D ||| -226.045
+0 ||| E B D B A ||| -226.045
+0 ||| B A E C B ||| -226.045
+0 ||| E B C C A ||| -226.045
+0 ||| C A D A D ||| -226.045
+0 ||| C B E C A ||| -226.045
+0 ||| B A B E B ||| -226.045
+0 ||| E E A B A ||| -226.045
+0 ||| B C D B B ||| -226.045
+0 ||| D B E B A ||| -226.045
+0 ||| B D B C B ||| -226.045
+0 ||| D D C B A ||| -226.045
+0 ||| C D B B B ||| -226.045
+0 ||| C D D B A ||| -226.045
+0 ||| B B D C B ||| -226.045
+0 ||| C C E B A ||| -226.045
+0 ||| B E A C B ||| -226.045
+0 ||| E C C B A ||| -226.045
+0 ||| D A B D B ||| -226.045
+0 ||| B E B C A ||| -226.045
+0 ||| C E B A B ||| -226.045
+0 ||| B D D C A ||| -226.045
+0 ||| D B A B D ||| -226.045
+0 ||| D E C A A ||| -226.045
+0 ||| E B B B B ||| -226.045
+0 ||| B E A D A ||| -226.045
+0 ||| B C A A E ||| -226.045
+0 ||| D D E A A ||| -226.045
+0 ||| E A C B B ||| -226.045
+0 ||| C B B E A ||| -226.045
+0 ||| C E A B B ||| -226.045
+0 ||| E C E A A ||| -226.045
+0 ||| B A B A E ||| -226.045
+0 ||| B B D D A ||| -226.045
+0 ||| E C C A B ||| -226.045
+0 ||| C E D A A ||| -226.045
+0 ||| E D A B B ||| -226.045
+0 ||| C B C D A ||| -226.045
+0 ||| B A A D D ||| -226.045
+0 ||| E E B A A ||| -226.045
+0 ||| E A E A B ||| -226.045
+0 ||| B A E D A ||| -226.045
+0 ||| D B C B B ||| -226.045
+0 ||| E D D A A ||| -226.045
+0 ||| B C A E B ||| -226.045
+0 ||| B C C D A ||| -226.045
+0 ||| B D A D B ||| -226.045
+0 ||| D C B D A ||| -226.045
+0 ||| C B D B B ||| -226.045
+0 ||| B D B D A ||| -226.045
+0 ||| D C B C B ||| -226.045
+0 ||| B C B E A ||| -226.045
+0 ||| D D A A D ||| -226.045
+0 ||| E A E B A ||| -226.045
+0 ||| C A B B D ||| -226.045
+0 ||| E A B A D ||| -226.045
+0 ||| B D C A C ||| -226.045
+0 ||| D A D C B ||| -226.045
+0 ||| D A C B C ||| -226.045
+0 ||| D D A B C ||| -226.045
+0 ||| C C B B C ||| -226.045
+0 ||| C B A C D ||| -226.045
+0 ||| A C E A C ||| -227.045
+0 ||| A B D B C ||| -227.045
+0 ||| A E B A C ||| -227.045
+0 ||| A A E B C ||| -227.045
+0 ||| A D D A C ||| -227.045
+0 ||| A B C C C ||| -227.045
+0 ||| A E C A B ||| -227.045
+0 ||| A A D D B ||| -227.045
+0 ||| A D E A B ||| -227.045
+0 ||| A D B B C ||| -227.045
+0 ||| A C D C B ||| -227.045
+0 ||| A B E B B ||| -227.045
+0 ||| A D E B A ||| -227.045
+0 ||| A D C B B ||| -227.045
+0 ||| A B C E A ||| -227.045
+0 ||| A B A E C ||| -227.045
+0 ||| A E C B A ||| -227.045
+0 ||| A A A C E ||| -227.045
+0 ||| A E E A A ||| -227.045
+0 ||| A A C B D ||| -227.045
+0 ||| A C D D A ||| -227.045
+0 ||| A D B A D ||| -227.045
+0 ||| A E A A D ||| -227.045
+0 ||| A C C B C ||| -227.045
+0 ||| A A E A D ||| -227.045
+0 ||| A B B B D ||| -227.045
+0 ||| A D A B D ||| -227.045
+0 ||| A B D A D ||| -227.045
+0 ||| A C C A D ||| -227.045
+0 ||| A E A B C ||| -227.045
+0 ||| A C B D B ||| -227.045
+0 ||| E C B B B ||| -228.045
+0 ||| E C D A B ||| -228.045
+0 ||| B B E B B ||| -228.045
+0 ||| C A B E B ||| -228.045
+0 ||| E B A D B ||| -228.045
+0 ||| D A E B B ||| -228.045
+0 ||| C B D C B ||| -228.045
+0 ||| E A A E B ||| -228.045
+0 ||| D B D B B ||| -228.045
+0 ||| C D B C B ||| -228.045
+0 ||| C A E C B ||| -228.045
+0 ||| C C A E B ||| -228.045
+0 ||| B C D C B ||| -228.045
+0 ||| D D D A B ||| -228.045
+0 ||| E B B C B ||| -228.045
+0 ||| C D A D B ||| -228.045
+0 ||| B E C A B ||| -228.045
+0 ||| B D E A B ||| -228.045
+0 ||| E A C C B ||| -228.045
+0 ||| D B A E B ||| -228.045
+0 ||| D E B A B ||| -228.045
+0 ||| D D B B B ||| -228.045
+0 ||| B C B D B ||| -228.045
+0 ||| C E A C B ||| -228.045
+0 ||| E D A C B ||| -228.045
+0 ||| D C E A B ||| -228.045
+0 ||| D B C C B ||| -228.045
+0 ||| C A C D B ||| -228.045
+0 ||| D C B A D ||| -228.045
+0 ||| C B B D B ||| -228.045
+0 ||| C C C C B ||| -228.045
+0 ||| D C B B C ||| -228.045
+0 ||| D A C C C ||| -228.045
+0 ||| D C D A C ||| -228.045
+0 ||| C B C B C ||| -228.045
+0 ||| E A A D C ||| -228.045
+0 ||| B A D D B ||| -228.045
+0 ||| D C C B B ||| -228.045
+0 ||| C C D B B ||| -228.045
+0 ||| B D C B B ||| -228.045
+0 ||| B E B A C ||| -228.045
+0 ||| C B C A D ||| -228.045
+0 ||| B D A B D ||| -228.045
+0 ||| E A A C D ||| -228.045
+0 ||| C A B C D ||| -228.045
+0 ||| E C A C C ||| -228.045
+0 ||| D C A B D ||| -228.045
+0 ||| B B C C C ||| -228.045
+0 ||| B A E A D ||| -228.045
+0 ||| D D A C C ||| -228.045
+0 ||| B B B B D ||| -228.045
+0 ||| C D C A C ||| -228.045
+0 ||| D A A E C ||| -228.045
+0 ||| E A D B B ||| -228.045
+0 ||| D B A C D ||| -228.045
+0 ||| B A C B D ||| -228.045
+0 ||| C B E A C ||| -228.045
+0 ||| B D B B C ||| -228.045
+0 ||| D B B C C ||| -228.045
+0 ||| B E A A D ||| -228.045
+0 ||| D A B B D ||| -228.045
+0 ||| D B A D C ||| -228.045
+0 ||| E B C A C ||| -228.045
+0 ||| D E A B B ||| -228.045
+0 ||| B A E B C ||| -228.045
+0 ||| B C C A D ||| -228.045
+0 ||| C C A C D ||| -228.045
+0 ||| C C B C C ||| -228.045
+0 ||| D A D A D ||| -228.045
+0 ||| B B D B C ||| -228.045
+0 ||| E D B C A ||| -228.045
+0 ||| B D D A C ||| -228.045
+0 ||| B E A B C ||| -228.045
+0 ||| C A A D D ||| -228.045
+0 ||| C C A D C ||| -228.045
+0 ||| B D B A D ||| -228.045
+0 ||| B E C B A ||| -228.045
+0 ||| E A B C C ||| -228.045
+0 ||| D D D B A ||| -228.045
+0 ||| B C E A C ||| -228.045
+0 ||| C C E C A ||| -228.045
+0 ||| B B A E C ||| -228.045
+0 ||| D E B B A ||| -228.045
+0 ||| B C C B C ||| -228.045
+0 ||| E A B E A ||| -228.045
+0 ||| B A A C E ||| -228.045
+0 ||| E B B D A ||| -228.045
+0 ||| C A A B E ||| -228.045
+0 ||| D E D A A ||| -228.045
+0 ||| C A B A E ||| -228.045
+0 ||| E C A E A ||| -228.045
+0 ||| C C A A E ||| -228.045
+0 ||| E C D B A ||| -228.045
+0 ||| E A A A E ||| -228.045
+0 ||| B E E A A ||| -228.045
+0 ||| D B A A E ||| -228.045
+0 ||| C C B E A ||| -228.045
+0 ||| C A B D C ||| -228.045
+0 ||| C E B C A ||| -228.045
+0 ||| D A D B C ||| -228.045
+0 ||| D A C E A ||| -228.045
+0 ||| B B D A D ||| -228.045
+0 ||| B B C E A ||| -228.045
+0 ||| C A D C C ||| -228.045
+0 ||| E A E C A ||| -228.045
+0 ||| D B E C A ||| -228.045
+0 ||| B D E B A ||| -228.045
+0 ||| E B D C A ||| -228.045
+0 ||| C A E D A ||| -228.045
+0 ||| C D D C A ||| -228.045
+0 ||| E E A C A ||| -228.045
+0 ||| D D C C A ||| -228.045
+0 ||| D B B E A ||| -228.045
+0 ||| C A D E A ||| -228.045
+0 ||| C B D D A ||| -228.045
+0 ||| E C C C A ||| -228.045
+0 ||| C C C D A ||| -228.045
+0 ||| E A C D A ||| -228.045
+0 ||| C D B D A ||| -228.045
+0 ||| D D A E A ||| -228.045
+0 ||| B C D D A ||| -228.045
+0 ||| D B C D A ||| -228.045
+0 ||| D C E B A ||| -228.045
+0 ||| E D A D A ||| -228.045
+0 ||| C E A D A ||| -228.045
+0 ||| A B E C B ||| -229.045
+0 ||| A A C E B ||| -229.045
+0 ||| A D A E B ||| -229.045
+0 ||| A C B B D ||| -229.045
+0 ||| A C D B C ||| -229.045
+0 ||| A D C C B ||| -229.045
+0 ||| A C C C C ||| -229.045
+0 ||| A A C C D ||| -229.045
+0 ||| A D D B B ||| -229.045
+0 ||| A D A C D ||| -229.045
+0 ||| A B B C D ||| -229.045
+0 ||| A C E B B ||| -229.045
+0 ||| A A C D C ||| -229.045
+0 ||| A B B E B ||| -229.045
+0 ||| A D A D C ||| -229.045
+0 ||| A E A C C ||| -229.045
+0 ||| A B D C C ||| -229.045
+0 ||| A A B E C ||| -229.045
+0 ||| A C D A D ||| -229.045
+0 ||| A A E C C ||| -229.045
+0 ||| A E B B B ||| -229.045
+0 ||| A E D A B ||| -229.045
+0 ||| A B D E A ||| -229.045
+0 ||| A C A E C ||| -229.045
+0 ||| A B A B E ||| -229.045
+0 ||| A D E C A ||| -229.045
+0 ||| A A C A E ||| -229.045
+0 ||| A D B C C ||| -229.045
+0 ||| A C C E A ||| -229.045
+0 ||| A A D B D ||| -229.045
+0 ||| A B B D C ||| -229.045
+0 ||| A A E E A ||| -229.045
+0 ||| A B B A E ||| -229.045
+0 ||| A D A A E ||| -229.045
+0 ||| A D B E A ||| -229.045
+0 ||| A B A D D ||| -229.045
+0 ||| A A A E D ||| -229.045
+0 ||| A B E D A ||| -229.045
+0 ||| A B C D B ||| -229.045
+0 ||| A E C C A ||| -229.045
+0 ||| A E A E A ||| -229.045
+0 ||| A D C D A ||| -229.045
+0 ||| A E D B A ||| -229.045
+0 ||| B A C A E ||| -230.045
+0 ||| E E A A C ||| -230.045
+0 ||| D C D B B ||| -230.045
+0 ||| E B C B B ||| -230.045
+0 ||| C C D C B ||| -230.045
+0 ||| D C C C B ||| -230.045
+0 ||| B B B C D ||| -230.045
+0 ||| C C E A C ||| -230.045
+0 ||| B B C D B ||| -230.045
+0 ||| B C C C C ||| -230.045
+0 ||| C D C B B ||| -230.045
+0 ||| E A D C B ||| -230.045
+0 ||| C B E B B ||| -230.045
+0 ||| B B E C B ||| -230.045
+0 ||| B D C C B ||| -230.045
+0 ||| E C A D B ||| -230.045
+0 ||| C E C A B ||| -230.045
+0 ||| E C B C B ||| -230.045
+0 ||| B D D B B ||| -230.045
+0 ||| D E A C B ||| -230.045
+0 ||| E A B D B ||| -230.045
+0 ||| D B D C B ||| -230.045
+0 ||| B B B E B ||| -230.045
+0 ||| D D A D B ||| -230.045
+0 ||| D A E C B ||| -230.045
+0 ||| B D A E B ||| -230.045
+0 ||| E D C A B ||| -230.045
+0 ||| B C E B B ||| -230.045
+0 ||| D B B D B ||| -230.045
+0 ||| C D E A B ||| -230.045
+0 ||| C A E B C ||| -230.045
+0 ||| D C A E B ||| -230.045
+0 ||| C D B A D ||| -230.045
+0 ||| B B B D C ||| -230.045
+0 ||| D D B C B ||| -230.045
+0 ||| B E D A B ||| -230.045
+0 ||| B A C E B ||| -230.045
+0 ||| D A B E B ||| -230.045
+0 ||| C B D A D ||| -230.045
+0 ||| B E B B B ||| -230.045
+0 ||| C B A E C ||| -230.045
+0 ||| C D D A C ||| -230.045
+0 ||| C B C C C ||| -230.045
+0 ||| D B E A C ||| -230.045
+0 ||| E B D A C ||| -230.045
+0 ||| C C C B C ||| -230.045
+0 ||| D D C A C ||| -230.045
+0 ||| C D B B C ||| -230.045
+0 ||| D C A C D ||| -230.045
+0 ||| B E A C C ||| -230.045
+0 ||| C E B A C ||| -230.045
+0 ||| B B B A E ||| -230.045
+0 ||| C B D B C ||| -230.045
+0 ||| E D B A C ||| -230.045
+0 ||| D A C D B ||| -230.045
+0 ||| C C B D B ||| -230.045
+0 ||| B D A A E ||| -230.045
+0 ||| E B E A B ||| -230.045
+0 ||| C A A C E ||| -230.045
+0 ||| D C A D C ||| -230.045
+0 ||| B A C C D ||| -230.045
+0 ||| B C D A D ||| -230.045
+0 ||| D A A D D ||| -230.045
+0 ||| C A D D B ||| -230.045
+0 ||| E B B A D ||| -230.045
+0 ||| E D E A A ||| -230.045
+0 ||| D A B D C ||| -230.045
+0 ||| B A C D C ||| -230.045
+0 ||| C A C B D ||| -230.045
+0 ||| B E C C A ||| -230.045
+0 ||| B A D B D ||| -230.045
+0 ||| B A E C C ||| -230.045
+0 ||| C D A B D ||| -230.045
+0 ||| C B C E A ||| -230.045
+0 ||| B C D B C ||| -230.045
+0 ||| B A B E C ||| -230.045
+0 ||| B B D C C ||| -230.045
+0 ||| C D E B A ||| -230.045
+0 ||| D A B C D ||| -230.045
+0 ||| E B A B D ||| -230.045
+0 ||| B B A D D ||| -230.045
+0 ||| C E E A A ||| -230.045
+0 ||| B D A C D ||| -230.045
+0 ||| B D B C C ||| -230.045
+0 ||| C E C B A ||| -230.045
+0 ||| E B B B C ||| -230.045
+0 ||| C C C A D ||| -230.045
+0 ||| D A D E A ||| -230.045
+0 ||| C E A A D ||| -230.045
+0 ||| E D A B C ||| -230.045
+0 ||| D E B C A ||| -230.045
+0 ||| B D A D C ||| -230.045
+0 ||| E C C A C ||| -230.045
+0 ||| E E C A A ||| -230.045
+0 ||| E A C B C ||| -230.045
+0 ||| D C A A E ||| -230.045
+0 ||| D D D C A ||| -230.045
+0 ||| C E A B C ||| -230.045
+0 ||| B C A E C ||| -230.045
+0 ||| E D C B A ||| -230.045
+0 ||| C B B B D ||| -230.045
+0 ||| E A C A D ||| -230.045
+0 ||| B D C D A ||| -230.045
+0 ||| D B C B C ||| -230.045
+0 ||| B A A E D ||| -230.045
+0 ||| C C D D A ||| -230.045
+0 ||| E A E A C ||| -230.045
+0 ||| B C B B D ||| -230.045
+0 ||| E C D C A ||| -230.045
+0 ||| D A D C C ||| -230.045
+0 ||| C A E A D ||| -230.045
+0 ||| B B E D A ||| -230.045
+0 ||| E D A A D ||| -230.045
+0 ||| B B A B E ||| -230.045
+0 ||| E C B D A ||| -230.045
+0 ||| D B C A D ||| -230.045
+0 ||| D A B A E ||| -230.045
+0 ||| E B E B A ||| -230.045
+0 ||| D A A B E ||| -230.045
+0 ||| D C B C C ||| -230.045
+0 ||| D B D D A ||| -230.045
+0 ||| D C E C A ||| -230.045
+0 ||| B D E C A ||| -230.045
+0 ||| D E A D A ||| -230.045
+0 ||| D C C D A ||| -230.045
+0 ||| D D B D A ||| -230.045
+0 ||| D A E D A ||| -230.045
+0 ||| B B D E A ||| -230.045
+0 ||| B E A E A ||| -230.045
+0 ||| E A D D A ||| -230.045
+0 ||| B D B E A ||| -230.045
+0 ||| B A E E A ||| -230.045
+0 ||| D C B E A ||| -230.045
+0 ||| B E D B A ||| -230.045
+0 ||| B C C E A ||| -230.045
+0 ||| A D E A C ||| -231.045
+0 ||| A A D D C ||| -231.045
+0 ||| A E C A C ||| -231.045
+0 ||| A A B B E ||| -231.045
+0 ||| A C A B E ||| -231.045
+0 ||| A C B E B ||| -231.045
+0 ||| A B C B D ||| -231.045
+0 ||| A A D A E ||| -231.045
+0 ||| A D C B C ||| -231.045
+0 ||| A A D C D ||| -231.045
+0 ||| A B E B C ||| -231.045
+0 ||| A E A D B ||| -231.045
+0 ||| A C B D C ||| -231.045
+0 ||| A D B D B ||| -231.045
+0 ||| A C D C C ||| -231.045
+0 ||| A D D C B ||| -231.045
+0 ||| A C C D B ||| -231.045
+0 ||| A A D E B ||| -231.045
+0 ||| A C E C B ||| -231.045
+0 ||| A B D D B ||| -231.045
+0 ||| A B E A D ||| -231.045
+0 ||| A E D C A ||| -231.045
+0 ||| A A E D B ||| -231.045
+0 ||| A C B C D ||| -231.045
+0 ||| A C E D A ||| -231.045
+0 ||| A E B C B ||| -231.045
+0 ||| A C A D D ||| -231.045
+0 ||| A E B D A ||| -231.045
+0 ||| A C B A E ||| -231.045
+0 ||| A D C A D ||| -231.045
+0 ||| A C D E A ||| -231.045
+0 ||| A A B D D ||| -231.045
+0 ||| A B A C E ||| -231.045
+0 ||| A D D D A ||| -231.045
+0 ||| B A B B E ||| -232.045
+0 ||| C A C A E ||| -232.045
+0 ||| D E C B A ||| -232.045
+0 ||| D C E A C ||| -232.045
+0 ||| C A C E B ||| -232.045
+0 ||| B C E C B ||| -232.045
+0 ||| C A E C C ||| -232.045
+0 ||| C D B C C ||| -232.045
+0 ||| E C B B C ||| -232.045
+0 ||| E B A D C ||| -232.045
+0 ||| C A B E C ||| -232.045
+0 ||| E C D A C ||| -232.045
+0 ||| B B E B C ||| -232.045
+0 ||| D A E B C ||| -232.045
+0 ||| D B D B C ||| -232.045
+0 ||| E A A E C ||| -232.045
+0 ||| C B D C C ||| -232.045
+0 ||| E D A C C ||| -232.045
+0 ||| C D A D C ||| -232.045
+0 ||| E B B C C ||| -232.045
+0 ||| C C A E C ||| -232.045
+0 ||| E D B B B ||| -232.045
+0 ||| D D D A C ||| -232.045
+0 ||| B C D C C ||| -232.045
+0 ||| C E A C C ||| -232.045
+0 ||| E A C C C ||| -232.045
+0 ||| B D E A C ||| -232.045
+0 ||| D A D D B ||| -232.045
+0 ||| B E C A C ||| -232.045
+0 ||| B C B D C ||| -232.045
+0 ||| E B A E B ||| -232.045
+0 ||| D D B B C ||| -232.045
+0 ||| D B A E C ||| -232.045
+0 ||| D E B A C ||| -232.045
+0 ||| C E B B B ||| -232.045
+0 ||| B A D E B ||| -232.045
+0 ||| C B A D D ||| -232.045
+0 ||| B B C B D ||| -232.045
+0 ||| C D A E B ||| -232.045
+0 ||| D B C C C ||| -232.045
+0 ||| B C A D D ||| -232.045
+0 ||| B C B A E ||| -232.045
+0 ||| B A D C D ||| -232.045
+0 ||| C B B C D ||| -232.045
+0 ||| D C C A D ||| -232.045
+0 ||| B A B D D ||| -232.045
+0 ||| C C D A D ||| -232.045
+0 ||| E A B B D ||| -232.045
+0 ||| E C A B D ||| -232.045
+0 ||| C B B D C ||| -232.045
+0 ||| D B D A D ||| -232.045
+0 ||| D B B B D ||| -232.045
+0 ||| C A C C D ||| -232.045
+0 ||| D D B A D ||| -232.045
+0 ||| C A C D C ||| -232.045
+0 ||| C A A E D ||| -232.045
+0 ||| C D A C D ||| -232.045
+0 ||| E C B A D ||| -232.045
+0 ||| C C C C C ||| -232.045
+0 ||| B A D A E ||| -232.045
+0 ||| E C E A B ||| -232.045
+0 ||| B A D D C ||| -232.045
+0 ||| B C B C D ||| -232.045
+0 ||| D E A A D ||| -232.045
+0 ||| D C D C B ||| -232.045
+0 ||| E A D A D ||| -232.045
+0 ||| B B E A D ||| -232.045
+0 ||| C B B E B ||| -232.045
+0 ||| E B D B B ||| -232.045
+0 ||| D D C B B ||| -232.045
+0 ||| C D C C B ||| -232.045
+0 ||| B D C B C ||| -232.045
+0 ||| D C C B C ||| -232.045
+0 ||| E B C C B ||| -232.045
+0 ||| D B E B B ||| -232.045
+0 ||| C C D B C ||| -232.045
+0 ||| E E A B B ||| -232.045
+0 ||| C B E C B ||| -232.045
+0 ||| D D E A B ||| -232.045
+0 ||| B C A B E ||| -232.045
+0 ||| E C C B B ||| -232.045
+0 ||| C C E B B ||| -232.045
+0 ||| C D D B B ||| -232.045
+0 ||| B E B C B ||| -232.045
+0 ||| B E A D B ||| -232.045
+0 ||| D E C A B ||| -232.045
+0 ||| B D D C B ||| -232.045
+0 ||| B B D D B ||| -232.045
+0 ||| B C C D B ||| -232.045
+0 ||| E D D A B ||| -232.045
+0 ||| C E D A B ||| -232.045
+0 ||| B A E D B ||| -232.045
+0 ||| C B C D B ||| -232.045
+0 ||| E E B A B ||| -232.045
+0 ||| D C B D B ||| -232.045
+0 ||| C C B B D ||| -232.045
+0 ||| B C B E B ||| -232.045
+0 ||| B D B D B ||| -232.045
+0 ||| E A D B C ||| -232.045
+0 ||| D E A B C ||| -232.045
+0 ||| D A A C E ||| -232.045
+0 ||| B B A C E ||| -232.045
+0 ||| E B A A E ||| -232.045
+0 ||| C B A B E ||| -232.045
+0 ||| D D A B D ||| -232.045
+0 ||| D A E A D ||| -232.045
+0 ||| D D E B A ||| -232.045
+0 ||| C B B A E ||| -232.045
+0 ||| C A D B D ||| -232.045
+0 ||| C D C D A ||| -232.045
+0 ||| D A C B D ||| -232.045
+0 ||| C D A A E ||| -232.045
+0 ||| D C D D A ||| -232.045
+0 ||| E B A C D ||| -232.045
+0 ||| E A E B B ||| -232.045
+0 ||| C D E C A ||| -232.045
+0 ||| B D C A D ||| -232.045
+0 ||| C E C C A ||| -232.045
+0 ||| B E D C A ||| -232.045
+0 ||| B C E D A ||| -232.045
+0 ||| E D C C A ||| -232.045
+0 ||| D E E A A ||| -232.045
+0 ||| E E B B A ||| -232.045
+0 ||| E B E C A ||| -232.045
+0 ||| E E D A A ||| -232.045
+0 ||| C A E E A ||| -232.045
+0 ||| C E A E A ||| -232.045
+0 ||| E D A E A ||| -232.045
+0 ||| C B D E A ||| -232.045
+0 ||| B E B D A ||| -232.045
+0 ||| C B E D A ||| -232.045
+0 ||| E C E B A ||| -232.045
+0 ||| C E D B A ||| -232.045
+0 ||| C C C E A ||| -232.045
+0 ||| E B B E A ||| -232.045
+0 ||| B D D D A ||| -232.045
+0 ||| E B C D A ||| -232.045
+0 ||| D B C E A ||| -232.045
+0 ||| E A C E A ||| -232.045
+0 ||| C D B E A ||| -232.045
+0 ||| B C D E A ||| -232.045
+0 ||| E D D B A ||| -232.045
+0 ||| A B C C D ||| -233.045
+0 ||| A A C E C ||| -233.045
+0 ||| A C E B C ||| -233.045
+0 ||| A C A C E ||| -233.045
+0 ||| A B E C C ||| -233.045
+0 ||| A D B B D ||| -233.045
+0 ||| A E A B D ||| -233.045
+0 ||| A D E B B ||| -233.045
+0 ||| A A B C E ||| -233.045
+0 ||| A E E A B ||| -233.045
+0 ||| A E C B B ||| -233.045
+0 ||| A B C E B ||| -233.045
+0 ||| A B C D C ||| -233.045
+0 ||| A E B A D ||| -233.045
+0 ||| A A E B D ||| -233.045
+0 ||| A D D A D ||| -233.045
+0 ||| A B B E C ||| -233.045
+0 ||| A B D B D ||| -233.045
+0 ||| A D D B C ||| -233.045
+0 ||| A D A E C ||| -233.045
+0 ||| A E D A C ||| -233.045
+0 ||| A E B B C ||| -233.045
+0 ||| A D C C C ||| -233.045
+0 ||| A A A D E ||| -233.045
+0 ||| A B A E D ||| -233.045
+0 ||| A B C A E ||| -233.045
+0 ||| A C E A D ||| -233.045
+0 ||| A D C E A ||| -233.045
+0 ||| A C D D B ||| -233.045
+0 ||| A C C B D ||| -233.045
+0 ||| A E E B A ||| -233.045
+0 ||| A B E E A ||| -233.045
+0 ||| C D B D B ||| -234.045
+0 ||| C C E C B ||| -234.045
+0 ||| C C B E B ||| -234.045
+0 ||| E A A D D ||| -234.045
+0 ||| C C A D D ||| -234.045
+0 ||| B E C B B ||| -234.045
+0 ||| E A A B E ||| -234.045
+0 ||| B B C D C ||| -234.045
+0 ||| E C D B B ||| -234.045
+0 ||| E B B D B ||| -234.045
+0 ||| E A B E B ||| -234.045
+0 ||| B E E A B ||| -234.045
+0 ||| C B C B D ||| -234.045
+0 ||| D E D A B ||| -234.045
+0 ||| E C A E B ||| -234.045
+0 ||| B E A B D ||| -234.045
+0 ||| E B C B C ||| -234.045
+0 ||| D C D B C ||| -234.045
+0 ||| D C C C C ||| -234.045
+0 ||| C C D C C ||| -234.045
+0 ||| B D A E C ||| -234.045
+0 ||| B D C C C ||| -234.045
+0 ||| D A E C C ||| -234.045
+0 ||| C D C B C ||| -234.045
+0 ||| D C D A D ||| -234.045
+0 ||| B B E C C ||| -234.045
+0 ||| C B E B C ||| -234.045
+0 ||| E A D C C ||| -234.045
+0 ||| D D A D C ||| -234.045
+0 ||| D A C C D ||| -234.045
+0 ||| B D D B C ||| -234.045
+0 ||| E C B C C ||| -234.045
+0 ||| E C A D C ||| -234.045
+0 ||| C E C A C ||| -234.045
+0 ||| B B B E C ||| -234.045
+0 ||| D E A C C ||| -234.045
+0 ||| D C B B D ||| -234.045
+0 ||| D B D C C ||| -234.045
+0 ||| E A B D C ||| -234.045
+0 ||| E A E C B ||| -234.045
+0 ||| B E B B C ||| -234.045
+0 ||| C A D C D ||| -234.045
+0 ||| D C A E C ||| -234.045
+0 ||| B C E B C ||| -234.045
+0 ||| E A C D B ||| -234.045
+0 ||| D B B D C ||| -234.045
+0 ||| C D E A C ||| -234.045
+0 ||| C E B C B ||| -234.045
+0 ||| D A B E C ||| -234.045
+0 ||| D A C E B ||| -234.045
+0 ||| D D B C C ||| -234.045
+0 ||| B A C E C ||| -234.045
+0 ||| B E D A C ||| -234.045
+0 ||| D A C A E ||| -234.045
+0 ||| B B C C D ||| -234.045
+0 ||| B E B A D ||| -234.045
+0 ||| E C A C D ||| -234.045
+0 ||| C C C D B ||| -234.045
+0 ||| B D B B D ||| -234.045
+0 ||| D D A C D ||| -234.045
+0 ||| C B E A D ||| -234.045
+0 ||| D A A E D ||| -234.045
+0 ||| C D C A D ||| -234.045
+0 ||| C B A C E ||| -234.045
+0 ||| D B B C D ||| -234.045
+0 ||| E C C C B ||| -234.045
+0 ||| B D D A D ||| -234.045
+0 ||| E B C A D ||| -234.045
+0 ||| D B A D D ||| -234.045
+0 ||| B A E B D ||| -234.045
+0 ||| C B D D B ||| -234.045
+0 ||| E B D C B ||| -234.045
+0 ||| E D B C B ||| -234.045
+0 ||| B B D B D ||| -234.045
+0 ||| B D E B B ||| -234.045
+0 ||| D D D B B ||| -234.045
+0 ||| D B E C B ||| -234.045
+0 ||| C A D E B ||| -234.045
+0 ||| E E A C B ||| -234.045
+0 ||| C A E D B ||| -234.045
+0 ||| D B B E B ||| -234.045
+0 ||| C C B C D ||| -234.045
+0 ||| D D C C B ||| -234.045
+0 ||| E D C A C ||| -234.045
+0 ||| D B C D B ||| -234.045
+0 ||| B C D D B ||| -234.045
+0 ||| D D A E B ||| -234.045
+0 ||| B C E A D ||| -234.045
+0 ||| D C E B B ||| -234.045
+0 ||| C E A D B ||| -234.045
+0 ||| C D D C B ||| -234.045
+0 ||| E D A D B ||| -234.045
+0 ||| C C A B E ||| -234.045
+0 ||| E A B C D ||| -234.045
+0 ||| C C B D C ||| -234.045
+0 ||| D A C D C ||| -234.045
+0 ||| E B E A C ||| -234.045
+0 ||| E C A A E ||| -234.045
+0 ||| B A B C E ||| -234.045
+0 ||| B B A E D ||| -234.045
+0 ||| D B B A E ||| -234.045
+0 ||| D E B B B ||| -234.045
+0 ||| C A D D C ||| -234.045
+0 ||| B C C B D ||| -234.045
+0 ||| B B C A E ||| -234.045
+0 ||| C A D A E ||| -234.045
+0 ||| B B C E B ||| -234.045
+0 ||| D B A B E ||| -234.045
+0 ||| D A D B D ||| -234.045
+0 ||| E D D C A ||| -234.045
+0 ||| B A A D E ||| -234.045
+0 ||| C C B A E ||| -234.045
+0 ||| C C D E A ||| -234.045
+0 ||| B C A C E ||| -234.045
+0 ||| C A B D D ||| -234.045
+0 ||| C E B D A ||| -234.045
+0 ||| D D A A E ||| -234.045
+0 ||| E A B A E ||| -234.045
+0 ||| E D B D A ||| -234.045
+0 ||| C A B B E ||| -234.045
+0 ||| E C E C A ||| -234.045
+0 ||| B E E B A ||| -234.045
+0 ||| D D E C A ||| -234.045
+0 ||| E C B E A ||| -234.045
+0 ||| D D C D A ||| -234.045
+0 ||| D B D E A ||| -234.045
+0 ||| B B E E A ||| -234.045
+0 ||| E A E D A ||| -234.045
+0 ||| E E A D A ||| -234.045
+0 ||| E B D D A ||| -234.045
+0 ||| E E B C A ||| -234.045
+0 ||| C D D D A ||| -234.045
+0 ||| D E D B A ||| -234.045
+0 ||| D D B E A ||| -234.045
+0 ||| D E C C A ||| -234.045
+0 ||| C E D C A ||| -234.045
+0 ||| D C C E A ||| -234.045
+0 ||| E C C D A ||| -234.045
+0 ||| D E A E A ||| -234.045
+0 ||| D A E E A ||| -234.045
+0 ||| B D C E A ||| -234.045
+0 ||| E A D E A ||| -234.045
+0 ||| C C E D A ||| -234.045
+0 ||| D B E D A ||| -234.045
+0 ||| A C C A E ||| -235.045
+0 ||| A C B E C ||| -235.045
+0 ||| A B D E B ||| -235.045
+0 ||| A C C D C ||| -235.045
+0 ||| A D A D D ||| -235.045
+0 ||| A B E D B ||| -235.045
+0 ||| A C C C D ||| -235.045
+0 ||| A C D B D ||| -235.045
+0 ||| A A D E C ||| -235.045
+0 ||| A C E C C ||| -235.045
+0 ||| A A E E B ||| -235.045
+0 ||| A D B C D ||| -235.045
+0 ||| A D B A E ||| -235.045
+0 ||| A C A E D ||| -235.045
+0 ||| A E D B B ||| -235.045
+0 ||| A E A C D ||| -235.045
+0 ||| A D D C C ||| -235.045
+0 ||| A D B E B ||| -235.045
+0 ||| A A C D D ||| -235.045
+0 ||| A B D C D ||| -235.045
+0 ||| A D B D C ||| -235.045
+0 ||| A D C D B ||| -235.045
+0 ||| A E C C B ||| -235.045
+0 ||| A E A E B ||| -235.045
+0 ||| A A E C D ||| -235.045
+0 ||| A E A D C ||| -235.045
+0 ||| A D E C B ||| -235.045
+0 ||| A B D D C ||| -235.045
+0 ||| A D E D A ||| -235.045
+0 ||| A B D A E ||| -235.045
+0 ||| A A C B E ||| -235.045
+0 ||| A E B C C ||| -235.045
+0 ||| A E E C A ||| -235.045
+0 ||| A C C E B ||| -235.045
+0 ||| A A E D C ||| -235.045
+0 ||| A E A A E ||| -235.045
+0 ||| A E B E A ||| -235.045
+0 ||| A D A B E ||| -235.045
+0 ||| A A B E D ||| -235.045
+0 ||| A B B D D ||| -235.045
+0 ||| A C E E A ||| -235.045
+0 ||| A B B B E ||| -235.045
+0 ||| A A E A E ||| -235.045
+0 ||| A E C D A ||| -235.045
+0 ||| A D D E A ||| -235.045
+0 ||| B E A E B ||| -236.045
+0 ||| B D E C B ||| -236.045
+0 ||| B D B D C ||| -236.045
+0 ||| B C E C C ||| -236.045
+0 ||| D C E C B ||| -236.045
+0 ||| C A C E C ||| -236.045
+0 ||| C B D B D ||| -236.045
+0 ||| D B D D B ||| -236.045
+0 ||| D C B C D ||| -236.045
+0 ||| B D B A E ||| -236.045
+0 ||| B B D E B ||| -236.045
+0 ||| B C C A E ||| -236.045
+0 ||| D C C D B ||| -236.045
+0 ||| D A D D C ||| -236.045
+0 ||| D A E D B ||| -236.045
+0 ||| E D B B C ||| -236.045
+0 ||| D D B D B ||| -236.045
+0 ||| B A D E C ||| -236.045
+0 ||| E E A A D ||| -236.045
+0 ||| E B A E C ||| -236.045
+0 ||| E A D D B ||| -236.045
+0 ||| C E B B C ||| -236.045
+0 ||| D A D A E ||| -236.045
+0 ||| C C E A D ||| -236.045
+0 ||| C D A E C ||| -236.045
+0 ||| B C C C D ||| -236.045
+0 ||| D C B A E ||| -236.045
+0 ||| C A A D E ||| -236.045
+0 ||| B A E A E ||| -236.045
+0 ||| B C B E C ||| -236.045
+0 ||| C B C C D ||| -236.045
+0 ||| B C C E B ||| -236.045
+0 ||| C A E B D ||| -236.045
+0 ||| C D D B C ||| -236.045
+0 ||| E C E A C ||| -236.045
+0 ||| B B B D D ||| -236.045
+0 ||| B B D A E ||| -236.045
+0 ||| C B A E D ||| -236.045
+0 ||| C C E B C ||| -236.045
+0 ||| C D D A D ||| -236.045
+0 ||| C D C C C ||| -236.045
+0 ||| D C D C C ||| -236.045
+0 ||| D D C B C ||| -236.045
+0 ||| C B B E C ||| -236.045
+0 ||| E B D B C ||| -236.045
+0 ||| B D A B E ||| -236.045
+0 ||| D C A B E ||| -236.045
+0 ||| D B E B C ||| -236.045
+0 ||| C B C A E ||| -236.045
+0 ||| E B C C C ||| -236.045
+0 ||| E C C B C ||| -236.045
+0 ||| E A A C E ||| -236.045
+0 ||| E E A B C ||| -236.045
+0 ||| D D E A C ||| -236.045
+0 ||| C A B C E ||| -236.045
+0 ||| C B E C C ||| -236.045
+0 ||| B B D D C ||| -236.045
+0 ||| E B D A D ||| -236.045
+0 ||| B B B B E ||| -236.045
+0 ||| E E B A C ||| -236.045
+0 ||| C C C B D ||| -236.045
+0 ||| C E B A D ||| -236.045
+0 ||| B D D C C ||| -236.045
+0 ||| D B E A D ||| -236.045
+0 ||| D E C A C ||| -236.045
+0 ||| B E B C C ||| -236.045
+0 ||| B E A D C ||| -236.045
+0 ||| C E D A C ||| -236.045
+0 ||| C B C D C ||| -236.045
+0 ||| E D D A C ||| -236.045
+0 ||| B C C D C ||| -236.045
+0 ||| B A E D C ||| -236.045
+0 ||| B A C B E ||| -236.045
+0 ||| D B A C E ||| -236.045
+0 ||| D C B E B ||| -236.045
+0 ||| D D C A D ||| -236.045
+0 ||| B E A C D ||| -236.045
+0 ||| C D B B D ||| -236.045
+0 ||| D C B D C ||| -236.045
+0 ||| D A B B E ||| -236.045
+0 ||| B E A A E ||| -236.045
+0 ||| C C A C E ||| -236.045
+0 ||| B D B E B ||| -236.045
+0 ||| C C D D B ||| -236.045
+0 ||| E A E B C ||| -236.045
+0 ||| B E C C B ||| -236.045
+0 ||| C B C E B ||| -236.045
+0 ||| B D C D B ||| -236.045
+0 ||| E D C B B ||| -236.045
+0 ||| E D B A D ||| -236.045
+0 ||| C D E B B ||| -236.045
+0 ||| D A D E B ||| -236.045
+0 ||| C E E A B ||| -236.045
+0 ||| C E C B B ||| -236.045
+0 ||| D D D C B ||| -236.045
+0 ||| D C A D D ||| -236.045
+0 ||| E E C A B ||| -236.045
+0 ||| E C B D B ||| -236.045
+0 ||| E B E B B ||| -236.045
+0 ||| B E D B B ||| -236.045
+0 ||| D E A D B ||| -236.045
+0 ||| B A E E B ||| -236.045
+0 ||| D A B D D ||| -236.045
+0 ||| B D A D D ||| -236.045
+0 ||| B A C D D ||| -236.045
+0 ||| B B D C D ||| -236.045
+0 ||| B A B E D ||| -236.045
+0 ||| B C D B D ||| -236.045
+0 ||| E D E A B ||| -236.045
+0 ||| B B E D B ||| -236.045
+0 ||| B A E C D ||| -236.045
+0 ||| B D B C D ||| -236.045
+0 ||| E B B B D ||| -236.045
+0 ||| E D A B D ||| -236.045
+0 ||| E B C E A ||| -236.045
+0 ||| E C C A D ||| -236.045
+0 ||| E A C B D ||| -236.045
+0 ||| D C E D A ||| -236.045
+0 ||| B C A E D ||| -236.045
+0 ||| C E A B D ||| -236.045
+0 ||| B D D E A ||| -236.045
+0 ||| D E B C B ||| -236.045
+0 ||| D B C B D ||| -236.045
+0 ||| C D C E A ||| -236.045
+0 ||| E A E A D ||| -236.045
+0 ||| E C D C B ||| -236.045
+0 ||| D A D C D ||| -236.045
+0 ||| D C D E A ||| -236.045
+0 ||| D D D D A ||| -236.045
+0 ||| C E E B A ||| -236.045
+0 ||| E C D D A ||| -236.045
+0 ||| B E E C A ||| -236.045
+0 ||| B C E E A ||| -236.045
+0 ||| E E C B A ||| -236.045
+0 ||| B E C D A ||| -236.045
+0 ||| D E B D A ||| -236.045
+0 ||| B E B E A ||| -236.045
+0 ||| E E E A A ||| -236.045
+0 ||| D E D C A ||| -236.045
+0 ||| C B E E A ||| -236.045
+0 ||| E D E B A ||| -236.045
+0 ||| B D E D A ||| -236.045
+0 ||| A C D D C ||| -237.045
+0 ||| A B C E C ||| -237.045
+0 ||| A C D A E ||| -237.045
+0 ||| A E C A D ||| -237.045
+0 ||| A E D D A ||| -237.045
+0 ||| A B E B D ||| -237.045
+0 ||| A C D E B ||| -237.045
+0 ||| A C B D D ||| -237.045
+0 ||| A E C B C ||| -237.045
+0 ||| A D A C E ||| -237.045
+0 ||| A E E A C ||| -237.045
+0 ||| A D D D B ||| -237.045
+0 ||| A B A D E ||| -237.045
+0 ||| A D E A D ||| -237.045
+0 ||| A C B B E ||| -237.045
+0 ||| A A D D D ||| -237.045
+0 ||| A A A E E ||| -237.045
+0 ||| A E D C B ||| -237.045
+0 ||| A A C C E ||| -237.045
+0 ||| A B B C E ||| -237.045
+0 ||| A E B D B ||| -237.045
+0 ||| A C E D B ||| -237.045
+0 ||| A A D B E ||| -237.045
+0 ||| A D C B D ||| -237.045
+0 ||| A C D C D ||| -237.045
+0 ||| A D E B C ||| -237.045
+0 ||| C B D E B ||| -238.045
+0 ||| C E C C B ||| -238.045
+0 ||| B C E D B ||| -238.045
+0 ||| B E D C B ||| -238.045
+0 ||| E C D A D ||| -238.045
+0 ||| B C B D D ||| -238.045
+0 ||| C A B E D ||| -238.045
+0 ||| C C B E C ||| -238.045
+0 ||| D E C B B ||| -238.045
+0 ||| D C E A D ||| -238.045
+0 ||| C A E C D ||| -238.045
+0 ||| E B A D D ||| -238.045
+0 ||| E C B B D ||| -238.045
+0 ||| C D B C D ||| -238.045
+0 ||| C E A A E ||| -238.045
+0 ||| D B B E C ||| -238.045
+0 ||| E D A C D ||| -238.045
+0 ||| B E C A D ||| -238.045
+0 ||| C C E C C ||| -238.045
+0 ||| D A E B D ||| -238.045
+0 ||| E B A B E ||| -238.045
+0 ||| B B E B D ||| -238.045
+0 ||| C B D C D ||| -238.045
+0 ||| E A A E D ||| -238.045
+0 ||| D B D B D ||| -238.045
+0 ||| C D B D C ||| -238.045
+0 ||| B A D B E ||| -238.045
+0 ||| C C A E D ||| -238.045
+0 ||| C D A D D ||| -238.045
+0 ||| E B B C D ||| -238.045
+0 ||| B D E A D ||| -238.045
+0 ||| D D D A D ||| -238.045
+0 ||| E A C C D ||| -238.045
+0 ||| B C D C D ||| -238.045
+0 ||| C E A C D ||| -238.045
+0 ||| D D B B D ||| -238.045
+0 ||| C A C D D ||| -238.045
+0 ||| E C A E C ||| -238.045
+0 ||| B E C B C ||| -238.045
+0 ||| D B A E D ||| -238.045
+0 ||| D E B A D ||| -238.045
+0 ||| D B C C D ||| -238.045
+0 ||| D E D A C ||| -238.045
+0 ||| E B B D C ||| -238.045
+0 ||| B B B C E ||| -238.045
+0 ||| E C D B C ||| -238.045
+0 ||| B E E A C ||| -238.045
+0 ||| E A B E C ||| -238.045
+0 ||| C B B D D ||| -238.045
+0 ||| E D C C B ||| -238.045
+0 ||| C A E D C ||| -238.045
+0 ||| B A D D D ||| -238.045
+0 ||| E A E C C ||| -238.045
+0 ||| E D A E B ||| -238.045
+0 ||| C B D A E ||| -238.045
+0 ||| C E B C C ||| -238.045
+0 ||| C D B A E ||| -238.045
+0 ||| E A C D C ||| -238.045
+0 ||| C C C C D ||| -238.045
+0 ||| B D C B D ||| -238.045
+0 ||| D A C E C ||| -238.045
+0 ||| D C C B D ||| -238.045
+0 ||| C C D B D ||| -238.045
+0 ||| E E D A B ||| -238.045
+0 ||| D A B C E ||| -238.045
+0 ||| C E A E B ||| -238.045
+0 ||| C C C D C ||| -238.045
+0 ||| E B E C B ||| -238.045
+0 ||| E E B B B ||| -238.045
+0 ||| D E E A B ||| -238.045
+0 ||| E E A C C ||| -238.045
+0 ||| C A E E B ||| -238.045
+0 ||| C A C B E ||| -238.045
+0 ||| C A D E C ||| -238.045
+0 ||| E C C C C ||| -238.045
+0 ||| D C A C E ||| -238.045
+0 ||| D B E C C ||| -238.045
+0 ||| D D D B C ||| -238.045
+0 ||| C B D D C ||| -238.045
+0 ||| E B D C C ||| -238.045
+0 ||| B D E B C ||| -238.045
+0 ||| E D B C C ||| -238.045
+0 ||| D D E B B ||| -238.045
+0 ||| B C D D C ||| -238.045
+0 ||| C C C E B ||| -238.045
+0 ||| B E B D B ||| -238.045
+0 ||| D B C D C ||| -238.045
+0 ||| D D C C C ||| -238.045
+0 ||| C D C D B ||| -238.045
+0 ||| D D A E C ||| -238.045
+0 ||| D C D D B ||| -238.045
+0 ||| C D E C B ||| -238.045
+0 ||| B C D A E ||| -238.045
+0 ||| C E A D C ||| -238.045
+0 ||| C E D B B ||| -238.045
+0 ||| E D A D C ||| -238.045
+0 ||| C B E D B ||| -238.045
+0 ||| D C E B C ||| -238.045
+0 ||| E A C A E ||| -238.045
+0 ||| C D D C C ||| -238.045
+0 ||| B B A D E ||| -238.045
+0 ||| E C E B B ||| -238.045
+0 ||| B A C C E ||| -238.045
+0 ||| D A A D E ||| -238.045
+0 ||| B C D E B ||| -238.045
+0 ||| E B B A E ||| -238.045
+0 ||| D E B B C ||| -238.045
+0 ||| C D B E B ||| -238.045
+0 ||| E B B E B ||| -238.045
+0 ||| B D D D B ||| -238.045
+0 ||| E A C E B ||| -238.045
+0 ||| D B C E B ||| -238.045
+0 ||| E B C D B ||| -238.045
+0 ||| E A D B D ||| -238.045
+0 ||| D E A B D ||| -238.045
+0 ||| E D D B B ||| -238.045
+0 ||| B D A C E ||| -238.045
+0 ||| D B E E A ||| -238.045
+0 ||| B B C E C ||| -238.045
+0 ||| C B B B E ||| -238.045
+0 ||| E B D E A ||| -238.045
+0 ||| B C B B E ||| -238.045
+0 ||| C C C A E ||| -238.045
+0 ||| E D B E A ||| -238.045
+0 ||| B A A E E ||| -238.045
+0 ||| D B C A E ||| -238.045
+0 ||| E D C D A ||| -238.045
+0 ||| E D A A E ||| -238.045
+0 ||| C A E A E ||| -238.045
+0 ||| E B E D A ||| -238.045
+0 ||| C D A B E ||| -238.045
+0 ||| C C E E A ||| -238.045
+0 ||| C E C D A ||| -238.045
+0 ||| C E B E A ||| -238.045
+0 ||| C D E D A ||| -238.045
+0 ||| E E D B A ||| -238.045
+0 ||| E E A E A ||| -238.045
+0 ||| D D C E A ||| -238.045
+0 ||| C E E C A ||| -238.045
+0 ||| E A E E A ||| -238.045
+0 ||| E E C C A ||| -238.045
+0 ||| E D E C A ||| -238.045
+0 ||| E C C E A ||| -238.045
+0 ||| D E E B A ||| -238.045
+0 ||| B E D D A ||| -238.045
+0 ||| C D D E A ||| -238.045
+0 ||| A A D C E ||| -239.045
+0 ||| A E B B D ||| -239.045
+0 ||| A B E C D ||| -239.045
+0 ||| A A B D E ||| -239.045
+0 ||| A D C E B ||| -239.045
+0 ||| A A E E C ||| -239.045
+0 ||| A B C B E ||| -239.045
+0 ||| A D C C D ||| -239.045
+0 ||| A B D E C ||| -239.045
+0 ||| A C E B D ||| -239.045
+0 ||| A B B E D ||| -239.045
+0 ||| A A C E D ||| -239.045
+0 ||| A E E B B ||| -239.045
+0 ||| A B E E B ||| -239.045
+0 ||| A D A E D ||| -239.045
+0 ||| A B E D C ||| -239.045
+0 ||| A E D A D ||| -239.045
+0 ||| A B C D D ||| -239.045
+0 ||| A D E E A ||| -239.045
+0 ||| A D E C C ||| -239.045
+0 ||| A E D B C ||| -239.045
+0 ||| A D C D C ||| -239.045
+0 ||| A E C C C ||| -239.045
+0 ||| A E C E A ||| -239.045
+0 ||| A E A E C ||| -239.045
+0 ||| A C B C E ||| -239.045
+0 ||| A D D B D ||| -239.045
+0 ||| A D B E C ||| -239.045
+0 ||| A B E A E ||| -239.045
+0 ||| A D C A E ||| -239.045
+0 ||| A C A D E ||| -239.045
+0 ||| A C C E C ||| -239.045
+0 ||| B E E B B ||| -240.045
+0 ||| B D C A E ||| -240.045
+0 ||| D E A C D ||| -240.045
+0 ||| E A D E B ||| -240.045
+0 ||| D D E C B ||| -240.045
+0 ||| D B D E B ||| -240.045
+0 ||| C A A E E ||| -240.045
+0 ||| D C C D C ||| -240.045
+0 ||| B D E C C ||| -240.045
+0 ||| B E A E C ||| -240.045
+0 ||| D C E C C ||| -240.045
+0 ||| E C E C B ||| -240.045
+0 ||| B B D E C ||| -240.045
+0 ||| D B D D C ||| -240.045
+0 ||| D D B D C ||| -240.045
+0 ||| C B B C E ||| -240.045
+0 ||| B B B E D ||| -240.045
+0 ||| D A E D C ||| -240.045
+0 ||| B A D C E ||| -240.045
+0 ||| B B C D D ||| -240.045
+0 ||| C B A D E ||| -240.045
+0 ||| B B C B E ||| -240.045
+0 ||| B C A D E ||| -240.045
+0 ||| E A D D C ||| -240.045
+0 ||| B D C C D ||| -240.045
+0 ||| D D B A E ||| -240.045
+0 ||| D C C A E ||| -240.045
+0 ||| E C A B E ||| -240.045
+0 ||| D C D B D ||| -240.045
+0 ||| E B C B D ||| -240.045
+0 ||| C E C A D ||| -240.045
+0 ||| B D A E D ||| -240.045
+0 ||| E A B B E ||| -240.045
+0 ||| B A B D E ||| -240.045
+0 ||| C C D C D ||| -240.045
+0 ||| C C D A E ||| -240.045
+0 ||| D C C C D ||| -240.045
+0 ||| E C A D D ||| -240.045
+0 ||| C B E B D ||| -240.045
+0 ||| D A E C D ||| -240.045
+0 ||| C A C C E ||| -240.045
+0 ||| B B E C D ||| -240.045
+0 ||| C D C B D ||| -240.045
+0 ||| E C B C D ||| -240.045
+0 ||| D D A D D ||| -240.045
+0 ||| D B B B E ||| -240.045
+0 ||| E A D C D ||| -240.045
+0 ||| B D D B D ||| -240.045
+0 ||| D B D A E ||| -240.045
+0 ||| D D C D B ||| -240.045
+0 ||| C D A C E ||| -240.045
+0 ||| B E B B D ||| -240.045
+0 ||| E C C D B ||| -240.045
+0 ||| B C C E C ||| -240.045
+0 ||| B E D A D ||| -240.045
+0 ||| E A B D D ||| -240.045
+0 ||| D B D C D ||| -240.045
+0 ||| E C B A E ||| -240.045
+0 ||| D B B D D ||| -240.045
+0 ||| D C A E D ||| -240.045
+0 ||| C D E A D ||| -240.045
+0 ||| B C E B D ||| -240.045
+0 ||| D A B E D ||| -240.045
+0 ||| D E A A E ||| -240.045
+0 ||| B C B C E ||| -240.045
+0 ||| B A C E D ||| -240.045
+0 ||| B B E A E ||| -240.045
+0 ||| E A D A E ||| -240.045
+0 ||| D D B C D ||| -240.045
+0 ||| E C B E B ||| -240.045
+0 ||| E E A D B ||| -240.045
+0 ||| C C B B E ||| -240.045
+0 ||| D C B E C ||| -240.045
+0 ||| D A D E C ||| -240.045
+0 ||| E C D C C ||| -240.045
+0 ||| C C E D B ||| -240.045
+0 ||| D A E A E ||| -240.045
+0 ||| E D C A D ||| -240.045
+0 ||| E D D C B ||| -240.045
+0 ||| C C D E B ||| -240.045
+0 ||| C A D D D ||| -240.045
+0 ||| E E B C B ||| -240.045
+0 ||| E A E D B ||| -240.045
+0 ||| D B E D B ||| -240.045
+0 ||| C E B D B ||| -240.045
+0 ||| E D B D B ||| -240.045
+0 ||| C D E B C ||| -240.045
+0 ||| E B D D B ||| -240.045
+0 ||| C C D D C ||| -240.045
+0 ||| B D B E C ||| -240.045
+0 ||| E D C B C ||| -240.045
+0 ||| B E C C C ||| -240.045
+0 ||| B D C D C ||| -240.045
+0 ||| C B C E C ||| -240.045
+0 ||| B B E D C ||| -240.045
+0 ||| D E A D C ||| -240.045
+0 ||| D E D B B ||| -240.045
+0 ||| D D A B E ||| -240.045
+0 ||| C D D D B ||| -240.045
+0 ||| E E C A C ||| -240.045
+0 ||| C E C B C ||| -240.045
+0 ||| C E E A C ||| -240.045
+0 ||| D D D C C ||| -240.045
+0 ||| C C B D D ||| -240.045
+0 ||| D C C E B ||| -240.045
+0 ||| D A C D D ||| -240.045
+0 ||| E B E A D ||| -240.045
+0 ||| E B E B C ||| -240.045
+0 ||| E C B D C ||| -240.045
+0 ||| D E A E B ||| -240.045
+0 ||| B D C E B ||| -240.045
+0 ||| B A E E C ||| -240.045
+0 ||| B E D B C ||| -240.045
+0 ||| D E B C C ||| -240.045
+0 ||| B B E E B ||| -240.045
+0 ||| D D B E B ||| -240.045
+0 ||| B D E E A ||| -240.045
+0 ||| D E C C B ||| -240.045
+0 ||| E D E A C ||| -240.045
+0 ||| E E B D A ||| -240.045
+0 ||| E B A C E ||| -240.045
+0 ||| C E D C B ||| -240.045
+0 ||| D E E C A ||| -240.045
+0 ||| D A C B E ||| -240.045
+0 ||| D A E E B ||| -240.045
+0 ||| D D E D A ||| -240.045
+0 ||| C A D B E ||| -240.045
+0 ||| D C E E A ||| -240.045
+0 ||| E C D E A ||| -240.045
+0 ||| E D D D A ||| -240.045
+0 ||| E E D C A ||| -240.045
+0 ||| D D D E A ||| -240.045
+0 ||| E C E D A ||| -240.045
+0 ||| B E C E A ||| -240.045
+0 ||| D E B E A ||| -240.045
+0 ||| C E D D A ||| -240.045
+0 ||| D E C D A ||| -240.045
+0 ||| A C E A E ||| -241.045
+0 ||| A C E C D ||| -241.045
+0 ||| A E E D A ||| -241.045
+0 ||| A A D E D ||| -241.045
+0 ||| A D E D B ||| -241.045
+0 ||| A C E E B ||| -241.045
+0 ||| A D D E B ||| -241.045
+0 ||| A C C D D ||| -241.045
+0 ||| A D D A E ||| -241.045
+0 ||| A D D C D ||| -241.045
+0 ||| A E D E A ||| -241.045
+0 ||| A E A B E ||| -241.045
+0 ||| A E C D B ||| -241.045
+0 ||| A C C B E ||| -241.045
+0 ||| A D B D D ||| -241.045
+0 ||| A A E B E ||| -241.045
+0 ||| A D B B E ||| -241.045
+0 ||| A B C C E ||| -241.045
+0 ||| A E D C C ||| -241.045
+0 ||| A C D E C ||| -241.045
+0 ||| A B D B E ||| -241.045
+0 ||| A E A D D ||| -241.045
+0 ||| A C B E D ||| -241.045
+0 ||| A E B C D ||| -241.045
+0 ||| A B D D D ||| -241.045
+0 ||| A B A E E ||| -241.045
+0 ||| A C E D C ||| -241.045
+0 ||| A E B E B ||| -241.045
+0 ||| A E B D C ||| -241.045
+0 ||| A E E C B ||| -241.045
+0 ||| A D D D C ||| -241.045
+0 ||| A E B A E ||| -241.045
+0 ||| A A E D D ||| -241.045
+0 ||| B C E C D ||| -242.045
+0 ||| D E C B C ||| -242.045
+0 ||| D D D D B ||| -242.045
+0 ||| B C E D C ||| -242.045
+0 ||| B D B D D ||| -242.045
+0 ||| C E C C C ||| -242.045
+0 ||| C B D E C ||| -242.045
+0 ||| B E D C C ||| -242.045
+0 ||| E D C C C ||| -242.045
+0 ||| C A C E D ||| -242.045
+0 ||| C B E E B ||| -242.045
+0 ||| B D E D B ||| -242.045
+0 ||| D A D D D ||| -242.045
+0 ||| E B A E D ||| -242.045
+0 ||| E D B B D ||| -242.045
+0 ||| E A A D E ||| -242.045
+0 ||| C C A D E ||| -242.045
+0 ||| B A D E D ||| -242.045
+0 ||| C B C B E ||| -242.045
+0 ||| B E A B E ||| -242.045
+0 ||| C E B B D ||| -242.045
+0 ||| D C D A E ||| -242.045
+0 ||| D A C C E ||| -242.045
+0 ||| E D A E C ||| -242.045
+0 ||| E B B E C ||| -242.045
+0 ||| D C D E B ||| -242.045
+0 ||| D C B B E ||| -242.045
+0 ||| C D A E D ||| -242.045
+0 ||| B C B E D ||| -242.045
+0 ||| C A D C E ||| -242.045
+0 ||| E C C B D ||| -242.045
+0 ||| B C D E C ||| -242.045
+0 ||| C C E B D ||| -242.045
+0 ||| C D D B D ||| -242.045
+0 ||| E C E A D ||| -242.045
+0 ||| E B C C D ||| -242.045
+0 ||| D D C B D ||| -242.045
+0 ||| D C D C D ||| -242.045
+0 ||| C D C C D ||| -242.045
+0 ||| E D E B B ||| -242.045
+0 ||| E B D B D ||| -242.045
+0 ||| C B B E D ||| -242.045
+0 ||| D B E B D ||| -242.045
+0 ||| B E C D B ||| -242.045
+0 ||| B D B B E ||| -242.045
+0 ||| C B C D D ||| -242.045
+0 ||| D D E A D ||| -242.045
+0 ||| E E A B D ||| -242.045
+0 ||| C B E C D ||| -242.045
+0 ||| E E B A D ||| -242.045
+0 ||| D C B D D ||| -242.045
+0 ||| B B D D D ||| -242.045
+0 ||| C E D A D ||| -242.045
+0 ||| B E B A E ||| -242.045
+0 ||| B D D C D ||| -242.045
+0 ||| B B C C E ||| -242.045
+0 ||| E E D A C ||| -242.045
+0 ||| B E A D D ||| -242.045
+0 ||| D E C A D ||| -242.045
+0 ||| E C A C E ||| -242.045
+0 ||| B E B C D ||| -242.045
+0 ||| D E B D B ||| -242.045
+0 ||| D D A C E ||| -242.045
+0 ||| B A E D D ||| -242.045
+0 ||| B C C D D ||| -242.045
+0 ||| E D D A D ||| -242.045
+0 ||| C E A E C ||| -242.045
+0 ||| C D C A E ||| -242.045
+0 ||| D A A E E ||| -242.045
+0 ||| C B E A E ||| -242.045
+0 ||| C D C E B ||| -242.045
+0 ||| E E B B C ||| -242.045
+0 ||| E B E C C ||| -242.045
+0 ||| B A E B E ||| -242.045
+0 ||| D B B C E ||| -242.045
+0 ||| D B A D E ||| -242.045
+0 ||| B D D A E ||| -242.045
+0 ||| E B C A E ||| -242.045
+0 ||| C A E E C ||| -242.045
+0 ||| C E E B B ||| -242.045
+0 ||| D E E A C ||| -242.045
+0 ||| B B D B E ||| -242.045
+0 ||| B C E A E ||| -242.045
+0 ||| E B C D C ||| -242.045
+0 ||| E E C B B ||| -242.045
+0 ||| C C B C E ||| -242.045
+0 ||| D D E B C ||| -242.045
+0 ||| D C E D B ||| -242.045
+0 ||| B E B D C ||| -242.045
+0 ||| E B C E B ||| -242.045
+0 ||| C C C E C ||| -242.045
+0 ||| D E D C B ||| -242.045
+0 ||| E C D D B ||| -242.045
+0 ||| C D C D C ||| -242.045
+0 ||| B C E E B ||| -242.045
+0 ||| C D E C C ||| -242.045
+0 ||| D C D D C ||| -242.045
+0 ||| B C C B E ||| -242.045
+0 ||| B E E C B ||| -242.045
+0 ||| C E D B C ||| -242.045
+0 ||| C B E D C ||| -242.045
+0 ||| E A E B D ||| -242.045
+0 ||| E A C E C ||| -242.045
+0 ||| E A B C E ||| -242.045
+0 ||| C D B E C ||| -242.045
+0 ||| B B A E E ||| -242.045
+0 ||| D B C E C ||| -242.045
+0 ||| E C E B C ||| -242.045
+0 ||| B E B E B ||| -242.045
+0 ||| D E D D A ||| -242.045
+0 ||| B D D D C ||| -242.045
+0 ||| E D D B C ||| -242.045
+0 ||| B E D E A ||| -242.045
+0 ||| E E E A B ||| -242.045
+0 ||| C A B D E ||| -242.045
+0 ||| B E E D A ||| -242.045
+0 ||| D A D B E ||| -242.045
+0 ||| B D D E B ||| -242.045
+0 ||| E D C E A ||| -242.045
+0 ||| C E C E A ||| -242.045
+0 ||| C D E E A ||| -242.045
+0 ||| E E E B A ||| -242.045
+0 ||| E B E E A ||| -242.045
+0 ||| A E A C E ||| -243.045
+0 ||| A B D C E ||| -243.045
+0 ||| A C D B E ||| -243.045
+0 ||| A D A D E ||| -243.045
+0 ||| A E C B D ||| -243.045
+0 ||| A C C C E ||| -243.045
+0 ||| A D B C E ||| -243.045
+0 ||| A E D D B ||| -243.045
+0 ||| A C A E E ||| -243.045
+0 ||| A A C D E ||| -243.045
+0 ||| A D E B D ||| -243.045
+0 ||| A B C E D ||| -243.045
+0 ||| A B B D E ||| -243.045
+0 ||| A C D D D ||| -243.045
+0 ||| A D C E C ||| -243.045
+0 ||| A E E B C ||| -243.045
+0 ||| A B E E C ||| -243.045
+0 ||| A A E C E ||| -243.045
+0 ||| A A B E E ||| -243.045
+0 ||| A E E A D ||| -243.045
+0 ||| D E C C C ||| -244.045
+0 ||| C C E A E ||| -244.045
+0 ||| D D E C C ||| -244.045
+0 ||| E B D C D ||| -244.045
+0 ||| C E B E B ||| -244.045
+0 ||| C C E E B ||| -244.045
+0 ||| D A D C E ||| -244.045
+0 ||| E E A D C ||| -244.045
+0 ||| C C B E D ||| -244.045
+0 ||| D E D B C ||| -244.045
+0 ||| E A D E C ||| -244.045
+0 ||| C E E C B ||| -244.045
+0 ||| D B D E C ||| -244.045
+0 ||| E C D B D ||| -244.045
+0 ||| C B D B E ||| -244.045
+0 ||| C C E C D ||| -244.045
+0 ||| D B B E D ||| -244.045
+0 ||| D C B C E ||| -244.045
+0 ||| C D B D D ||| -244.045
+0 ||| E B E D B ||| -244.045
+0 ||| E C E C C ||| -244.045
+0 ||| D E D A D ||| -244.045
+0 ||| E E A A E ||| -244.045
+0 ||| E C A E D ||| -244.045
+0 ||| B E C B D ||| -244.045
+0 ||| E B B D D ||| -244.045
+0 ||| C D D E B ||| -244.045
+0 ||| E E C C B ||| -244.045
+0 ||| E C C E B ||| -244.045
+0 ||| D E E B B ||| -244.045
+0 ||| E A E E B ||| -244.045
+0 ||| E E D B B ||| -244.045
+0 ||| C D E D B ||| -244.045
+0 ||| B B D C E ||| -244.045
+0 ||| D A B D E ||| -244.045
+0 ||| B A E C E ||| -244.045
+0 ||| D D C D C ||| -244.045
+0 ||| E A B E D ||| -244.045
+0 ||| C B D D D ||| -244.045
+0 ||| C E C D B ||| -244.045
+0 ||| E C B E C ||| -244.045
+0 ||| B C C C E ||| -244.045
+0 ||| B E E A D ||| -244.045
+0 ||| C B C C E ||| -244.045
+0 ||| E A E C D ||| -244.045
+0 ||| E D B E B ||| -244.045
+0 ||| C A E D D ||| -244.045
+0 ||| E C C D C ||| -244.045
+0 ||| C A E B E ||| -244.045
+0 ||| C B A E E ||| -244.045
+0 ||| C A D E D ||| -244.045
+0 ||| B B B D E ||| -244.045
+0 ||| C E B C D ||| -244.045
+0 ||| E E A C D ||| -244.045
+0 ||| E A C D D ||| -244.045
+0 ||| C D D A E ||| -244.045
+0 ||| C C C B E ||| -244.045
+0 ||| D D D B D ||| -244.045
+0 ||| C E A D D ||| -244.045
+0 ||| C E B D C ||| -244.045
+0 ||| C D B B E ||| -244.045
+0 ||| E B D A E ||| -244.045
+0 ||| D B E A E ||| -244.045
+0 ||| D A C E D ||| -244.045
+0 ||| C E B A E ||| -244.045
+0 ||| D D A E D ||| -244.045
+0 ||| B E A C E ||| -244.045
+0 ||| D B E C D ||| -244.045
+0 ||| D D C A E ||| -244.045
+0 ||| E D D C C ||| -244.045
+0 ||| E D B A E ||| -244.045
+0 ||| C C C D D ||| -244.045
+0 ||| E D A D D ||| -244.045
+0 ||| D C E B D ||| -244.045
+0 ||| D B E D C ||| -244.045
+0 ||| E A E D C ||| -244.045
+0 ||| E C C C D ||| -244.045
+0 ||| B C D B E ||| -244.045
+0 ||| D B C D D ||| -244.045
+0 ||| E D B C D ||| -244.045
+0 ||| D E B B D ||| -244.045
+0 ||| D D C C D ||| -244.045
+0 ||| E B D E B ||| -244.045
+0 ||| B D E B D ||| -244.045
+0 ||| C D D C D ||| -244.045
+0 ||| B A B E E ||| -244.045
+0 ||| E A C B E ||| -244.045
+0 ||| B A C D E ||| -244.045
+0 ||| D C A D E ||| -244.045
+0 ||| B C D D D ||| -244.045
+0 ||| C C E D C ||| -244.045
+0 ||| D E A E C ||| -244.045
+0 ||| C C D E C ||| -244.045
+0 ||| D B E E B ||| -244.045
+0 ||| D E C E A ||| -244.045
+0 ||| E B D D C ||| -244.045
+0 ||| E D E D A ||| -244.045
+0 ||| E D B D C ||| -244.045
+0 ||| D D E E A ||| -244.045
+0 ||| D A E E C ||| -244.045
+0 ||| E E B E A ||| -244.045
+0 ||| B D A D E ||| -244.045
+0 ||| E D D E A ||| -244.045
+0 ||| E D C D B ||| -244.045
+0 ||| E E C D A ||| -244.045
+0 ||| C D D D C ||| -244.045
+0 ||| C E E D A ||| -244.045
+0 ||| D D C E B ||| -244.045
+0 ||| C E D E A ||| -244.045
+0 ||| E E A E B ||| -244.045
+0 ||| E E E C A ||| -244.045
+0 ||| E E B C C ||| -244.045
+0 ||| E C E E A ||| -244.045
+0 ||| E D E C B ||| -244.045
+0 ||| B E D D B ||| -244.045
+0 ||| D C C E C ||| -244.045
+0 ||| D D B E C ||| -244.045
+0 ||| B E E B C ||| -244.045
+0 ||| B D C E C ||| -244.045
+0 ||| B B E E C ||| -244.045
+0 ||| E A E A E ||| -244.045
+0 ||| E D A B E ||| -244.045
+0 ||| E C C A E ||| -244.045
+0 ||| E B B B E ||| -244.045
+0 ||| B D B C E ||| -244.045
+0 ||| C E D C C ||| -244.045
+0 ||| D B C B E ||| -244.045
+0 ||| B C A E E ||| -244.045
+0 ||| B B C E D ||| -244.045
+0 ||| C E A B E ||| -244.045
+0 ||| A A E E D ||| -245.045
+0 ||| A E C A E ||| -245.045
+0 ||| A D D E C ||| -245.045
+0 ||| A C B D E ||| -245.045
+0 ||| A B D E D ||| -245.045
+0 ||| A A D D E ||| -245.045
+0 ||| A C D C E ||| -245.045
+0 ||| A C C E D ||| -245.045
+0 ||| A B E B E ||| -245.045
+0 ||| A D C B E ||| -245.045
+0 ||| A C E E C ||| -245.045
+0 ||| A D E D C ||| -245.045
+0 ||| A E C D C ||| -245.045
+0 ||| A E E E A ||| -245.045
+0 ||| A E E C C ||| -245.045
+0 ||| A B E D D ||| -245.045
+0 ||| A E C E B ||| -245.045
+0 ||| A E D B D ||| -245.045
+0 ||| A D E A E ||| -245.045
+0 ||| A D E C D ||| -245.045
+0 ||| A D B E D ||| -245.045
+0 ||| A E C C D ||| -245.045
+0 ||| A D C D D ||| -245.045
+0 ||| A E B E C ||| -245.045
+0 ||| A E A E D ||| -245.045
+0 ||| A D E E B ||| -245.045
+0 ||| E D D D B ||| -246.045
+0 ||| B D D E C ||| -246.045
+0 ||| E C D E B ||| -246.045
+0 ||| E E C B C ||| -246.045
+0 ||| D C B E D ||| -246.045
+0 ||| D D D D C ||| -246.045
+0 ||| B E A E D ||| -246.045
+0 ||| C E D D B ||| -246.045
+0 ||| C A B E E ||| -246.045
+0 ||| B C B D E ||| -246.045
+0 ||| E C D A E ||| -246.045
+0 ||| C A E C E ||| -246.045
+0 ||| D C E A E ||| -246.045
+0 ||| E B B C E ||| -246.045
+0 ||| C D B C E ||| -246.045
+0 ||| E B A D E ||| -246.045
+0 ||| E C B B E ||| -246.045
+0 ||| D C E E B ||| -246.045
+0 ||| E D A C E ||| -246.045
+0 ||| B E C A E ||| -246.045
+0 ||| C B D C E ||| -246.045
+0 ||| B D E A E ||| -246.045
+0 ||| D A E B E ||| -246.045
+0 ||| B B E B E ||| -246.045
+0 ||| C D A D E ||| -246.045
+0 ||| E A A E E ||| -246.045
+0 ||| C C A E E ||| -246.045
+0 ||| B D E C D ||| -246.045
+0 ||| D B D B E ||| -246.045
+0 ||| D C C D D ||| -246.045
+0 ||| C B E E C ||| -246.045
+0 ||| D A E D D ||| -246.045
+0 ||| C E A C E ||| -246.045
+0 ||| C E E B C ||| -246.045
+0 ||| D D D A E ||| -246.045
+0 ||| D C E C D ||| -246.045
+0 ||| B C D C E ||| -246.045
+0 ||| E A C C E ||| -246.045
+0 ||| D D B D D ||| -246.045
+0 ||| D B C C E ||| -246.045
+0 ||| D D B B E ||| -246.045
+0 ||| D B D D D ||| -246.045
+0 ||| B B D E D ||| -246.045
+0 ||| B D E D C ||| -246.045
+0 ||| C A C D E ||| -246.045
+0 ||| D B A E E ||| -246.045
+0 ||| D E B A E ||| -246.045
+0 ||| B B E D D ||| -246.045
+0 ||| E A D D D ||| -246.045
+0 ||| C C D D D ||| -246.045
+0 ||| D E A D D ||| -246.045
+0 ||| E C E D B ||| -246.045
+0 ||| D E B E B ||| -246.045
+0 ||| C B B D E ||| -246.045
+0 ||| B A D D E ||| -246.045
+0 ||| B C C E D ||| -246.045
+0 ||| D C D E C ||| -246.045
+0 ||| D D D E B ||| -246.045
+0 ||| C C C C E ||| -246.045
+0 ||| E D C B D ||| -246.045
+0 ||| E E D C B ||| -246.045
+0 ||| D D E D B ||| -246.045
+0 ||| B D C B E ||| -246.045
+0 ||| B E C E B ||| -246.045
+0 ||| D C E D C ||| -246.045
+0 ||| C E E A D ||| -246.045
+0 ||| B E C D C ||| -246.045
+0 ||| E D E B C ||| -246.045
+0 ||| D E D E A ||| -246.045
+0 ||| B E C C D ||| -246.045
+0 ||| C C D B E ||| -246.045
+0 ||| C D E B D ||| -246.045
+0 ||| D E E D A ||| -246.045
+0 ||| C D C E C ||| -246.045
+0 ||| D C C B E ||| -246.045
+0 ||| B E E E A ||| -246.045
+0 ||| D A D E D ||| -246.045
+0 ||| E E D D A ||| -246.045
+0 ||| B D E E B ||| -246.045
+0 ||| B D B E D ||| -246.045
+0 ||| E C D C D ||| -246.045
+0 ||| B E E C C ||| -246.045
+0 ||| E B C E C ||| -246.045
+0 ||| E C D D C ||| -246.045
+0 ||| D E D C C ||| -246.045
+0 ||| B C E E C ||| -246.045
+0 ||| E C B D D ||| -246.045
+0 ||| C B C E D ||| -246.045
+0 ||| E B E B D ||| -246.045
+0 ||| D D D C D ||| -246.045
+0 ||| B A E E D ||| -246.045
+0 ||| B E B E C ||| -246.045
+0 ||| B E D B D ||| -246.045
+0 ||| D E B C D ||| -246.045
+0 ||| E A D B E ||| -246.045
+0 ||| D E A B E ||| -246.045
+0 ||| D E E C B ||| -246.045
+0 ||| E E C A D ||| -246.045
+0 ||| E E E A C ||| -246.045
+0 ||| D E B D C ||| -246.045
+0 ||| B D C D D ||| -246.045
+0 ||| E E B D B ||| -246.045
+0 ||| C E C B D ||| -246.045
+0 ||| E D E A D ||| -246.045
+0 ||| D E C D B ||| -246.045
+0 ||| A C E B E ||| -247.045
+0 ||| A E B B E ||| -247.045
+0 ||| A B E C E ||| -247.045
+0 ||| A D C C E ||| -247.045
+0 ||| A B B E E ||| -247.045
+0 ||| A D D D D ||| -247.045
+0 ||| A E D D C ||| -247.045
+0 ||| A E D E B ||| -247.045
+0 ||| A E E D B ||| -247.045
+0 ||| A D A E E ||| -247.045
+0 ||| A E D A E ||| -247.045
+0 ||| A B C D E ||| -247.045
+0 ||| A A C E E ||| -247.045
+0 ||| A E B D D ||| -247.045
+0 ||| A C D E D ||| -247.045
+0 ||| A E D C D ||| -247.045
+0 ||| A D D B E ||| -247.045
+0 ||| A C E D D ||| -247.045
+0 ||| B C D E D ||| -248.045
+0 ||| B C E D D ||| -248.045
+0 ||| C D E D C ||| -248.045
+0 ||| B E D C D ||| -248.045
+0 ||| C C E E C ||| -248.045
+0 ||| D D E B D ||| -248.045
+0 ||| C E B E C ||| -248.045
+0 ||| D E C B D ||| -248.045
+0 ||| D E A C E ||| -248.045
+0 ||| C B D E D ||| -248.045
+0 ||| B B E C E ||| -248.045
+0 ||| C E C C D ||| -248.045
+0 ||| C E E C C ||| -248.045
+0 ||| E E D B C ||| -248.045
+0 ||| E B E D C ||| -248.045
+0 ||| D D A D E ||| -248.045
+0 ||| E D C C D ||| -248.045
+0 ||| E C A D E ||| -248.045
+0 ||| C D E E B ||| -248.045
+0 ||| D C C C E ||| -248.045
+0 ||| C D E A E ||| -248.045
+0 ||| C C D C E ||| -248.045
+0 ||| C D C B E ||| -248.045
+0 ||| B B B E E ||| -248.045
+0 ||| E B E C D ||| -248.045
+0 ||| E C B C E ||| -248.045
+0 ||| B B C D E ||| -248.045
+0 ||| C E C A E ||| -248.045
+0 ||| C D D E C ||| -248.045
+0 ||| E B C B E ||| -248.045
+0 ||| B D C C E ||| -248.045
+0 ||| D C D B E ||| -248.045
+0 ||| E A E E C ||| -248.045
+0 ||| E E C C C ||| -248.045
+0 ||| B D A E E ||| -248.045
+0 ||| D E E B C ||| -248.045
+0 ||| E C C E C ||| -248.045
+0 ||| C B E B E ||| -248.045
+0 ||| D A E C E ||| -248.045
+0 ||| D E D D B ||| -248.045
+0 ||| E A D C E ||| -248.045
+0 ||| D B D C E ||| -248.045
+0 ||| E D C E B ||| -248.045
+0 ||| B E E D B ||| -248.045
+0 ||| B D D B E ||| -248.045
+0 ||| E E E B B ||| -248.045
+0 ||| E B B E D ||| -248.045
+0 ||| C E C D C ||| -248.045
+0 ||| B E D A E ||| -248.045
+0 ||| B E B B E ||| -248.045
+0 ||| D B B D E ||| -248.045
+0 ||| B C E B E ||| -248.045
+0 ||| D C A E E ||| -248.045
+0 ||| E C E B D ||| -248.045
+0 ||| C E C E B ||| -248.045
+0 ||| E D B E C ||| -248.045
+0 ||| D A B E E ||| -248.045
+0 ||| E D A E D ||| -248.045
+0 ||| E B E E B ||| -248.045
+0 ||| C A D D E ||| -248.045
+0 ||| B A C E E ||| -248.045
+0 ||| D D B C E ||| -248.045
+0 ||| C E A E D ||| -248.045
+0 ||| E D E C C ||| -248.045
+0 ||| B E D D C ||| -248.045
+0 ||| E A B D E ||| -248.045
+0 ||| E B D E C ||| -248.045
+0 ||| D C D D D ||| -248.045
+0 ||| C D E C D ||| -248.045
+0 ||| C D C D D ||| -248.045
+0 ||| D B C E D ||| -248.045
+0 ||| E D C A E ||| -248.045
+0 ||| C C C E D ||| -248.045
+0 ||| C E D B D ||| -248.045
+0 ||| E A C E D ||| -248.045
+0 ||| C B E D D ||| -248.045
+0 ||| D B E E C ||| -248.045
+0 ||| B E B D D ||| -248.045
+0 ||| D E E A D ||| -248.045
+0 ||| C D B E D ||| -248.045
+0 ||| D D C E C ||| -248.045
+0 ||| E D C D C ||| -248.045
+0 ||| E B E A E ||| -248.045
+0 ||| E E D A D ||| -248.045
+0 ||| C C B D E ||| -248.045
+0 ||| D A C D E ||| -248.045
+0 ||| B E D E B ||| -248.045
+0 ||| E B C D D ||| -248.045
+0 ||| C A E E D ||| -248.045
+0 ||| E E A E C ||| -248.045
+0 ||| B D D D D ||| -248.045
+0 ||| E D E E A ||| -248.045
+0 ||| E E B B D ||| -248.045
+0 ||| E E C E A ||| -248.045
+0 ||| E D D B D ||| -248.045
+0 ||| C E E E A ||| -248.045
+0 ||| A D D C E ||| -249.045
+0 ||| A A E D E ||| -249.045
+0 ||| A D E E C ||| -249.045
+0 ||| A C E C E ||| -249.045
+0 ||| A C C D E ||| -249.045
+0 ||| A D B D E ||| -249.045
+0 ||| A B E E D ||| -249.045
+0 ||| A A D E E ||| -249.045
+0 ||| A E E B D ||| -249.045
+0 ||| A E A D E ||| -249.045
+0 ||| A E C E C ||| -249.045
+0 ||| A D C E D ||| -249.045
+0 ||| A C B E E ||| -249.045
+0 ||| A E B C E ||| -249.045
+0 ||| A B D D E ||| -249.045
+0 ||| D C E E C ||| -250.045
+0 ||| C C E B E ||| -250.045
+0 ||| C E E D B ||| -250.045
+0 ||| C E D D C ||| -250.045
+0 ||| E A E D D ||| -250.045
+0 ||| D E C C D ||| -250.045
+0 ||| E E B A E ||| -250.045
+0 ||| E E C D B ||| -250.045
+0 ||| E D E D B ||| -250.045
+0 ||| E D D D C ||| -250.045
+0 ||| D D E C D ||| -250.045
+0 ||| E C D E C ||| -250.045
+0 ||| B C E C E ||| -250.045
+0 ||| E E A D D ||| -250.045
+0 ||| E A D E D ||| -250.045
+0 ||| C B E C E ||| -250.045
+0 ||| D E D B D ||| -250.045
+0 ||| D B E B E ||| -250.045
+0 ||| D E C E B ||| -250.045
+0 ||| E B D B E ||| -250.045
+0 ||| D B D E D ||| -250.045
+0 ||| C E B D D ||| -250.045
+0 ||| B D B D E ||| -250.045
+0 ||| C D D B E ||| -250.045
+0 ||| E C C B E ||| -250.045
+0 ||| E E E D A ||| -250.045
+0 ||| E D D E B ||| -250.045
+0 ||| E B A E E ||| -250.045
+0 ||| C A C E E ||| -250.045
+0 ||| E E D E A ||| -250.045
+0 ||| D E C D C ||| -250.045
+0 ||| D A D D E ||| -250.045
+0 ||| D C D C E ||| -250.045
+0 ||| D E E E A ||| -250.045
+0 ||| B C B E E ||| -250.045
+0 ||| E E B E B ||| -250.045
+0 ||| B A D E E ||| -250.045
+0 ||| E C E C D ||| -250.045
+0 ||| E D B B E ||| -250.045
+0 ||| D D E E B ||| -250.045
+0 ||| D D D E C ||| -250.045
+0 ||| D D C D D ||| -250.045
+0 ||| D B E D D ||| -250.045
+0 ||| C D C C E ||| -250.045
+0 ||| E C E D C ||| -250.045
+0 ||| C D A E E ||| -250.045
+0 ||| D E B E C ||| -250.045
+0 ||| E C B E D ||| -250.045
+0 ||| E B C C E ||| -250.045
+0 ||| E C C D D ||| -250.045
+0 ||| C B C D E ||| -250.045
+0 ||| E E D C C ||| -250.045
+0 ||| C B B E E ||| -250.045
+0 ||| B D D C E ||| -250.045
+0 ||| D D E D C ||| -250.045
+0 ||| B E C E C ||| -250.045
+0 ||| B B D D E ||| -250.045
+0 ||| C E D A E ||| -250.045
+0 ||| B C C D E ||| -250.045
+0 ||| E D D C D ||| -250.045
+0 ||| D D C B E ||| -250.045
+0 ||| C E B B E ||| -250.045
+0 ||| D D E A E ||| -250.045
+0 ||| B E A D E ||| -250.045
+0 ||| C C D E D ||| -250.045
+0 ||| E D D A E ||| -250.045
+0 ||| D E C A E ||| -250.045
+0 ||| D E A E D ||| -250.045
+0 ||| C C E D D ||| -250.045
+0 ||| B D E E C ||| -250.045
+0 ||| E E A B E ||| -250.045
+0 ||| E E B C D ||| -250.045
+0 ||| E A E B E ||| -250.045
+0 ||| E D B D D ||| -250.045
+0 ||| E B D D D ||| -250.045
+0 ||| D A E E D ||| -250.045
+0 ||| C E D E B ||| -250.045
+0 ||| C D D D D ||| -250.045
+0 ||| E E B D C ||| -250.045
+0 ||| E C E E B ||| -250.045
+0 ||| E E E C B ||| -250.045
+0 ||| B A E D E ||| -250.045
+0 ||| B D C E D ||| -250.045
+0 ||| B B E E D ||| -250.045
+0 ||| B E E B D ||| -250.045
+0 ||| D C C E D ||| -250.045
+0 ||| D D B E D ||| -250.045
+0 ||| B E B C E ||| -250.045
+0 ||| D C B D E ||| -250.045
+0 ||| E C E A E ||| -250.045
+0 ||| C E D C D ||| -250.045
+0 ||| D E E C C ||| -250.045
+0 ||| A E C B E ||| -251.045
+0 ||| A E E A E ||| -251.045
+0 ||| A B C E E ||| -251.045
+0 ||| A D D E D ||| -251.045
+0 ||| A E B E D ||| -251.045
+0 ||| A D E B E ||| -251.045
+0 ||| A E D E C ||| -251.045
+0 ||| A D E D D ||| -251.045
+0 ||| A C D D E ||| -251.045
+0 ||| A C E E D ||| -251.045
+0 ||| A E C D D ||| -251.045
+0 ||| A E E E B ||| -251.045
+0 ||| A E E D C ||| -251.045
+0 ||| A E E C D ||| -251.045
+0 ||| E A E C E ||| -252.045
+0 ||| B E E E B ||| -252.045
+0 ||| D D D D D ||| -252.045
+0 ||| D D D B E ||| -252.045
+0 ||| E B D C E ||| -252.045
+0 ||| E E C B D ||| -252.045
+0 ||| B D D E D ||| -252.045
+0 ||| E E A C E ||| -252.045
+0 ||| C C B E E ||| -252.045
+0 ||| C D C E D ||| -252.045
+0 ||| C C E C E ||| -252.045
+0 ||| C D E E C ||| -252.045
+0 ||| C B E E D ||| -252.045
+0 ||| C D B D E ||| -252.045
+0 ||| B D E D D ||| -252.045
+0 ||| D B B E E ||| -252.045
+0 ||| E C A E E ||| -252.045
+0 ||| E B B D E ||| -252.045
+0 ||| B E C B E ||| -252.045
+0 ||| D E D A E ||| -252.045
+0 ||| C E B C E ||| -252.045
+0 ||| C E E B D ||| -252.045
+0 ||| D E E D B ||| -252.045
+0 ||| B E E D C ||| -252.045
+0 ||| D E D D C ||| -252.045
+0 ||| E D C E C ||| -252.045
+0 ||| D C D E D ||| -252.045
+0 ||| E E E B C ||| -252.045
+0 ||| E A B E E ||| -252.045
+0 ||| D C E D D ||| -252.045
+0 ||| C E C E C ||| -252.045
+0 ||| C B D D E ||| -252.045
+0 ||| E D E B D ||| -252.045
+0 ||| B E C D D ||| -252.045
+0 ||| B B C E E ||| -252.045
+0 ||| C C C D E ||| -252.045
+0 ||| D A C E E ||| -252.045
+0 ||| E B E E C ||| -252.045
+0 ||| E C D B E ||| -252.045
+0 ||| D B E C E ||| -252.045
+0 ||| C A E D E ||| -252.045
+0 ||| E C C C E ||| -252.045
+0 ||| D B C D E ||| -252.045
+0 ||| D D C C E ||| -252.045
+0 ||| E D B C E ||| -252.045
+0 ||| D E B B E ||| -252.045
+0 ||| B D E B E ||| -252.045
+0 ||| C D D C E ||| -252.045
+0 ||| E E E A D ||| -252.045
+0 ||| B E E C D ||| -252.045
+0 ||| C E A D E ||| -252.045
+0 ||| D D A E E ||| -252.045
+0 ||| E E D D B ||| -252.045
+0 ||| B C D D E ||| -252.045
+0 ||| E C D D D ||| -252.045
+0 ||| E B C E D ||| -252.045
+0 ||| D E D C D ||| -252.045
+0 ||| B C E E D ||| -252.045
+0 ||| B E B E D ||| -252.045
+0 ||| E A C D E ||| -252.045
+0 ||| B E D E C ||| -252.045
+0 ||| D C E B E ||| -252.045
+0 ||| E D A D E ||| -252.045
+0 ||| B E E A E ||| -252.045
+0 ||| D E B D D ||| -252.045
+0 ||| D E D E B ||| -252.045
+0 ||| C A D E E ||| -252.045
+0 ||| A B D E E ||| -253.045
+0 ||| A E A E E ||| -253.045
+0 ||| A A E E E ||| -253.045
+0 ||| A D B E E ||| -253.045
+0 ||| A C C E E ||| -253.045
+0 ||| A D C D E ||| -253.045
+0 ||| A B E D E ||| -253.045
+0 ||| A E D D D ||| -253.045
+0 ||| A E D B E ||| -253.045
+0 ||| A E C C E ||| -253.045
+0 ||| A D E C E ||| -253.045
+0 ||| D C B E E ||| -254.045
+0 ||| D E A D E ||| -254.045
+0 ||| E E C D C ||| -254.045
+0 ||| C C D D E ||| -254.045
+0 ||| D E E B D ||| -254.045
+0 ||| E E C E B ||| -254.045
+0 ||| E D E D C ||| -254.045
+0 ||| D E C E C ||| -254.045
+0 ||| C E B E D ||| -254.045
+0 ||| B E A E E ||| -254.045
+0 ||| E D E E B ||| -254.045
+0 ||| C E E E B ||| -254.045
+0 ||| B E D B E ||| -254.045
+0 ||| E B E D D ||| -254.045
+0 ||| E D D E C ||| -254.045
+0 ||| E E B E C ||| -254.045
+0 ||| E E C C D ||| -254.045
+0 ||| E E E E A ||| -254.045
+0 ||| C D E D D ||| -254.045
+0 ||| E A E E D ||| -254.045
+0 ||| C D D E D ||| -254.045
+0 ||| B B D E E ||| -254.045
+0 ||| D D E E C ||| -254.045
+0 ||| D C C D E ||| -254.045
+0 ||| E D E A E ||| -254.045
+0 ||| D B D D E ||| -254.045
+0 ||| D D B D E ||| -254.045
+0 ||| E C C E D ||| -254.045
+0 ||| C B C E E ||| -254.045
+0 ||| E E D B D ||| -254.045
+0 ||| B B E D E ||| -254.045
+0 ||| E A D D E ||| -254.045
+0 ||| C E C D D ||| -254.045
+0 ||| D C E C E ||| -254.045
+0 ||| B C C E E ||| -254.045
+0 ||| C E E C D ||| -254.045
+0 ||| E D B E D ||| -254.045
+0 ||| C E E A E ||| -254.045
+0 ||| E D C B E ||| -254.045
+0 ||| B D E C E ||| -254.045
+0 ||| B E C C E ||| -254.045
+0 ||| C E E D C ||| -254.045
+0 ||| D D C E D ||| -254.045
+0 ||| E E A E D ||| -254.045
+0 ||| E E C A E ||| -254.045
+0 ||| E C B D E ||| -254.045
+0 ||| D A D E E ||| -254.045
+0 ||| B E D D D ||| -254.045
+0 ||| E C D C E ||| -254.045
+0 ||| C E C B E ||| -254.045
+0 ||| E D E C D ||| -254.045
+0 ||| E D C D D ||| -254.045
+0 ||| D A E D E ||| -254.045
+0 ||| E B D E D ||| -254.045
+0 ||| D B E E D ||| -254.045
+0 ||| C C E E D ||| -254.045
+0 ||| D E B C E ||| -254.045
+0 ||| E B E B E ||| -254.045
+0 ||| B A E E E ||| -254.045
+0 ||| D D D C E ||| -254.045
+0 ||| E E E C C ||| -254.045
+0 ||| C E D E C ||| -254.045
+0 ||| E C E E C ||| -254.045
+0 ||| B D C D E ||| -254.045
+0 ||| C D E B E ||| -254.045
+0 ||| B D B E E ||| -254.045
+0 ||| A C E D E ||| -255.045
+0 ||| A D D D E ||| -255.045
+0 ||| A E B D E ||| -255.045
+0 ||| A D E E D ||| -255.045
+0 ||| A E E E C ||| -255.045
+0 ||| A E D C E ||| -255.045
+0 ||| A C D E E ||| -255.045
+0 ||| A E C E D ||| -255.045
+0 ||| D E E A E ||| -256.045
+0 ||| C E A E E ||| -256.045
+0 ||| D E E C D ||| -256.045
+0 ||| B E E E C ||| -256.045
+0 ||| E E B D D ||| -256.045
+0 ||| E C D E D ||| -256.045
+0 ||| E D D D D ||| -256.045
+0 ||| E D A E E ||| -256.045
+0 ||| B C D E E ||| -256.045
+0 ||| B C E D E ||| -256.045
+0 ||| E E E D B ||| -256.045
+0 ||| B D D D E ||| -256.045
+0 ||| C B D E E ||| -256.045
+0 ||| D E C D D ||| -256.045
+0 ||| D E E E B ||| -256.045
+0 ||| E E D E B ||| -256.045
+0 ||| E B E C E ||| -256.045
+0 ||| D E C B E ||| -256.045
+0 ||| D D E D D ||| -256.045
+0 ||| D E E D C ||| -256.045
+0 ||| D D D E D ||| -256.045
+0 ||| E B B E E ||| -256.045
+0 ||| C E C C E ||| -256.045
+0 ||| C E D D D ||| -256.045
+0 ||| D E B E D ||| -256.045
+0 ||| E E D C D ||| -256.045
+0 ||| E C E B E ||| -256.045
+0 ||| D E D E C ||| -256.045
+0 ||| D C E E D ||| -256.045
+0 ||| E D C C E ||| -256.045
+0 ||| B E B D E ||| -256.045
+0 ||| B E C E D ||| -256.045
+0 ||| E D D B E ||| -256.045
+0 ||| B E D C E ||| -256.045
+0 ||| C B E D E ||| -256.045
+0 ||| C E D B E ||| -256.045
+0 ||| C C C E E ||| -256.045
+0 ||| D B C E E ||| -256.045
+0 ||| E C E D D ||| -256.045
+0 ||| D C D D E ||| -256.045
+0 ||| C D E C E ||| -256.045
+0 ||| C D C D E ||| -256.045
+0 ||| E E D D C ||| -256.045
+0 ||| B D E E D ||| -256.045
+0 ||| C A E E E ||| -256.045
+0 ||| E A C E E ||| -256.045
+0 ||| C D B E E ||| -256.045
+0 ||| E B C D E ||| -256.045
+0 ||| E E D A E ||| -256.045
+0 ||| E E B B E ||| -256.045
+0 ||| D D E B E ||| -256.045
+0 ||| A E E D D ||| -257.045
+0 ||| A D C E E ||| -257.045
+0 ||| A B E E E ||| -257.045
+0 ||| A E D E D ||| -257.045
+0 ||| A E E B E ||| -257.045
+0 ||| C C E D E ||| -258.045
+0 ||| D E D B E ||| -258.045
+0 ||| D C C E E ||

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/src/test/resources/kenlm/oilers.kenlm
----------------------------------------------------------------------
diff --git a/src/test/resources/kenlm/oilers.kenlm b/src/test/resources/kenlm/oilers.kenlm
new file mode 100644
index 0000000..e343d7d
Binary files /dev/null and b/src/test/resources/kenlm/oilers.kenlm differ



[20/50] [abbrv] incubator-joshua git commit: Moved test file locations from resources/ to src/test/resources

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/20e6bf4b/resources/kbest_extraction/output.gold
----------------------------------------------------------------------
diff --git a/resources/kbest_extraction/output.gold b/resources/kbest_extraction/output.gold
deleted file mode 100644
index e75bb9e..0000000
--- a/resources/kbest_extraction/output.gold
+++ /dev/null
@@ -1,3126 +0,0 @@
-0 ||| A A A A A ||| lm_0=-28.045 tm_pt_0=-172.000 tm_glue_0=5.000 ||| -195.045
-0 ||| B A A A A ||| lm_0=-28.045 tm_pt_0=-173.000 tm_glue_0=5.000 ||| -196.045
-0 ||| C A A A A ||| lm_0=-28.045 tm_pt_0=-175.000 tm_glue_0=5.000 ||| -198.045
-0 ||| A B A A A ||| lm_0=-28.045 tm_pt_0=-176.000 tm_glue_0=5.000 ||| -199.045
-0 ||| B B A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
-0 ||| D A A A A ||| lm_0=-28.045 tm_pt_0=-177.000 tm_glue_0=5.000 ||| -200.045
-0 ||| A A A A B ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A A A B A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A A B A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| A C A A A ||| lm_0=-28.045 tm_pt_0=-178.000 tm_glue_0=5.000 ||| -201.045
-0 ||| B A A A B ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B A A B A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B A B A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| B C A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| C B A A A ||| lm_0=-28.045 tm_pt_0=-179.000 tm_glue_0=5.000 ||| -202.045
-0 ||| A A A C A ||| lm_0=-28.045 tm_pt_0=-180.000 tm_glue_0=5.000 ||| -203.045
-0 ||| C A A A B ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C A A B A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| B A A C A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C A B A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| E A A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| C C A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| D B A A A ||| lm_0=-28.045 tm_pt_0=-181.000 tm_glue_0=5.000 ||| -204.045
-0 ||| A A A A C ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B A B A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B A A B ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A A C A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A B B A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| A D A A A ||| lm_0=-28.045 tm_pt_0=-182.000 tm_glue_0=5.000 ||| -205.045
-0 ||| B A A A C ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A A A B ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B A C A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A A B A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B B B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| C A A C A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D A B A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| B D A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| D C A A A ||| lm_0=-28.045 tm_pt_0=-183.000 tm_glue_0=5.000 ||| -206.045
-0 ||| A A B A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A B B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A A B B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A B A C A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C A A B ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C A B A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A C B A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| A A D A A ||| lm_0=-28.045 tm_pt_0=-184.000 tm_glue_0=5.000 ||| -207.045
-0 ||| C A A A C ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A A B B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A B A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C A B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A B B A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B A A B ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| D A A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C A C A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B B A C A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| E B A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B C B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C B B A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| C D A A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| B A D A A ||| lm_0=-28.045 tm_pt_0=-185.000 tm_glue_0=5.000 ||| -208.045
-0 ||| A B A A C ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A A C B ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A B C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A B C A A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A C A C A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| A A A D A ||| lm_0=-28.045 tm_pt_0=-186.000 tm_glue_0=5.000 ||| -209.045
-0 ||| C A A B B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D A A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A B A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A A C B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B B A A C ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A A A B ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D A C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A A D A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D D A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B C A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A D A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C A B B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E A B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C B A C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| E C A A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C A B A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B B C A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| B A B C A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| C C B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| D B B A A ||| lm_0=-28.045 tm_pt_0=-187.000 tm_glue_0=5.000 ||| -210.045
-0 ||| A B A B B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B B B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A A B C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D A B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A C A A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A C B A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A C A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A C C A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A B A C ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B D A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A A A D ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A A E A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A B B A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A E A A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D A A B ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| A D B A A ||| lm_0=-28.045 tm_pt_0=-188.000 tm_glue_0=5.000 ||| -211.045
-0 ||| B D A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C B A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A C A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| E A A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B A B B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A A D A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A A B C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B C A A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D B A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A A A D ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A C B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C A A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A B B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B D A B A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A A C B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A E A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B A B A C ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C C A C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A B A B ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B C C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C A B C A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B E A A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D A D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| C B C A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B B D A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| D C B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| B D B A A ||| lm_0=-28.045 tm_pt_0=-189.000 tm_glue_0=5.000 ||| -212.045
-0 ||| A C B A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A D A B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A B B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A A C C ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B A C B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C A B B ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B B C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A A E A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C B B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A D B A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A B A D A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A D A C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A A C C A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| A C D A A ||| lm_0=-28.045 tm_pt_0=-190.000 tm_glue_0=5.000 ||| -213.045
-0 ||| B C A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A B B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B B A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A A B C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A C A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B A C B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A B A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D A A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A D A B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B A B B ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E A A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D B A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A A A D ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C C A A C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A A C C ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A D B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A C C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B B C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D C A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D A A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B B A D A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A C B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B A A E A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C C C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B D A C A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E B B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B B B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C A E A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D A B A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C D B A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| B C D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E D A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| D B C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C E A A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| E A C A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| C B D A A ||| lm_0=-28.045 tm_pt_0=-191.000 tm_glue_0=5.000 ||| -214.045
-0 ||| A B C A B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B B A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A D A A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A C A C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B A B C ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A B C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C A C B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B A A D ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A A D B ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B C B A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C A D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A D C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A C B C A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A A B D A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A B E A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| A D C A A ||| lm_0=-28.045 tm_pt_0=-192.000 tm_glue_0=5.000 ||| -215.045
-0 ||| B B C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A B C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A C A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A C A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B D A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C C D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B A B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A B D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A A D B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A D B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A A A D ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D C C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C A B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A D A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B C B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B D C A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A B B B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C D A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D A A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B B B A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A A C C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D D B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B A B C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B A D C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B A C B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A A E A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A B A B ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D B D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D C A A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B B A C ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D E A A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C A C C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E A D A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E C B A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B C B C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| B B E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| C B A D A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| D A E A A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| E B A C A ||| lm_0=-28.045 tm_pt_0=-193.000 tm_glue_0=5.000 ||| -216.045
-0 ||| A D B A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A C B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C A B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B B B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B A C C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B D A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A E A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C C A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E A A B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D A B B ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A B B C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B D B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A D A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C B A C ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B C C A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A A B D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C C B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A B A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D D A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C A A D ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A D B B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E A B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A C E A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A A E B A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A E B A A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| A B A E A ||| lm_0=-28.045 tm_pt_0=-194.000 tm_glue_0=5.000 ||| -217.045
-0 ||| B B B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D A B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E A A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A B B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A E A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A C B B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A B C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A A D B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B A C B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A B B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B C A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A D A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D B A B ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E C A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B A B C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A E B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A C C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B B A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E B A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A B D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A D A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A D C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B A C C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C D C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C A C A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D D A C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C D A A C ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A B A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E B C A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C A A D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A D B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B A A B D ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E A B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B B C A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D B A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| E A A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D D A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C B C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C E A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B C C B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B E B A A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| C C A D A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B D B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D A A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| D C B B A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| B B A E A ||| lm_0=-28.045 tm_pt_0=-195.000 tm_glue_0=5.000 ||| -218.045
-0 ||| A B B C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A C D ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B A D B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A D C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C D A B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C A C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A E B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C B B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A D B B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A C C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D A C B ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A B E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A A A E ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B C A C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D B C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A B C C ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A E A C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B D C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C C C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C D B A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A C D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A D A D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A B B D A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A A E C A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| A C A E A ||| lm_0=-28.045 tm_pt_0=-196.000 tm_glue_0=5.000 ||| -219.045
-0 ||| E A A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A C C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A D B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A B C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A C D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A B A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A A B D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E C A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B C A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A D C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B A D B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A D A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A B C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B A B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B A A D ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A C B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A C D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D A C B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A E B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A E C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A E A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A B E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C B B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D D A A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D A B B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A B B C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D B C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D B A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A D C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A B A C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B A A A E ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D A B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E A A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B A C C ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B E A C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B D A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A C A B ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C A E B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E E A A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C C C A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B B B D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C D D A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D C A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D D C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C C E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E B B B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E B A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E C C A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C E A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A E A A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B C A E A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| D B C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E D A B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| E A C B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| C B D B A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| B D A D A ||| lm_0=-28.045 tm_pt_0=-197.000 tm_glue_0=5.000 ||| -220.045
-0 ||| A E A A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B B A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A B D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B B B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A E A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D B A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A C B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C B C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B D A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D A B C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C C A C ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B E A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A D C B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C A D B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B C B B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A C A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D C A B ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B A B D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D C B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D A A D ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A B E B A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C D C A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A E C A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A C B D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A D E A A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| A A D D A ||| lm_0=-28.045 tm_pt_0=-198.000 tm_glue_0=5.000 ||| -221.045
-0 ||| D C B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A B D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A D B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C B A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A E B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A D C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A D A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E A A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A C C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B A D B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C B C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A E A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A B C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A E A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D A B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A B B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B E A A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A C B C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D B A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A D C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B A C C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B C A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A C A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B D A C ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A B A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D A B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A C B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D C A B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C A A D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C B B B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B A B D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A A E ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A A C D ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D A C B ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B A D D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D C B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E A B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B B E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D A E B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A B E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B D B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A E C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C D C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E B B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D A D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C D B C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E C D A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E A C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B E C A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B A E A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D E B A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D D B B A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B D E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| E D A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D C E A A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C E A C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| B C B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| D B C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C B B D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C A C D A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| C C C C A ||| lm_0=-28.045 tm_pt_0=-199.000 tm_glue_0=5.000 ||| -222.045
-0 ||| A C A B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D B B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D D A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B C C B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E B B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C C B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A B B D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D C C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B D B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A E B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C E B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C E A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E B A B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D D B A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A E B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B E C A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A D A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E D A A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A A E ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A C E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C B B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B B E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C D A C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D A E A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A D C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B C D A ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A A E C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B A C D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A E A B B ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A C B A D ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A D B C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A B B C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A D A C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| A A C C C ||| lm_0=-28.045 tm_pt_0=-200.000 tm_glue_0=5.000 ||| -223.045
-0 ||| B B B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A E B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D A C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B C C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A D C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D C B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A B D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D B B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B C A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A B B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A D B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E A B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D D A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A C D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B A D B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E C A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E B A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C E A B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D E A C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E A B C B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D D B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A E B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D C C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C C B B ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B A B D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A E C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A C A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B D C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C E B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A C D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A D A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B B D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A C C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E D C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D A D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B B A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C E C A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A D B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A B E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B E A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A D C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D C A E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E B A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E D A A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B D A C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B E B B A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A B C C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A C E A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D A B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D D B C A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A C B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A D D A ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C E A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D A A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B A A E C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D A A D ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C C C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| E D A A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C A E A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| D B C A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C B B C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B B A A E ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| B C D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C D B A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| C B D A C ||| lm_0=-28.045 tm_pt_0=-201.000 tm_glue_0=5.000 ||| -224.045
-0 ||| A C D B B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C C C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A C D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D A D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E A C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B D C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B B D B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A E D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A E C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C E C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A A D D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D D C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B E B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A D E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A C D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C C D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B C A D ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D B D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D B C B ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E A D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A A E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C B E A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A D C A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B D D A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A A B E ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A E B C A ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A B D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C A D C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A C B C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A A D C C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B E A C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| A B C B C ||| lm_0=-28.045 tm_pt_0=-202.000 tm_glue_0=5.000 ||| -225.045
-0 ||| C C E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A D C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A A E C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C B A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A C C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A D C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E A A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D E A A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A D A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B C C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D D A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C B C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A E B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A E A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A D B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B A C C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A A B E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A C D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D A E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A D E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B C A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E B B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A C E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A E C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B C C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A D A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B E C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E A B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C D D B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E A C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C C B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A B D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E B C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E B A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D D C A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B A B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D E C A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E B B B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B E A D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C E A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A B A E ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B B D D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E C C A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C E D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D A B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A A D D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E E B A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A E A B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B A E D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D B C B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E D D A A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C A E B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C C D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D A D B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B D B B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D B D A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D C B C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B C B E A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D A A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A E B A ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C A B B D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| E A B A D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| B D C A C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A D C B ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D A C B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| D D A B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C C B B C ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| C B A C D ||| lm_0=-28.045 tm_pt_0=-203.000 tm_glue_0=5.000 ||| -226.045
-0 ||| A C E A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B D B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E B A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A E B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D D A C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B C C C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E C A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A D D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D E A B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D B B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C D C B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B E B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D E B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D C B B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B C E A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B A E C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E C B A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A A C E ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E E A A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A C B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C D D A ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D B A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E A A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C C B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A A E A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B B B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A D A B D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A B D A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C C A D ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A E A B C ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| A C B D B ||| lm_0=-28.045 tm_pt_0=-204.000 tm_glue_0=5.000 ||| -227.045
-0 ||| E C B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A E B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A E C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C D C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D D A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B B C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D A D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E C A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A E B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E B A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D B B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D A C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C E A B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A C D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B B D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C C C B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A D D B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D C B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E B A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C A B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B C C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A E A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D A C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A D B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A C B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D B B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E A A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A B B D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B C A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E A B B ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A E B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C C A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A C D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D D A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E A B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A A D D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D B A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E C B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A B C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C E A C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B A E C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E B B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C C B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B A A C E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A A B E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D E D A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C D B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B E E A A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B A A E ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A B D C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E B C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A D B C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D A C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B D A D ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B B C E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A D C C ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B E C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B D E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E B D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A E D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D D C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E E A C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B B E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C A D E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C B D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E C C C A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C C C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E A C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C D B D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D D A E A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| B C D D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D B C D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| D C E B A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| E D A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| C E A D A ||| lm_0=-28.045 tm_pt_0=-205.000 tm_glue_0=5.000 ||| -228.045
-0 ||| A B E C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C B B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C D B C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D C C B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C C C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D D B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B C D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C E B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B E B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E A C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B D C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A B E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C D A D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A E C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E B B B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E D A B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B D E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C A E C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B A B E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D E C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A C A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D B C C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A C C E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A D B D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B D C ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A E E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B B A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D A A E ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D B E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B A D D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A A A E D ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B E D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A B C D B ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E C C A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E A E A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A D C D A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| A E D B A ||| lm_0=-28.045 tm_pt_0=-206.000 tm_glue_0=5.000 ||| -229.045
-0 ||| B A C A E ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E E A A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E B C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C C D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B C D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C C E A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B C D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B C C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D C B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E A D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D C C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E C A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C E C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E C B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D D B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D E A C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E A B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B D C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D D A D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D A E C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B D A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| E D C A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B C E B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B B D B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D E A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C A E B C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D C A E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D B A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B B B D C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D D B C B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B E D A B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B A C E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D A B E B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B D A D ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| B E B B B ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B A E C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C D D A C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| C B C C C ||| lm_0=-28.045 tm_pt_0=-207.000 tm_glue_0=5.000 ||| -230.045
-0 ||| D B E A C ||| lm_0=-28.045 tm_pt_0=-207.00

<TRUNCATED>


[12/50] [abbrv] incubator-joshua git commit: Now building HGNode over the phrase when it's added

Posted by mj...@apache.org.
Now building HGNode over the phrase when it's added

This should be much quicker because the HGNode gets built only once, when the target phrases are added, instead of building it many times, each time they are used


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/12b834e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/12b834e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/12b834e2

Branch: refs/heads/7
Commit: 12b834e271a361417cbdabf79036538493cdb122
Parents: d28b4f3
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Aug 22 15:59:43 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Aug 22 15:59:43 2016 -0500

----------------------------------------------------------------------
 .../joshua/decoder/hypergraph/HGNode.java       | 18 +---
 .../apache/joshua/decoder/phrase/Candidate.java | 27 ++----
 .../apache/joshua/decoder/phrase/Future.java    |  4 +-
 .../joshua/decoder/phrase/PhraseChart.java      | 59 +++++++++----
 .../joshua/decoder/phrase/PhraseNodes.java      | 63 ++++++++++++++
 .../apache/joshua/decoder/phrase/Stacks.java    |  2 +-
 .../joshua/decoder/phrase/TargetPhrases.java    | 87 --------------------
 .../phrase/decode/PhraseDecodingTest.java       |  2 -
 8 files changed, 116 insertions(+), 146 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java b/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
index 23f4247..c353a36 100644
--- a/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
+++ b/src/main/java/org/apache/joshua/decoder/hypergraph/HGNode.java
@@ -246,12 +246,11 @@ public class HGNode {
    */
   // sort by estTotalLogP: for pruning purpose
   public int compareTo(HGNode anotherItem) {
-    throw new RuntimeException("HGNode, compare functiuon should never be called");
+    throw new RuntimeException("HGNode.compareTo(HGNode) is not implemented");
     /*
      * if (this.estTotalLogP > anotherItem.estTotalLogP) { return -1; } else if (this.estTotalLogP
      * == anotherItem.estTotalLogP) { return 0; } else { return 1; }
      */
-
   }
 
   /**
@@ -285,21 +284,6 @@ public class HGNode {
     }
   };
 
-  /**
-   * natural order
-   * */
-  public static Comparator<HGNode> logPComparator = (item1, item2) -> {
-    float logp1 = item1.score;
-    float logp2 = item2.score;
-    if (logp1 > logp2) {
-      return 1;
-    } else if (logp1 == logp2) {
-      return 0;
-    } else {
-      return -1;
-    }
-  };
-
   public String toString() {
     StringBuilder sb = new StringBuilder();
 

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index 2a5dc03..bc770f4 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@ -42,7 +42,6 @@ import org.apache.joshua.decoder.ff.FeatureFunction;
 import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 import org.apache.joshua.decoder.ff.tm.Rule;
 import org.apache.joshua.decoder.hypergraph.HGNode;
-import org.apache.joshua.decoder.hypergraph.HyperEdge;
 import org.apache.joshua.decoder.segment_file.Sentence;
 
 public class Candidate implements Comparable<Candidate> {
@@ -54,7 +53,7 @@ public class Candidate implements Comparable<Candidate> {
   private final List<Hypothesis> hypotheses;
 
   // the list of target phrases gathered from a span of the input
-  private TargetPhrases phrases;
+  private PhraseNodes phrases;
   
   // future cost of applying phrases to hypotheses
   private float future_delta;
@@ -70,14 +69,7 @@ public class Candidate implements Comparable<Candidate> {
    * state. Expensive to compute so there is an option of delaying it.
    */
   private ComputeNodeResult computedResult;
-  
-  /*
-   * This is the HGNode built over the current target side phrase. It requires the computed results
-   * as part of its constructor, so we delay computing it unless needed.
-   */
-  private HGNode phraseNode;
-  private ComputeNodeResult phraseResult;
-  
+
   /**
    * When candidate objects are extended, the new one is initialized with the same underlying
    * "phrases" and "hypotheses" and "span" objects. So these all have to be equal, as well as
@@ -121,7 +113,7 @@ public class Candidate implements Comparable<Candidate> {
   }
 
   public Candidate(List<FeatureFunction> featureFunctions, Sentence sentence, 
-      List<Hypothesis> hypotheses, TargetPhrases phrases, float delta, int[] ranks) {
+      List<Hypothesis> hypotheses, PhraseNodes phrases, float delta, int[] ranks) {
     this.featureFunctions = featureFunctions;
     this.sentence = sentence;
     this.hypotheses = hypotheses;
@@ -131,7 +123,6 @@ public class Candidate implements Comparable<Candidate> {
     this.rule = isMonotonic() ? Hypothesis.MONO_RULE : Hypothesis.SWAP_RULE;
 //    this.score = hypotheses.get(ranks[0]).score + phrases.get(ranks[1]).getEstimatedCost();
 
-    this.phraseNode = null;
     this.computedResult = null;
     
     // TODO: compute this proactively or lazily according to a parameter
@@ -213,7 +204,8 @@ public class Candidate implements Comparable<Candidate> {
    * @return the phrase rule at position ranks[1]
    */
   public Rule getPhraseRule() {
-    return this.phrases.get(ranks[1]);
+    Rule rule = getPhraseNode().bestHyperedge.getRule();
+    return rule;
   }
   
   /**
@@ -223,7 +215,7 @@ public class Candidate implements Comparable<Candidate> {
    * @return a new hypergraph node representing the phrase translation
    */
   public HGNode getPhraseNode() {
-    return phraseNode;
+    return this.phrases.get(ranks[1]);
   }
   
   /**
@@ -234,11 +226,6 @@ public class Candidate implements Comparable<Candidate> {
    */
   public ComputeNodeResult computeResult() {
     if (computedResult == null) {
-      // add the phrase node
-      phraseResult = new ComputeNodeResult(featureFunctions, getPhraseRule(), null, phrases.i, phrases.j, null, sentence);
-      HyperEdge edge = new HyperEdge(getPhraseRule(), phraseResult.getViterbiCost(), phraseResult.getTransitionCost(), null, null);
-      phraseNode = new HGNode(phrases.i, phrases.j, getPhraseRule().getLHS(), phraseResult.getDPStates(), edge, phraseResult.getPruningEstimate());
-
       // add the rule
       // TODO: sourcepath
       computedResult = new ComputeNodeResult(featureFunctions, getRule(), getTailNodes(), getLastCovered(), getPhraseEnd(), null, sentence);
@@ -299,7 +286,7 @@ public class Candidate implements Comparable<Candidate> {
    */
   public float score() {
 //    float score = computedResult.getViterbiCost() + future_delta;
-    float score = getHypothesis().getScore() + future_delta + phraseResult.getTransitionCost() + computedResult.getTransitionCost();
+    float score = getHypothesis().getScore() + getPhraseNode().getScore() + future_delta + computedResult.getTransitionCost();
     return score;
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/Future.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Future.java b/src/main/java/org/apache/joshua/decoder/phrase/Future.java
index 005c776..a81fff5 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Future.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Future.java
@@ -59,9 +59,9 @@ public class Future {
         if (begin == sentlen - 1 && end == sentlen) 
           setEntry(begin, end, 0.0f);
         else {
-          TargetPhrases phrases = chart.getRange(begin, end);
+          PhraseNodes phrases = chart.getRange(begin, end);
           if (phrases != null)
-            setEntry(begin, end, phrases.get(0).getEstimatedCost());
+            setEntry(begin, end, phrases.get(0).bestHyperedge.getRule().getEstimatedCost());
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java b/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
index c0dbfbc..5607949 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
@@ -22,10 +22,12 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.joshua.decoder.Decoder;
+import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
 import org.apache.joshua.decoder.ff.FeatureFunction;
 import org.apache.joshua.decoder.ff.tm.Rule;
 import org.apache.joshua.decoder.ff.tm.RuleCollection;
+import org.apache.joshua.decoder.hypergraph.HGNode;
+import org.apache.joshua.decoder.hypergraph.HyperEdge;
 import org.apache.joshua.decoder.segment_file.Sentence;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,11 +44,16 @@ public class PhraseChart {
   private int max_source_phrase_length;
 
   // Banded array: different source lengths are next to each other.
-  private final List<TargetPhrases> entries;
+  private final List<PhraseNodes> entries;
 
   // number of translation options
-  int numOptions = 20;
+  private int numOptions = 20;
+  
+  // The feature functions
   private final List<FeatureFunction> features;
+  
+  // The input sentence
+  private Sentence sentence;
 
   /**
    * Create a new PhraseChart object, which represents all phrases that are
@@ -65,6 +72,7 @@ public class PhraseChart {
 
     this.numOptions = num_options;
     this.features = features;
+    this.sentence = source;
 
     max_source_phrase_length = 0;
     for (PhraseTable table1 : tables)
@@ -93,8 +101,10 @@ public class PhraseChart {
       }
     }
 
-    entries.stream().filter(phrases -> phrases != null)
-        .forEach(phrases -> phrases.finish(features, Decoder.weights, num_options));
+    /* 
+     * Sort all of the HGNodes that were added.
+     */
+    entries.stream().filter(phrases -> phrases != null).forEach(phrases -> phrases.finish());
 
     LOG.info("Input {}: Collecting options took {} seconds", source.id(),
         (System.currentTimeMillis() - startTime) / 1000.0f);
@@ -103,11 +113,13 @@ public class PhraseChart {
       for (int i = 1; i < sentence_length - 1; i++) {
         for (int j = i + 1; j < sentence_length && j <= i + max_source_phrase_length; j++) {
           if (source.hasPath(i, j)) {
-            TargetPhrases phrases = getRange(i, j);
+            PhraseNodes phrases = getRange(i, j);
             if (phrases != null) {
               LOG.debug("{} ({}-{})", source.source(i,j), i, j);
-              for (Rule rule: phrases)
+              for (HGNode node: phrases) {
+                Rule rule = node.bestHyperedge.getRule();
                 LOG.debug("    {} :: est={}", rule.getEnglishWords(), rule.getEstimatedCost());
+              }
             }
           }
         }
@@ -140,9 +152,9 @@ public class PhraseChart {
    * 
    * @param begin beginning of span
    * @param end end of span
-   * @return the {@link org.apache.joshua.decoder.phrase.TargetPhrases} at the specified position in this list.
+   * @return the {@link org.apache.joshua.decoder.phrase.PhraseNodes} at the specified position in this list.
    */
-  public TargetPhrases getRange(int begin, int end) {
+  public PhraseNodes getRange(int begin, int end) {
     int index = offset(begin, end);
     // System.err.println(String.format("PhraseChart::Range(%d,%d): found %d entries",
     // begin, end,
@@ -153,6 +165,8 @@ public class PhraseChart {
 
     if (index < 0 || index >= entries.size() || entries.get(index) == null)
       return null;
+    
+    // Produce the nodes for each of the features
 
     return entries.get(index);
   }
@@ -160,11 +174,11 @@ public class PhraseChart {
   /**
    * Add a set of phrases from a grammar to the current span.
    * 
-   * @param begin beginning of span
-   * @param end end of span
+   * @param i beginning of span
+   * @param j end of span
    * @param to a {@link org.apache.joshua.decoder.ff.tm.RuleCollection} to be used in scoring and sorting.
    */
-  private void addToRange(int begin, int end, RuleCollection to) {
+  private void addToRange(int i, int j, RuleCollection to) {
     if (to != null) {
       /*
        * This first call to getSortedRules() is important, because it is what
@@ -176,17 +190,28 @@ public class PhraseChart {
        * likely to have (often into the tens of thousands).
        */
       List<Rule> rules = to.getSortedRules(features);
+      
+      // TODO: I think this is a race condition
       if (numOptions > 0 && rules.size() > numOptions)
-        rules = rules.subList(0,  numOptions);
+        rules = rules.subList(0,  numOptions - 1);
 //        to.getRules().subList(numOptions, to.getRules().size()).clear();
 
       try {
-        int offset = offset(begin, end);
+        int offset = offset(i, j);
         if (entries.get(offset) == null)
-          entries.set(offset, new TargetPhrases(begin, end));
-        entries.get(offset).addAll(rules);
+          entries.set(offset, new PhraseNodes(i, j, numOptions));
+        PhraseNodes nodes = entries.get(offset);
+
+        // Turn each rule into an HGNode, add them one by one 
+        for (Rule rule: rules) {
+          ComputeNodeResult result = new ComputeNodeResult(features, rule, null, i, j, null, sentence);
+          HyperEdge edge = new HyperEdge(rule, result.getViterbiCost(), result.getTransitionCost(), null, null);
+          HGNode phraseNode = new HGNode(i, j, rule.getLHS(), result.getDPStates(), edge, result.getPruningEstimate());
+          nodes.add(phraseNode);
+        }
+//        entries.get(offset).addAll(rules);
       } catch (java.lang.IndexOutOfBoundsException e) {
-        LOG.error("Whoops! {} [{}-{}] too long ({})", to, begin, end, entries.size());
+        LOG.error("Whoops! {} [{}-{}] too long ({})", to, i, j, entries.size());
         LOG.error(e.getMessage(), e);
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java b/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
new file mode 100644
index 0000000..c20c05a
--- /dev/null
+++ b/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.joshua.decoder.phrase;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.apache.joshua.decoder.hypergraph.HGNode;
+
+/**
+ * Represents a sorted collection of target-side phrases. Typically, these are phrases
+ * generated from the same source word sequence. The list of options is reduced to the number
+ * of translation options.
+ * 
+ * @author Matt Post
+ */
+
+public class PhraseNodes extends ArrayList<HGNode> {
+
+  private static final long serialVersionUID = 1L;
+  
+  public int i = -2;
+  public int j = -2;
+
+  public PhraseNodes(int i, int j, int initialSize) {
+    super(initialSize);
+    this.i = i;
+    this.j = j;
+  }
+  
+  /**
+   * Score the rules and sort them. Scoring is necessary because rules are only scored if they
+   * are used, in an effort to make reading in rules more efficient. This is starting to create
+   * some trouble and should probably be reworked.
+   * 
+   * @param features a {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
+   * @param weights a populated {@link org.apache.joshua.decoder.ff.FeatureVector}
+   * @param num_options the number of options
+   */
+  public void finish() {
+    Collections.sort(this, HGNode.inverseLogPComparator);    
+//    System.err.println("TargetPhrases::finish()");
+//    for (Rule rule: this) 
+//      System.err.println("  " + rule);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
index 095289f..cfeaea2 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
@@ -174,7 +174,7 @@ public class Stacks {
             /* We have found a permissible phrase start point and length for the current coverage
              * vector. Find all the phrases over that span.
              */
-            TargetPhrases phrases = chart.getRange(begin, begin + phrase_length);
+            PhraseNodes phrases = chart.getRange(begin, begin + phrase_length);
             if (phrases == null)
               continue;
 

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/main/java/org/apache/joshua/decoder/phrase/TargetPhrases.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/TargetPhrases.java b/src/main/java/org/apache/joshua/decoder/phrase/TargetPhrases.java
deleted file mode 100644
index 5692d1a..0000000
--- a/src/main/java/org/apache/joshua/decoder/phrase/TargetPhrases.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.joshua.decoder.phrase;
-
-import java.util.ArrayList;	
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.joshua.decoder.ff.FeatureFunction;
-import org.apache.joshua.decoder.ff.FeatureVector;
-import org.apache.joshua.decoder.ff.tm.Rule;
-
-/**
- * Represents a sorted collection of target-side phrases. Typically, these are phrases
- * generated from the same source word sequence. The list of options is reduced to the number
- * of translation options.
- * 
- * @author Matt Post
- */
-
-public class TargetPhrases extends ArrayList<Rule> {
-
-  private static final long serialVersionUID = 1L;
-  
-  public int i = -2;
-  public int j = -2;
-
-  public TargetPhrases(int i, int j) {
-    super();
-    
-    this.i = i;
-    this.j = j;
-  }
-  
-  /**
-   * Initialize with a collection of rules.
-   * 
-   * @param list a {@link java.util.List} of {@link org.apache.joshua.decoder.ff.tm.Rule}'s
-   */
-  public TargetPhrases(List<Rule> list) {
-    super();
-    
-    for (Rule rule: list) {
-      add(rule);
-    }
-  }
-  
-  /**
-   * Score the rules and sort them. Scoring is necessary because rules are only scored if they
-   * are used, in an effort to make reading in rules more efficient. This is starting to create
-   * some trouble and should probably be reworked.
-   * 
-   * @param features a {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
-   * @param weights a populated {@link org.apache.joshua.decoder.ff.FeatureVector}
-   * @param num_options the number of options
-   */
-  public void finish(List<FeatureFunction> features, FeatureVector weights, int num_options) {
-    for (Rule rule: this) { 
-      rule.estimateRuleCost(features);
-//      System.err.println("TargetPhrases:finish(): " + rule);
-    }
-    Collections.sort(this, Rule.EstimatedCostComparator);
-    
-    if (this.size() > num_options)
-      this.removeRange(num_options, this.size());
-    
-//    System.err.println("TargetPhrases::finish()");
-//    for (Rule rule: this) 
-//      System.err.println("  " + rule);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/12b834e2/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
index 5e878cb..8be3c36 100644
--- a/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
+++ b/src/test/java/org/apache/joshua/decoder/phrase/decode/PhraseDecodingTest.java
@@ -21,8 +21,6 @@
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 
 import org.apache.joshua.decoder.Decoder;
 import org.apache.joshua.decoder.JoshuaConfiguration;


[31/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
index 0098e9f,0000000..12f0217
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Candidate.java
@@@ -1,241 -1,0 +1,314 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +/*** 
-  * A candidate is basically a cube prune state. It contains a list of hypotheses and target
-  * phrases, and an instantiated candidate is a pair of indices that index these two lists. This
-  * is the "cube prune" position.
++ * A candidate represents a translation hypothesis that may possibly be added to the translation
++ * hypergraph. It groups together (a) a set of translation hypotheses all having the same coverage
++ * vector and (b) a set of compatible phrase extensions that all cover the same source span. A 
++ * Candidate object therefore denotes a particular precise coverage vector. When a Candidate is
++ * instantiated, it has values in ranks[] that are indices into these two lists representing
++ * the current cube prune state.
++ * 
++ * For any particular (previous hypothesis) x (translation option) combination (a selection from
++ * both lists), there is no guarantee about whether this is a (m)onotonic, (s)wap, or (d)iscontinuous
++ * rule application. This must be inferred from the span (recording the portion of the input being
++ * translated) and the last index of the previous hypothesis under consideration.
 + */
 +
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Span;
 +import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
++import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
++import org.apache.joshua.decoder.segment_file.Sentence;
 +
- public class Candidate {
- 
++public class Candidate implements Comparable<Candidate> {
++  
++  private List<FeatureFunction> featureFunctions;
++  private Sentence sentence;
++  
 +  // the set of hypotheses that can be paired with phrases from this span 
-   private List<Hypothesis> hypotheses;
++  private final List<Hypothesis> hypotheses;
 +
 +  // the list of target phrases gathered from a span of the input
-   private TargetPhrases phrases;
- 
-   // source span of new phrase
-   public Span span;
++  private PhraseNodes phrases;
 +  
 +  // future cost of applying phrases to hypotheses
-   float future_delta;
++  private float future_delta;
 +  
 +  // indices into the hypotheses and phrases arrays (used for cube pruning)
-   private int[] ranks;
++  private final int[] ranks;
 +  
-   // scoring and state information 
-   private ComputeNodeResult result;
++  // the reordering rule used by an instantiated Candidate
++  private Rule rule;
 +  
++  /* 
++   * Stores the inside cost of the current phrase, as well as the computed dynamic programming
++   * state. Expensive to compute so there is an option of delaying it.
++   */
++  private ComputeNodeResult computedResult;
++
 +  /**
 +   * When candidate objects are extended, the new one is initialized with the same underlying
 +   * "phrases" and "hypotheses" and "span" objects. So these all have to be equal, as well as
 +   * the ranks.
 +   * 
 +   * This is used to prevent cube pruning from adding the same candidate twice, having reached
 +   * a point in the cube via different paths.
 +   */
 +  @Override
 +  public boolean equals(Object obj) {
 +    if (obj instanceof Candidate) {
 +      Candidate other = (Candidate) obj;
-       if (hypotheses != other.hypotheses || phrases != other.phrases || span != other.span)
++      if (hypotheses != other.hypotheses || phrases != other.phrases)
 +        return false;
 +      
 +      if (ranks.length != other.ranks.length)
 +        return false;
 +      
 +      for (int i = 0; i < ranks.length; i++)
 +        if (ranks[i] != other.ranks[i])
 +          return false;
 +          
 +      return true;
 +    }
 +    return false;
 +  }
 +  
 +  @Override
 +  public int hashCode() {
 +    return 17 * hypotheses.size() 
 +        + 23 * phrases.size() 
-         + 57 * span.hashCode() 
 +        + 117 * Arrays.hashCode(ranks);
 +//    return hypotheses.hashCode() * phrases.hashCode() * span.hashCode() * Arrays.hashCode(ranks);
 +  }
 +  
 +  @Override
 +  public String toString() {
-     return String.format("CANDIDATE(hyp %d/%d, phr %d/%d) [%s] phrase=[%s] span=%s",
-         ranks[0], hypotheses.size(), ranks[1], phrases.size(),
-         getHypothesis(), getRule().getTargetWords().replaceAll("\\[.*?\\] ",""), getSpan());
-   }
-   
-   public Candidate(List<Hypothesis> hypotheses, TargetPhrases phrases, Span span, float delta) {
-     this.hypotheses = hypotheses;
-     this.phrases = phrases;
-     this.span = span;
-     this.future_delta = delta;
-     this.ranks = new int[] { 0, 0 };
++    return String.format("CANDIDATE(hyp %d/%d, phr %d/%d) %.3f [%s] phrase=[%s] span=%s",
++        ranks[0], hypotheses.size(), ranks[1], phrases.size(), score(),
++        getHypothesis(), getPhraseNode().bestHyperedge.getRule().getTargetWords(), getSpan());
 +  }
 +
-   public Candidate(List<Hypothesis> hypotheses, TargetPhrases phrases, Span span, float delta, int[] ranks) {
++  public Candidate(List<FeatureFunction> featureFunctions, Sentence sentence, 
++      List<Hypothesis> hypotheses, PhraseNodes phrases, float delta, int[] ranks) {
++    this.featureFunctions = featureFunctions;
++    this.sentence = sentence;
 +    this.hypotheses = hypotheses;
 +    this.phrases = phrases;
-     this.span = span;
 +    this.future_delta = delta;
 +    this.ranks = ranks;
++    this.rule = isMonotonic() ? Hypothesis.MONO_RULE : Hypothesis.SWAP_RULE;
 +//    this.score = hypotheses.get(ranks[0]).score + phrases.get(ranks[1]).getEstimatedCost();
++
++    this.computedResult = null;
++    
++    // TODO: compute this proactively or lazily according to a parameter
++    computeResult();
++  }
++  
++  /**
++   * Determines whether the current previous hypothesis extended with the currently selected
++   * phrase represents a straight or inverted rule application.
++   * 
++   * @return
++   */
++  private boolean isMonotonic() {
++//    System.err.println(String.format("isMonotonic(); %d < %d -> %s", 
++//        getLastCovered(), getPhraseEnd(), getLastCovered() < getPhraseEnd()));
++    return getLastCovered() < getPhraseEnd();
 +  }
 +  
 +  /**
 +   * Extends the cube pruning dot in both directions and returns the resulting set. Either of the
 +   * results can be null if the end of their respective lists is reached.
 +   * 
 +   * @return The neighboring candidates (possibly null)
 +   */
 +  public Candidate[] extend() {
 +    return new Candidate[] { extendHypothesis(), extendPhrase() };
 +  }
 +  
 +  /**
 +   * Extends the cube pruning dot along the dimension of existing hypotheses.
 +   * 
 +   * @return the next candidate, or null if none
 +   */
 +  public Candidate extendHypothesis() {
 +    if (ranks[0] < hypotheses.size() - 1) {
-       return new Candidate(hypotheses, phrases, span, future_delta, new int[] { ranks[0] + 1, ranks[1] });
++      return new Candidate(featureFunctions, sentence, hypotheses, phrases, future_delta, new int[] { ranks[0] + 1, ranks[1] });
 +    }
 +    return null;
 +  }
 +  
 +  /**
 +   * Extends the cube pruning dot along the dimension of candidate target sides.
 +   * 
 +   * @return the next Candidate, or null if none
 +   */
 +  public Candidate extendPhrase() {
 +    if (ranks[1] < phrases.size() - 1) {
-       return new Candidate(hypotheses, phrases, span, future_delta, new int[] { ranks[0], ranks[1] + 1 });
++      return new Candidate(featureFunctions, sentence, hypotheses, phrases, future_delta, new int[] { ranks[0], ranks[1] + 1 });
 +    }
 +    
 +    return null;
 +  }
 +  
 +  /**
 +   * Returns the input span from which the phrases for this candidates were gathered.
 +   * 
 +   * @return the span object
 +   */
 +  public Span getSpan() {
-     return this.span;
++    return new Span(this.phrases.i, this.phrases.j);
 +  }
 +  
 +  /**
 +   * A candidate is a (hypothesis, target phrase) pairing. The hypothesis and target phrase are
 +   * drawn from a list that is indexed by (ranks[0], ranks[1]), respectively. This is a shortcut
 +   * to return the hypothesis of the candidate pair.
 +   * 
 +   * @return the hypothesis at position ranks[0]
 +   */
 +  public Hypothesis getHypothesis() {
 +    return this.hypotheses.get(ranks[0]);
 +  }
 +  
 +  /**
-    * This returns the target side {@link org.apache.joshua.corpus.Phrase}, which is a {@link org.apache.joshua.decoder.ff.tm.Rule} object. This is just a
-    * convenience function that works by returning the phrase indexed in ranks[1].
++   * A candidate is a (hypothesis, target phrase) pairing. The hypothesis and target phrase are
++   * drawn from a list that is indexed by (ranks[0], ranks[1]), respectively. This is a shortcut
++   * to return the rule representing the terminal phrase production of the candidate pair.
++   * 
++   * @return the phrase rule at position ranks[1]
++   */
++  public Rule getPhraseRule() {
++    Rule rule = getPhraseNode().bestHyperedge.getRule();
++    return rule;
++  }
++  
++  /**
++   * This returns a new Hypothesis (HGNode) representing the phrase being added, i.e., a terminal
++   * production in the hypergraph. The score and DP state are computed only here on demand.
++   * 
++   * @return a new hypergraph node representing the phrase translation
++   */
++  public HGNode getPhraseNode() {
++    return this.phrases.get(ranks[1]);
++  }
++  
++  /**
++   * Ensures that the cost of applying the edge has been 
++   * computed. This is tucked away in an accessor so that 
++   * we can do it lazily if we wish.
++   * 
++   * @return the computed result.
++   */
++  public ComputeNodeResult computeResult() {
++    if (computedResult == null) {
++      // add the rule
++      // TODO: sourcepath
++      computedResult = new ComputeNodeResult(featureFunctions, getRule(), getTailNodes(), getLastCovered(), getPhraseEnd(), null, sentence);
++    }
++    
++    return computedResult;
++  }
++    
++  /**
++   * This returns the rule being applied (straight or inverted)
 +   * 
 +   * @return the phrase at position ranks[1]
 +   */
 +  public Rule getRule() {
-     return phrases.get(ranks[1]);
++    return this.rule;
 +  }
 +  
 +  /**
 +   * The hypotheses list is a list of tail pointers. This function returns the tail pointer
 +   * currently selected by the value in ranks.
 +   * 
 +   * @return a list of size one, wrapping the tail node pointer
 +   */
 +  public List<HGNode> getTailNodes() {
 +    List<HGNode> tailNodes = new ArrayList<HGNode>();
-     tailNodes.add(getHypothesis());
++    if (isMonotonic()) {
++      tailNodes.add(getHypothesis());
++      tailNodes.add(getPhraseNode());
++    } else {
++      tailNodes.add(getPhraseNode());
++      tailNodes.add(getHypothesis());
++    }
 +    return tailNodes;
 +  }
 +  
 +  /**
 +   * Returns the bit vector of this hypothesis. The bit vector is computed by ORing the coverage
 +   * vector of the tail node (hypothesis) and the source span of phrases in this candidate.
 +   * @return the bit vector of this hypothesis
 +   */
 +  public Coverage getCoverage() {
 +    Coverage cov = new Coverage(getHypothesis().getCoverage());
 +    cov.set(getSpan());
 +    return cov;
 +  }
 +
 +  /**
-    * Sets the result of a candidate (TODO should just be moved to the constructor).
-    * 
-    * @param result todo
-    */
-   public void setResult(ComputeNodeResult result) {
-     this.result = result;
-   }
- 
-   /**
-    * This returns the sum of two costs: the HypoState cost + the transition cost. The HypoState cost
-    * is in turn the sum of two costs: the Viterbi cost of the underlying hypothesis, and the adjustment
-    * to the future score incurred by translating the words under the source phrase being added.
-    * The transition cost is the sum of new features incurred along the transition (mostly, the
-    * language model costs).
++   * This returns the sum of two costs: the Viterbi cost of the edge represented by the current
++   * cube pruning state, plus the difference to the future cost incurred by translating the
++   * current phrase.
 +   * 
-    * The Future Cost item should probably just be implemented as another kind of feature function,
-    * but it would require some reworking of that interface, which isn't worth it. 
++   * Note that in phrase-based decoding, the Hypothesis scores include the future cost estimate,
++   * which means that the Viterbi cost (which includes only the inside estimates) is not the complete
++   * cost; instead, you have to chain the calls to the hypothesis. This should be fixed and cleaned
++   * up to formally separate the "inside" and "outside" costs.
 +   * 
-    * @return the sum of two costs: the HypoState cost + the transition cost
++   * @return the inside + outside cost
 +   */
 +  public float score() {
-     return getHypothesis().getScore() + future_delta + result.getTransitionCost();
++//    float score = computedResult.getViterbiCost() + future_delta;
++    float score = getHypothesis().getScore() + getPhraseNode().getScore() + future_delta + computedResult.getTransitionCost();
++    return score;
 +  }
 +  
 +  public float getFutureEstimate() {
 +    return getHypothesis().getScore() + future_delta;
 +  }
 +  
 +  public List<DPState> getStates() {
-     return result.getDPStates();
++    return computeResult().getDPStates();
++  }
++  
++  public int getLastCovered() {
++    return getHypothesis().getLastSourceIndex();
++  }
++  
++  public int getPhraseEnd() {
++    return phrases.j;
 +  }
 +
-   public ComputeNodeResult getResult() {
-     return result;
++  @Override
++  public int compareTo(Candidate other) {
++    return Float.compare(other.score(), score());
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Coverage.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Coverage.java
index 2c674fc,0000000..4ef0ede
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Coverage.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Coverage.java
@@@ -1,235 -1,0 +1,235 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import java.util.BitSet;
 +
 +import org.apache.joshua.corpus.Span;
 +
 +/**
 + * Represents a coverage vector. The vector is relative to a hypothesis. {firstZero} denotes the
 + * first uncovered word of the sentence, and {bits} contains the coverage vector of all the words
 + * after it, with the first zero removed. 
 + */
 +
 +public class Coverage {
 +
 +  // The index of the first uncovered word
 +  private int firstZero;
 +
 +  // Bits with the first zero removed.                                                             
 +  // We also assume anything beyond this is zero due to the reordering window.                     
 +  // Lowest bits correspond to next word.    
 +  private BitSet bits;
 +
 +  // Default bit vector length
-   private static int INITIAL_LENGTH = 10;
++  private static final int INITIAL_LENGTH = 10;
 +
 +  public Coverage() {
 +    firstZero = 0;
 +    bits = new BitSet(INITIAL_LENGTH);
 +  }
 +
 +  public Coverage(int firstZero) {
 +    this.firstZero = firstZero;
 +    bits = new BitSet(INITIAL_LENGTH);
 +  }
 +
 +  /**
 +   * Pretty-prints the coverage vector, making a guess about the length
 +   */
 +  @Override
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    sb.append(String.format("%d ", firstZero));
 +
 +    for (int i = 0; i < Math.max(INITIAL_LENGTH, bits.length()); i++) { // only display first 10 bits
 +      sb.append(bits.get(i) ? "x" : ".");
 +    }
 +
 +    return sb.toString();
 +  }
 +
 +  /**
 +   * Initialize a coverage vector from another Coverage vector, creating a separate object.
 +   * 
 +   * @param other an existing coverage vector from which to create a new coverage vector
 +   */
 +  public Coverage(Coverage other) {
 +    this.firstZero = other.firstZero;
 +    this.bits = (BitSet) other.bits.clone();
 +  }
 +
 +  /**
 +   * Turns on all bits from position start to position (end - 1), that is, in the range [start .. end).
 +   * This is done relative to the current coverage vector, of course, which may not start at 0.
 +   * 
 +   * @param begin bits at start position
 +   * @param end bits at end position (end - 1)
 +   */
 +  public void set(int begin, int end) {
 +    assert compatible(begin, end);
 +
 +    //    StringBuffer sb = new StringBuffer();
 +    //    sb.append(String.format("SET(%d,%d) %s", begin, end, this));
 +
 +    if (begin == firstZero) {
 +      // A concatenation. 
 +      firstZero = end;
 +      bits = bits.get(end - begin, Math.max(end - begin, bits.length()));
 +      int firstClear = bits.nextClearBit(0);
 +      if (firstClear != 0) {
 +        // We might have exactly covered a gap, in which case we need to adjust shift
 +        // firstZero and the bits until we reach the new end
 +        firstZero += firstClear;
 +        bits = bits.get(firstClear,  bits.length());
 +      }
 +    } else {
 +      // Set the bits relative to the currenS
 +      bits.or(pattern(begin, end));
 +    }
 +
 +    //    sb.append(String.format(" -> %s", this));
 +    //    System.err.println(sb);
 +  }
 +
 +  /**
 +   * Convenience function.
 +   * @param span todo
 +   */
 +  public final void set(Span span) {
 +    set(span.start, span.end);
 +  }
 +
 +  /**
 +   * Tests whether a new range is compatible with the current coverage vector. It must be after
 +   * the first uncovered word, obviously, and must not conflict with spans after the first
 +   * uncovered word.
 +   * 
 +   * @param begin the begin index (absolute)
 +   * @param end the end index (absolute)
 +   * @return true if the span is compatible with the coverage vector
 +   */
 +  public boolean compatible(int begin, int end) {
 +    if (begin >= firstZero) {
 +      BitSet pattern = new BitSet();
 +      pattern.set(begin - firstZero, end - firstZero);
 +      return ! bits.intersects(pattern);
 +    }
 +    return false;
 +  }
 +
 +  /**
 +   * Returns the source sentence index of the first uncovered word.
 +   * 
 +   * @return the index
 +   */
 +  public int firstZero() {
 +    return firstZero;
 +  }
 +
 +  /**
 +   * LeftOpen() and RightOpen() find the larger gap in which a new source phrase pair sits.
 +   * When using a phrase pair covering (begin, end), the pair
 +   * 
 +   *     (LeftOpen(begin), RightOpen(end, sentence_length))  
 +   *     
 +   * provides this gap.                                           
 +
 +   * Find the left bound of the gap in which the phrase [begin, ...) sits.                         
 +   * 
 +   * @param begin the start index of the phrase being applied.
 +   * @return todo
 +   */
 +  public int leftOpening(int begin) {
 +    for (int i = begin - firstZero; i > 0; --i) {
 +      if (bits.get(i)) {
 +        assert compatible(i + firstZero + 1, begin);
 +        assert !compatible(i + firstZero, begin);
 +        return i + firstZero + 1;
 +      }
 +    }
 +
 +    assert compatible(firstZero, begin);
 +    return firstZero;
 +  }
 +
 +  /**
 +   * LeftOpen() and RightOpen() find the larger gap in which a new source phrase pair sits.
 +   * When using a phrase pair covering (begin, end), the pair
 +   * <pre>
 +   *     (LeftOpen(begin), RightOpen(end, sentence_length))  
 +   * </pre>
 +   *     
 +   * provides this gap.                                           
 +   * 
 +   * Finds the right bound of the enclosing gap, or the end of sentence, whichever is less.
 +   * @param end end of phrase pair
 +   * @param sentenceLength length of sentence
 +   * @return todo
 +   */
 +  public int rightOpening(int end, int sentenceLength) {
 +    for (int i = end - firstZero; i < Math.min(64, sentenceLength - firstZero); i++) {
 +      if (bits.get(i)) {
 +        return i + firstZero;
 +      }
 +    }
 +    return sentenceLength;
 +  }
 +
 +  /**
 +   * Creates a bit vector with the same offset as the current coverage vector, flipping on
 +   * bits begin..end.
 +   * 
 +   * @param begin the begin index (absolute)
 +   * @param end the end index (absolute)
 +   * @return a bit vector (relative) with positions [begin..end) on
 +   */
 +  public BitSet pattern(int begin, int end) {
 +    //    System.err.println(String.format("pattern(%d,%d) %d %s %s", begin, end, firstZero, begin >= firstZero, toString()));
 +    assert begin >= firstZero;
 +    BitSet pattern = new BitSet(INITIAL_LENGTH);
 +    pattern.set(begin - firstZero, end - firstZero);
 +    return pattern;
 +  }
 +
 +  /**
 +   * Returns the underlying coverage bits.
 +   * 
 +   * @return {@link java.util.BitSet} vector of bits
 +   */
 +  public BitSet getCoverage() {
 +    return bits;
 +  }
 +
 +  @Override
 +  public boolean equals(Object obj) {
 +    if (obj instanceof Coverage) {
 +      Coverage other = (Coverage) obj;
 +      return getCoverage().equals(other.getCoverage()) && firstZero() == other.firstZero();
 +    }
 +
 +    return false;
 +  }
 +
 +  @Override
 +  public int hashCode() {
 +    return getCoverage().hashCode() * firstZero();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Future.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Future.java
index 0ece4a3,0000000..a81fff5
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Future.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Future.java
@@@ -1,119 -1,0 +1,120 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import org.apache.joshua.util.ChartSpan;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +public class Future {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Future.class);
 +
 +  // Square matrix with half the values ignored.
-   private ChartSpan<Float> entries;
++  private final ChartSpan<Float> entries;
 +
-   private int sentlen;
++  private final int sentlen;
 +
 +  /**
 +   * Computes bottom-up the best way to cover all spans of the input sentence, using the phrases
 +   * that have been assembled in a {@link org.apache.joshua.decoder.phrase.PhraseChart}.
 +   * Requires that there be a translation at least for every word (which can be 
 +   * accomplished with a pass-through grammar).
 +   * 
 +   * @param chart an input {@link org.apache.joshua.decoder.phrase.PhraseChart}
 +   */
 +  public Future(PhraseChart chart) {
 +
 +    sentlen = chart.SentenceLength();
 +    entries = new ChartSpan<Float>(sentlen + 1, Float.NEGATIVE_INFINITY);
- 
++    
 +    /*
 +     * The sentence is represented as a sequence of words, with the first and last words set
 +     * to <s> and </s>. We start indexing at 1 because the first word (<s>) is always covered.
 +     */
 +    for (int begin = 1; begin <= chart.SentenceLength(); begin++) {
 +      // Nothing is nothing (this is a useful concept when two phrases abut)
 +      setEntry(begin, begin,  0.0f);
 +      // Insert phrases
 +      int max_end = Math.min(begin + chart.MaxSourcePhraseLength(), chart.SentenceLength());
 +      for (int end = begin + 1; end <= max_end; end++) {
 +
 +        // Moses doesn't include the cost of applying </s>, so force it to zero
 +        if (begin == sentlen - 1 && end == sentlen) 
 +          setEntry(begin, end, 0.0f);
 +        else {
-           TargetPhrases phrases = chart.getRange(begin, end);
++          PhraseNodes phrases = chart.getRange(begin, end);
 +          if (phrases != null)
-             setEntry(begin, end, phrases.get(0).getEstimatedCost());
++            setEntry(begin, end, phrases.get(0).bestHyperedge.getRule().getEstimatedCost());
 +        }
 +      }
 +    }
 +
 +    // All the phrases are in, now do minimum dynamic programming.  Lengths 0 and 1 were already handled above.
 +    for (int length = 2; length <= chart.SentenceLength(); length++) {
 +      for (int begin = 1; begin <= chart.SentenceLength() - length; begin++) {
 +        for (int division = begin + 1; division < begin + length; division++) {
 +          setEntry(begin, begin + length, Math.max(getEntry(begin, begin + length), getEntry(begin, division) + getEntry(division, begin + length)));
 +        }
 +      }
 +    }
 +
 +    if (LOG.isDebugEnabled()) {
 +      for (int i = 1; i < chart.SentenceLength(); i++) {
 +        for (int j = i + 1; j < chart.SentenceLength(); j++) {
 +          LOG.debug("future cost from {} to {} is {}", i - 1, j - 2, getEntry(i, j));
 +        }
 +      }
 +    }
 +  }
 +
 +  public float Full() {
 +    //    System.err.println("Future::Full(): " + Entry(1, sentlen));
 +    return getEntry(1, sentlen);
 +  }
 +
 +  /**
 +   * Calculate change in rest cost when the given coverage is to be covered.
 +   * @param coverage input {@link org.apache.joshua.decoder.phrase.Coverage} vector
 +   * @param begin word at which to begin within a sentence
 +   * @param end word at which to end within a sentence
 +   * @return a float value representing a {@link Future} entry
 +   */
 +  public float Change(Coverage coverage, int begin, int end) {
 +    int left = coverage.leftOpening(begin);
 +    int right = coverage.rightOpening(end, sentlen);
-     //    System.err.println(String.format("Future::Change(%s, %d, %d) left %d right %d %.3f %.3f %.3f", coverage, begin, end, left, right,
-     //        Entry(left, begin), Entry(end, right), Entry(left, right)));
++//        System.err.println(String.format("Future.Change(%s, %d, %d) left %d right %d %.3f %.3f %.3f", 
++//            coverage, begin, end, left, right,
++//            getEntry(left, begin), getEntry(end, right), getEntry(left, right)));
 +    return getEntry(left, begin) + getEntry(end, right) - getEntry(left, right);
 +  }
 +
 +  private float getEntry(int begin, int end) {
 +    assert end >= begin;
-     assert end < this.sentlen;
++    assert end <= this.sentlen;
 +    return entries.get(begin, end);
 +  }
 +
 +  private void setEntry(int begin, int end, float value) {
 +    assert end >= begin;
-     assert end < this.sentlen;
-     //    System.err.println(String.format("future cost from %d to %d is %.5f", begin, end, value));
++    assert end <= this.sentlen;
++//    System.err.println(String.format("Future.setEntry(%d, %d) = %f", begin, end, value));
 +    entries.set(begin, end, value);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Header.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Header.java
index 30d771c,0000000..d55c08b
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Header.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Header.java
@@@ -1,87 -1,0 +1,87 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +// PORT: done
 +
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.util.Comparator;
 +
 +public class Header implements Comparable<Header>, Comparator<Header> {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Header.class);
 +
 +  private float score;
-   private int arity;
++  private final int arity;
 +  private Note note;
 +    
 +  protected Header() {
 +    score = 0.0f;
 +    arity = 0;
 +    note = null;
 +  }
 +  
 +  protected Header(Header other) {
 +    this.score = other.GetScore();
 +    this.arity = other.GetArity();
 +    this.note = other.GetNote();
 +  }
 +  
 +  protected Header(int arity) {
 +    this.score = 0.0f;
 +    this.arity = arity;
 +    this.note = new Note();
 +  }
 +  
 +  public boolean Valid() {
 +    // C++: return base_;
 +    LOG.debug("Header::Valid(): {}", (note != null));
 +    return note != null;
 +  }
 +  
 +  public float GetScore() {
 +    return score;
 +  }
 +  
 +  public void SetScore(float score) {
 +    this.score = score;
 +  }
 +
 +  public int GetArity() { return arity; }
 +  
 +  public Note GetNote() { return note; }
 +  
 +  public void SetNote(Note note) { this.note = note; }
 +
 +  @Override
 +  public int compareTo(Header other) {
 +    if (this.GetScore() < other.GetScore())
 +      return -1;
 +    else if (this.GetScore() > other.GetScore())
 +      return 1;
 +    return 0;
 +  }
 +  
 +  @Override
 +  public int compare(Header arg0, Header arg1) {
 +    return arg0.compareTo(arg1);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
index a302959,0000000..3c61a68
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Hypothesis.java
@@@ -1,155 -1,0 +1,166 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import static org.apache.joshua.decoder.ff.tm.OwnerMap.UNKNOWN_OWNER_ID;
 +
 +import java.util.List;
 +
- import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.format.HieroFormatReader;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +
 +/**
-  * Represents a hypothesis, a translation of some coverage of the input. Extends {@link org.apache.joshua.decoder.hypergraph.HGNode}, 
-  * through a bit of a hack. Whereas (i,j) represents the span of an {@link org.apache.joshua.decoder.hypergraph.HGNode}, i here is not used,
-  * and j is overloaded to denote the span of the phrase being applied. The complete coverage vector 
-  * can be obtained by looking at the tail pointer and casting it.
++ * Represents a hypothesis, a translation of some subset of the input sentence. Extends 
++ * {@link org.apache.joshua.decoder.hypergraph.HGNode}, through a bit of a hack. Whereas (i,j) 
++ * represents the span of an {@link org.apache.joshua.decoder.hypergraph.HGNode}, i here is not used,
++ * and j is overloaded to denote the index into the source string of the end of the last phrase that 
++ * was applied. The complete coverage vector can be obtained by looking at the tail pointer and 
++ * casting it.
 + * 
 + * @author Kenneth Heafield
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class Hypothesis extends HGNode implements Comparable<Hypothesis> {
 +
 +  // The hypothesis' coverage vector
-   private Coverage coverage;
-   public static Rule BEGIN_RULE = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[X] ||| <s> ||| <s> |||   ||| 0-0");
-   public static Rule END_RULE = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[GOAL] ||| [X,1] </s> ||| [X,1] </s> |||   ||| 0-0 1-1");
++  private final Coverage coverage;
 +
++  public static Rule BEGIN_RULE = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[GOAL] ||| <s> ||| <s> ||| ");
++  public static Rule END_RULE   = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[GOAL] ||| </s> ||| </s> ||| ");
++  public static Rule MONO_RULE  = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[GOAL] ||| [GOAL,1] [X,2] ||| [GOAL,1] [X,2] |||   ||| 0-0 1-1");
++  public static Rule SWAP_RULE  = new HieroFormatReader(UNKNOWN_OWNER_ID).parseLine("[GOAL] ||| [X,1] [GOAL,2] ||| [GOAL,2] [X,1] |||   ||| 0-1 1-0");
++  
 +  public String toString() {
 +    StringBuffer sb = new StringBuffer();
-     for (DPState state: getDPStates())
-       sb.append(state);
++    getDPStates().forEach(sb::append);
 +    String words = bestHyperedge.getRule().getTargetWords();
++
 +//  return String.format("HYP[%s] %.5f j=%d words=%s state=%s", coverage, score, j, words, sb);
 +    return String.format("HYP[%s] j=%d words=[%s] state=%s", coverage, j, words, sb);
 +  }
 +
 +  // Initialize root hypothesis. Provide the LM's BeginSentence.
 +  public Hypothesis(List<DPState> states, float futureCost) {
-     super(0, 1, Vocabulary.id("[X]"), states,
++    super(0, 1, BEGIN_RULE.getLHS(), states,
 +        new HyperEdge(BEGIN_RULE, 0.0f, 0.0f, null, null), futureCost);
 +    this.coverage = new Coverage(1);
 +  }
 +
++  /**
++   * This creates a hypothesis from a Candidate object
++   * 
++   * @param cand the candidate
++   */
 +  public Hypothesis(Candidate cand) {
 +    // TODO: sourcepath
-     super(-1, cand.span.end, Vocabulary.id("[X]"), cand.getStates(), new HyperEdge(
-         cand.getRule(), cand.getResult().getViterbiCost(), cand.getResult().getTransitionCost(),
-         cand.getTailNodes(), null), cand.score());
++    super(cand.getLastCovered(), cand.getPhraseEnd(), cand.getRule().getLHS(), cand.getStates(), 
++        new HyperEdge(cand.getRule(), cand.computeResult().getViterbiCost(), 
++            cand.computeResult().getTransitionCost(),
++            cand.getTailNodes(), null), cand.score());
 +    this.coverage = cand.getCoverage();
 +  }
++
 +  
 +  // Extend a previous hypothesis.
 +  public Hypothesis(List<DPState> states, float score, Hypothesis previous, int source_end, Rule target) {
 +    super(-1, source_end, -1, null, null, score);
 +    this.coverage = previous.coverage;
 +  }
 +
 +  public Coverage getCoverage() {
 +    return coverage;
 +  }
 +
 +  public Rule getRule() {
 +    return bestHyperedge.getRule();
 +  }
 +
 +  /**
 +   * HGNodes (designed for chart parsing) maintain a span (i,j). We overload j
 +   * here to record the index of the last translated source word.
 +   * 
-    * @return the int 'j' which is overloaded to denote the span of the phrase being applied
++   * @return the index of the last translated source word
 +   */
-   public int LastSourceIndex() {
++  public int getLastSourceIndex() {
 +    return j;
 +  }
 +
 +  @Override
 +  public int hashCode() {
 +    int hash = 0;
-     hash = 31 * LastSourceIndex() + 19 * getCoverage().hashCode();
++    hash = 31 * getLastSourceIndex() + 19 * getCoverage().hashCode();
 +    if (null != dpStates && dpStates.size() > 0)
 +      for (DPState dps: dpStates)
 +        hash *= 57 + dps.hashCode();
 +    return hash;
 +  }
 +
 +  /**
 +   * Defines equivalence in terms of recombinability. Two hypotheses are recombinable if 
 +   * all their DP states are the same, their coverage is the same, and they have the next soure
 +   * index the same.
 +   */
 +  @Override
 +  public boolean equals(Object obj) {
 +    if (obj instanceof Hypothesis) {
 +      Hypothesis other = (Hypothesis) obj;
 +
-       if (LastSourceIndex() != other.LastSourceIndex() || ! getCoverage().equals(other.getCoverage()))
++      if (getLastSourceIndex() != other.getLastSourceIndex() || ! getCoverage().equals(other.getCoverage()))
 +        return false;
 +      
 +      if (dpStates == null)
 +        return (other.dpStates == null);
 +      
 +      if (other.dpStates == null)
 +        return false;
 +      
 +      if (dpStates.size() != other.dpStates.size())
 +        return false;
 +      
 +      for (int i = 0; i < dpStates.size(); i++) {
 +        if (!dpStates.get(i).equals(other.dpStates.get(i)))
 +          return false;
 +      }
 +      
 +      return true;
 +    }
 +    return false;
 +  }
 +
 +  @Override
 +  public int compareTo(Hypothesis o) {
 +    // TODO: is this the order we want?
 +    return Float.compare(o.getScore(), getScore());
 +  }
 +
 +  /**
 +   * Performs hypothesis recombination, incorporating the incoming hyperedges of the added
 +   * hypothesis and possibly updating the cache of the best incoming hyperedge and score.
 +   * 
 +   * @param added the equivalent hypothesis 
 +   */
 +  public void absorb(Hypothesis added) {
 +    assert(this.equals(added));
 +    score = Math.max(score, added.getScore());
 +    addHyperedgesInNode(added.hyperedges);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
index a676efe,0000000..b7c3001
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseChart.java
@@@ -1,197 -1,0 +1,220 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import java.util.ArrayList;	
 +import java.util.Arrays;
 +import java.util.List;
 +
- import org.apache.joshua.decoder.Decoder;
++import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
++import org.apache.joshua.decoder.hypergraph.HGNode;
++import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class represents a bundle of phrase tables that have been read in,
 + * reporting some stats about them. Probably could be done away with.
 + */
 +public class PhraseChart {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(PhraseChart.class);
 +
-   private int sentence_length;
++  private final int sentence_length;
 +  private int max_source_phrase_length;
 +
 +  // Banded array: different source lengths are next to each other.
-   private List<TargetPhrases> entries;
++  private final List<PhraseNodes> entries;
 +
 +  // number of translation options
-   int numOptions = 20;
-   private List<FeatureFunction> features;
++  private int numOptions = 20;
++  
++  // The feature functions
++  private final List<FeatureFunction> features;
++  
++  // The input sentence
++  private Sentence sentence;
 +
 +  /**
 +   * Create a new PhraseChart object, which represents all phrases that are
 +   * applicable against the current input sentence. These phrases are extracted
 +   * from all available grammars.
 +   * 
 +   * @param tables input array of {@link org.apache.joshua.decoder.phrase.PhraseTable}'s
 +   * @param features {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param source input to {@link org.apache.joshua.lattice.Lattice}
 +   * @param num_options number of translation options (typically set to 20)
 +   */
 +  public PhraseChart(PhraseTable[] tables, List<FeatureFunction> features, Sentence source,
 +      int num_options) {
 +
 +    float startTime = System.currentTimeMillis();
 +
 +    this.numOptions = num_options;
 +    this.features = features;
++    this.sentence = source;
 +
 +    max_source_phrase_length = 0;
-     for (int i = 0; i < tables.length; i++)
-       max_source_phrase_length = Math.max(max_source_phrase_length,
-           tables[i].getMaxSourcePhraseLength());
++    for (PhraseTable table1 : tables)
++      max_source_phrase_length = Math
++          .max(max_source_phrase_length, table1.getMaxSourcePhraseLength());
 +    sentence_length = source.length();
 +
 +//    System.err.println(String.format(
 +//        "PhraseChart()::Initializing chart for sentlen %d max %d from %s", sentence_length,
 +//        max_source_phrase_length, source));
 +
-     entries = new ArrayList<TargetPhrases>();
++    entries = new ArrayList<>();
 +    for (int i = 0; i < sentence_length * max_source_phrase_length; i++)
 +      entries.add(null);
 +
 +    // There's some unreachable ranges off the edge. Meh.
 +    for (int begin = 0; begin != sentence_length; ++begin) {
 +      for (int end = begin + 1; (end != sentence_length + 1)
 +          && (end <= begin + max_source_phrase_length); ++end) {
 +        if (source.hasPath(begin, end)) {
 +          for (PhraseTable table : tables)
 +            addToRange(begin, end,
 +                table.getPhrases(Arrays.copyOfRange(source.getWordIDs(), begin, end)));
 +        }
 +
 +      }
 +    }
 +
-     for (TargetPhrases phrases : entries) {
-       if (phrases != null)
-         phrases.finish(features, Decoder.weights, num_options);
-     }
++    /* 
++     * Sort all of the HGNodes that were added.
++     */
++    entries.stream().filter(phrases -> phrases != null).forEach(phrases -> phrases.finish());
 +
 +    LOG.info("Input {}: Collecting options took {} seconds", source.id(),
 +        (System.currentTimeMillis() - startTime) / 1000.0f);
 +    
 +    if (LOG.isDebugEnabled()) {
 +      for (int i = 1; i < sentence_length - 1; i++) {
 +        for (int j = i + 1; j < sentence_length && j <= i + max_source_phrase_length; j++) {
 +          if (source.hasPath(i, j)) {
-             TargetPhrases phrases = getRange(i, j);
++            PhraseNodes phrases = getRange(i, j);
 +            if (phrases != null) {
 +              LOG.debug("{} ({}-{})", source.source(i,j), i, j);
-               for (Rule rule: phrases)
++
++              for (HGNode node: phrases) {
++                Rule rule = node.bestHyperedge.getRule();
 +                LOG.debug("    {} :: est={}", rule.getTargetWords(), rule.getEstimatedCost());
++              }
 +            }
 +          }
 +        }
 +      }
 +    }
 +  }
 +
 +  public int SentenceLength() {
 +    return sentence_length;
 +  }
 +
 +  // c++: TODO: make this reflect the longest source phrase for this sentence.
 +  public int MaxSourcePhraseLength() {
 +    return max_source_phrase_length;
 +  }
 +
 +  /**
 +   * Maps two-dimensional span into a one-dimensional array.
 +   * 
 +   * @param i beginning of span
 +   * @param j end of span
 +   * @return offset into private list of TargetPhrases
 +   */
 +  private int offset(int i, int j) {
 +    return i * max_source_phrase_length + j - i - 1;
 +  }
 +
 +  /**
 +   * Returns phrases from all grammars that match the span.
 +   * 
 +   * @param begin beginning of span
 +   * @param end end of span
-    * @return the {@link org.apache.joshua.decoder.phrase.TargetPhrases} at the specified position in this list.
++   * @return the {@link org.apache.joshua.decoder.phrase.PhraseNodes} at the specified position in this list.
 +   */
-   public TargetPhrases getRange(int begin, int end) {
++  public PhraseNodes getRange(int begin, int end) {
 +    int index = offset(begin, end);
 +    // System.err.println(String.format("PhraseChart::Range(%d,%d): found %d entries",
 +    // begin, end,
 +    // entries.get(index) == null ? 0 : entries.get(index).size()));
 +    // if (entries.get(index) != null)
 +    // for (Rule phrase: entries.get(index))
 +    // System.err.println("  RULE: " + phrase);
 +
 +    if (index < 0 || index >= entries.size() || entries.get(index) == null)
 +      return null;
++    
++    // Produce the nodes for each of the features
 +
 +    return entries.get(index);
 +  }
 +
 +  /**
 +   * Add a set of phrases from a grammar to the current span.
 +   * 
-    * @param begin beginning of span
-    * @param end end of span
++   * @param i beginning of span
++   * @param j end of span
 +   * @param to a {@link org.apache.joshua.decoder.ff.tm.RuleCollection} to be used in scoring and sorting.
 +   */
-   private void addToRange(int begin, int end, RuleCollection to) {
++  private void addToRange(int i, int j, RuleCollection to) {
 +    if (to != null) {
 +      /*
 +       * This first call to getSortedRules() is important, because it is what
 +       * causes the scoring and sorting to happen. It is also a synchronized call,
 +       * which is necessary because the underlying grammar gets sorted. Subsequent calls to get the
 +       * rules will just return the already-sorted list. Here, we score, sort,
 +       * and then trim the list to the number of translation options. Trimming provides huge
 +       * performance gains --- the more common the word, the more translations options it is
 +       * likely to have (often into the tens of thousands).
 +       */
 +      List<Rule> rules = to.getSortedRules(features);
++      
++      // TODO: I think this is a race condition
 +      if (numOptions > 0 && rules.size() > numOptions)
-         rules = rules.subList(0,  numOptions);
++        rules = rules.subList(0,  numOptions - 1);
 +//        to.getRules().subList(numOptions, to.getRules().size()).clear();
 +
 +      try {
-         int offset = offset(begin, end);
++        int offset = offset(i, j);
 +        if (entries.get(offset) == null)
-           entries.set(offset, new TargetPhrases(rules));
-         else
-           entries.get(offset).addAll(rules);
++          entries.set(offset, new PhraseNodes(i, j, numOptions));
++        PhraseNodes nodes = entries.get(offset);
++
++        // Turn each rule into an HGNode, add them one by one 
++        for (Rule rule: rules) {
++          ComputeNodeResult result = new ComputeNodeResult(features, rule, null, i, j, null, sentence);
++          HyperEdge edge = new HyperEdge(rule, result.getViterbiCost(), result.getTransitionCost(), null, null);
++          HGNode phraseNode = new HGNode(i, j, rule.getLHS(), result.getDPStates(), edge, result.getPruningEstimate());
++          nodes.add(phraseNode);
++        }
++//        entries.get(offset).addAll(rules);
 +      } catch (java.lang.IndexOutOfBoundsException e) {
-         LOG.error("Whoops! {} [{}-{}] too long ({})", to, begin, end, entries.size());
++        LOG.error("Whoops! {} [{}-{}] too long ({})", to, i, j, entries.size());
 +        LOG.error(e.getMessage(), e);
 +      }
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
index 0000000,0000000..c690dc3
new file mode 100644
--- /dev/null
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseNodes.java
@@@ -1,0 -1,0 +1,58 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ *
++ *  http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing,
++ * software distributed under the License is distributed on an
++ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++ * KIND, either express or implied.  See the License for the
++ * specific language governing permissions and limitations
++ * under the License.
++ */
++package org.apache.joshua.decoder.phrase;
++
++import java.util.ArrayList;
++import java.util.Collections;
++
++import org.apache.joshua.decoder.hypergraph.HGNode;
++
++/**
++ * Represents a sorted collection of target-side phrases. Typically, these are phrases
++ * generated from the same source word sequence. The list of options is reduced to the number
++ * of translation options.
++ * 
++ * @author Matt Post
++ */
++
++public class PhraseNodes extends ArrayList<HGNode> {
++
++  private static final long serialVersionUID = 1L;
++  
++  public int i = -2;
++  public int j = -2;
++
++  public PhraseNodes(int i, int j, int initialSize) {
++    super(initialSize);
++    this.i = i;
++    this.j = j;
++  }
++  
++  /**
++   * Score the rules and sort them. Scoring is necessary 
++   * because rules are only scored if they are used, in an 
++   * effort to make reading in rules more efficient. 
++   * This is starting to create some trouble and should 
++   * probably be reworked.
++   */
++  public void finish() {
++    Collections.sort(this, HGNode.inverseLogPComparator);    
++  }
++
++}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
index 5f52358,0000000..74770c5
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/PhraseTable.java
@@@ -1,175 -1,0 +1,173 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import java.io.File;
 +import java.io.IOException;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.hash_based.MemoryBasedBatchGrammar;
 +import org.apache.joshua.decoder.ff.tm.packed.PackedGrammar;
 +
 +/**
 + * Represents a phrase table, and is implemented as a wrapper around either a {@link PackedGrammar}
 + * or a {@link MemoryBasedBatchGrammar}.
 + * 
 + * TODO: this should all be implemented as a two-level trie (source trie and target trie).
 + */
 +public class PhraseTable implements Grammar {
 +  
-   private JoshuaConfiguration config;
++  private final JoshuaConfiguration config;
 +  private Grammar backend;
 +  
 +  /**
 +   * Chain to the super with a number of defaults. For example, we only use a single nonterminal,
 +   * and there is no span limit.
 +   * 
 +   * @param grammarFile file path parent directory
 +   * @param owner used to set phrase owners
 +   * @param type the grammar specification keyword (e.g., "thrax" or "moses")
 +   * @param config a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   * @throws IOException if there is an error reading the grammar file
 +   */
 +  public PhraseTable(String grammarFile, String owner, String type, JoshuaConfiguration config) 
 +      throws IOException {
 +    this.config = config;
 +    int spanLimit = 0;
 +    
 +    if (grammarFile != null && new File(grammarFile).isDirectory()) {
 +      this.backend = new PackedGrammar(grammarFile, spanLimit, owner, type, config);
 +      if (this.backend.getMaxSourcePhraseLength() == -1) {
 +        String msg = "FATAL: Using a packed grammar for a phrase table backend requires that you "
 +            + "packed the grammar with Joshua 6.0.2 or greater";
 +        throw new RuntimeException(msg);
 +      }
 +
 +    } else {
 +      this.backend = new MemoryBasedBatchGrammar(type, grammarFile, owner, "[X]", spanLimit, config);
 +    }
 +  }
 +  
 +  public PhraseTable(String owner, JoshuaConfiguration config) {
 +    this.config = config;
 +    this.backend = new MemoryBasedBatchGrammar(owner, config, 20);
 +  }
 +      
 +  /**
-    * Returns the longest source phrase read. Because phrases have a dummy nonterminal prepended to
-    * them, we need to subtract 1.
++   * Returns the longest source phrase read.
 +   * 
 +   * @return the longest source phrase read.
 +   */
 +  @Override
 +  public int getMaxSourcePhraseLength() {
-     return this.backend.getMaxSourcePhraseLength() - 1;
++    return this.backend.getMaxSourcePhraseLength();
 +  }
 +
 +  /**
 +   * Collect the set of target-side phrases associated with a source phrase.
 +   * 
 +   * @param sourceWords the sequence of source words
 +   * @return the rules
 +   */
 +  public RuleCollection getPhrases(int[] sourceWords) {
 +    if (sourceWords.length != 0) {
 +      Trie pointer = getTrieRoot();
-       pointer = pointer.match(Vocabulary.id("[X]"));
 +      int i = 0;
 +      while (pointer != null && i < sourceWords.length)
 +        pointer = pointer.match(sourceWords[i++]);
 +
 +      if (pointer != null && pointer.hasRules()) {
 +        return pointer.getRuleCollection();
 +      }
 +    }
 +
 +    return null;
 +  }
 +
 +  /**
 +   * Adds a rule to the grammar. Only supported when the backend is a MemoryBasedBatchGrammar.
 +   * 
 +   * @param rule the rule to add
 +   */
 +  public void addRule(Rule rule) {
-     ((MemoryBasedBatchGrammar)backend).addRule(rule);
++    backend.addRule(rule);
 +  }
 +  
 +  @Override
 +  public void addOOVRules(int sourceWord, List<FeatureFunction> featureFunctions) {
 +    // TODO: _OOV shouldn't be outright added, since the word might not be OOV for the LM (but now almost
 +    // certainly is)
 +    int targetWord = config.mark_oovs
 +        ? Vocabulary.id(Vocabulary.word(sourceWord) + "_OOV")
 +        : sourceWord;   
 +
 +    int nt_i = Vocabulary.id("[X]");
 +    Rule oovRule = new Rule(
 +        nt_i,
 +        new int[] { nt_i, sourceWord },
 +        new int[] { -1, targetWord },
 +        1,
 +        new FeatureVector(0),
 +        new byte[] {0,0}, backend.getOwner());
 +    addRule(oovRule);
 +    oovRule.estimateRuleCost(featureFunctions);
 +  }
 +
 +  @Override
 +  public Trie getTrieRoot() {
 +    return backend.getTrieRoot();
 +  }
 +
 +  @Override
 +  public void sortGrammar(List<FeatureFunction> models) {
 +    backend.sortGrammar(models);    
 +  }
 +
 +  @Override
 +  public boolean isSorted() {
 +    return backend.isSorted();
 +  }
 +
 +  /**
 +   * This should never be called. 
 +   */
 +  @Override
 +  public boolean hasRuleForSpan(int startIndex, int endIndex, int pathLength) {
 +    return true;
 +  }
 +
 +  @Override
 +  public int getNumRules() {
 +    return backend.getNumRules();
 +  }
 +
 +  @Override
 +  public OwnerId getOwner() {
 +    return backend.getOwner();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
index d4232cd,0000000..16f5b27
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stack.java
@@@ -1,229 -1,0 +1,226 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +import java.util.ArrayList;
 +import java.util.Collections;
 +import java.util.HashMap;
 +import java.util.HashSet;
- import java.util.List;
 +import java.util.PriorityQueue;
 +import java.util.Set;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
- import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
- import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * Organizes all hypotheses containing the same number of source words. 
 + *
 + */
 +public class Stack extends ArrayList<Hypothesis> {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Stack.class);
 +
 +  private static final long serialVersionUID = 7885252799032416068L;
 +
-   private HashMap<Coverage, ArrayList<Hypothesis>> coverages;
++  private final HashMap<Coverage, ArrayList<Hypothesis>> coverages;
 +  
 +  private Sentence sentence;
-   private List<FeatureFunction> featureFunctions;
 +  private JoshuaConfiguration config;
 +
 +  /* The list of states we've already visited. */
-   private HashSet<Candidate> visitedStates;
++  private final HashSet<Candidate> visitedStates;
 +  
 +  /* A list of candidates sorted for consideration for entry to the chart (for cube pruning) */
-   private PriorityQueue<Candidate> candidates;
++  private final PriorityQueue<Candidate> candidates;
 +  
 +  /* Short-circuits adding a cube-prune state more than once */
-   private HashMap<Hypothesis, Hypothesis> deduper;
++  private final HashMap<Hypothesis, Hypothesis> deduper;
 +  
 +  /**
 +   * Create a new stack. Stacks are organized one for each number of source words that are covered.
 +   * 
-    * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param sentence input for a {@link org.apache.joshua.lattice.Lattice}
 +   * @param config populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   */
-   public Stack(List<FeatureFunction> featureFunctions, Sentence sentence, JoshuaConfiguration config) {
-     this.featureFunctions = featureFunctions;
++  public Stack(Sentence sentence, JoshuaConfiguration config) {
 +    this.sentence = sentence;
 +    this.config = config;
 +    
-     this.candidates = new PriorityQueue<Candidate>(1, new CandidateComparator());
++    this.candidates = new PriorityQueue<Candidate>(1);
 +    this.coverages = new HashMap<Coverage, ArrayList<Hypothesis>>();
 +    this.visitedStates = new HashSet<Candidate>();
 +    this.deduper = new HashMap<Hypothesis,Hypothesis>();
 +  }
 +
 +  /**
 +   * A Stack is an ArrayList; here, we intercept the add so we can maintain a list of the items
 +   * stored under each distinct coverage vector
 +   * @param hyp a {@link org.apache.joshua.decoder.phrase.Hypothesis} to add to the {@link org.apache.joshua.decoder.phrase.Stack}
 +   * @return true if the {@link org.apache.joshua.decoder.phrase.Hypothesis} is appended to the list
 +   */
 +  @Override
 +  public boolean add(Hypothesis hyp) {
 +    
 +    if (! coverages.containsKey((hyp.getCoverage())))
-       coverages.put(hyp.getCoverage(), new ArrayList<Hypothesis>()); 
++      coverages.put(hyp.getCoverage(), new ArrayList<>());
 +    coverages.get(hyp.getCoverage()).add(hyp);
 +    
 +    return super.add(hyp);
 +  }
 +  
 +  /**
 +   * Intercept calls to remove() so that we can reduce the coverage vector
 +   */
 +  @Override
 +  public boolean remove(Object obj) {
 +    boolean found = super.remove(obj);
 +    if (found) {
 +      Hypothesis item = (Hypothesis) obj;
 +      Coverage cov = item.getCoverage();
 +      assert coverages.get(cov).remove(obj);
 +      if (coverages.get(cov).size() == 0)
 +        coverages.remove(cov);
 +    }
 +    return found;
 +  }
 +  
 +  /** 
 +   * Returns the set of coverages contained in this stack. This is used to iterate over them
 +   * in the main decoding loop in Stacks.java.
 +   * @return a {@link java.util.Set} of {@link org.apache.joshua.decoder.phrase.Coverage}'s
 +   */
 +  public Set<Coverage> getCoverages() {
 +    return coverages.keySet();
 +  }
 +  
 +  /**
 +   * Get all items with the same coverage vector.
 +   * 
 +   * @param cov the {@link org.apache.joshua.decoder.phrase.Coverage} vector to get
 +   * @return an {@link java.util.ArrayList} of {@link org.apache.joshua.decoder.phrase.Hypothesis}'
 +   */
 +  public ArrayList<Hypothesis> get(Coverage cov) {
 +    ArrayList<Hypothesis> list = coverages.get(cov);
 +    Collections.sort(list);
 +    return list;
 +  }
 +  
 +  /**
 +   * Receives a partially-initialized translation candidate and places it on the
 +   * priority queue after scoring it with all of the feature functions. In this
 +   * respect it is like {@link org.apache.joshua.decoder.chart_parser.CubePruneState} (it could make use of that class with
 +   * a little generalization of spans / coverage).
 +   * 
 +   * This function is also used to (fairly concisely) implement constrained decoding. Before
 +   * adding a candidate, we ensure that the sequence of English words match the sentence. If not,
 +   * the code extends the dot in the cube-pruning chart to the next phrase, since that one might
 +   * be a match.
 +   * @param cand a partially-initialized translation {@link org.apache.joshua.decoder.phrase.Candidate}
 +   */
 +  public void addCandidate(Candidate cand) {
 +    if (visitedStates.contains(cand))
 +      return;
 +    
 +    visitedStates.add(cand);
 +
 +    // Constrained decoding
 +    if (sentence.target() != null) {
++      throw new RuntimeException("* FATAL! Constrained decoding no longer works for the new phrase format");
++      // TODO: fix constrained decoding
++
++      /*
 +      String oldWords = cand.getHypothesis().bestHyperedge.getRule().getTargetWords().replace("[X,1] ",  "");
 +      String newWords = cand.getRule().getTargetWords().replace("[X,1] ",  "");
-           
++
 +      // If the string is not found in the target sentence, explore the cube neighbors
-       if (sentence.fullTarget().indexOf(oldWords + " " + newWords) == -1) {
++      if (!sentence.fullTarget().contains(oldWords + " " + newWords)) {
 +        Candidate next = cand.extendPhrase();
 +        if (next != null)
 +          addCandidate(next); 
 +        return;
 +      }
++      */
 +    }
 +
 +    // TODO: sourcepath
-     ComputeNodeResult result = new ComputeNodeResult(this.featureFunctions, cand.getRule(),
-         cand.getTailNodes(), -1, cand.getSpan().end, null, this.sentence);
-     cand.setResult(result);
 +    
 +    candidates.add(cand);
 +  }
 +  
 +  /**
 +   * Cube pruning. Repeatedly pop the top candidate, creating a new hyperedge from it, adding it to
 +   * the k-best list, and then extending the list of candidates with extensions of the current
 +   * candidate.
 +   */
 +  public void search() {
 +    int to_pop = config.pop_limit;
 +    
 +    if (LOG.isDebugEnabled()) {
 +      LOG.debug("Stack::search(): pop: {} size: {}", to_pop, candidates.size());
 +      for (Candidate c: candidates)
 +        LOG.debug("{}", c);
 +    }
 +    while (to_pop > 0 && !candidates.isEmpty()) {
 +      Candidate got = candidates.poll();
 +      if (got != null) {
 +        addHypothesis(got);
 +        --to_pop;
 +        
 +        for (Candidate c : got.extend())
 +          if (c != null) {
 +            addCandidate(c);
 +          }
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Adds a popped candidate to the chart / main stack. This is a candidate we have decided to
 +   * keep around.
++   * 
 +   * @param complete a completely-initialized translation {@link org.apache.joshua.decoder.phrase.Candidate}
 +   * 
 +   */
 +  public void addHypothesis(Candidate complete) {
 +    Hypothesis added = new Hypothesis(complete);
 +
 +    String taskName;
 +    if (deduper.containsKey(added)) {
 +      taskName = "recombining hypothesis";
 +      Hypothesis existing = deduper.get(added);
 +      existing.absorb(added);
 +    } else {
 +      taskName = "creating new hypothesis";
 +      add(added);
 +      deduper.put(added, added);
 +    }
 +
 +    if (LOG.isDebugEnabled()) {
 +      LOG.debug("{} from ( ... {} )", taskName, complete.getHypothesis().getRule().getTargetWords());
-       LOG.debug("        base score {}", complete.getResult().getBaseCost());
++      LOG.debug("        base score {}", complete.computeResult().getBaseCost());
 +      LOG.debug("        covering {}-{}", complete.getSpan().start - 1, complete.getSpan().end - 2);
 +      LOG.debug("        translated as: {}", complete.getRule().getTargetWords());
 +      LOG.debug("        score {} + future cost {} = {}",
-           complete.getResult().getTransitionCost(), complete.getFutureEstimate(),
-           complete.getResult().getTransitionCost() + complete.getFutureEstimate());
++          complete.computeResult().getTransitionCost(), complete.getFutureEstimate(),
++          complete.computeResult().getTransitionCost() + complete.getFutureEstimate());
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
index 8c092ec,0000000..cfeaea2
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/phrase/Stacks.java
@@@ -1,271 -1,0 +1,276 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.phrase;
 +
 +/***
 + * Entry point for phrase-based decoding, analogous to {@link Chart} for the CKY algorithm. This
 + * class organizes all the stacks used for decoding, and is responsible for building them. Stack
 + * construction is stack-centric: that is, we loop over the number of source words in increasing sizes;
 + * at each step of this iteration, we break the search between smaller stack sizes and source-side
 + * phrase sizes.
 + * 
 + * The end result of decoding is a {@link Hypergraph} with the same format as hierarchical decoding.
 + * Phrases are treating as left-branching rules, and the span information (i,j) is overloaded so
 + * that i means nothing and j represents the index of the last-translated source word in each
 + * hypothesis. This means that most hypergraph code can work without modification. The algorithm 
 + * ensures that the coverage vector is consistent but the resulting hypergraph may not be projective,
 + * which is different from the CKY algorithm, which does produce projective derivations. 
 + * 
 + * TODO Lattice decoding is not yet supported (March 2015).
 + */
 +
 +import static org.apache.joshua.decoder.ff.tm.OwnerMap.UNKNOWN_OWNER;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Span;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.chart_parser.ComputeNodeResult;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.tm.AbstractGrammar;
 +import org.apache.joshua.decoder.ff.tm.Grammar;
 +import org.apache.joshua.decoder.hypergraph.HGNode;
 +import org.apache.joshua.decoder.hypergraph.HyperEdge;
 +import org.apache.joshua.decoder.hypergraph.HyperGraph;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +public class Stacks {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(Stacks.class);
 +
 +  // The list of stacks, grouped according to number of source words covered
 +  private List<Stack> stacks;
 +
 +  // The end state
 +  private Hypothesis end;
 +  
-   List<FeatureFunction> featureFunctions;
++  final List<FeatureFunction> featureFunctions;
 +
-   private Sentence sentence;
++  private final Sentence sentence;
 +
-   private JoshuaConfiguration config;
++  private final JoshuaConfiguration config;
 +
 +  /* Contains all the phrase tables */
-   private PhraseChart chart;
++  private final PhraseChart chart;
 +  
 +  /**
 +   * Entry point. Initialize everything. Create pass-through (OOV) phrase table and glue phrase
 +   * table (with start-of-sentence and end-of-sentence rules).
 +   * 
 +   * @param sentence input to {@link org.apache.joshua.lattice.Lattice}
 +   * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param grammars an array of {@link org.apache.joshua.decoder.ff.tm.Grammar}'s
 +   * @param config a populated {@link org.apache.joshua.decoder.JoshuaConfiguration}
 +   */
 +  public Stacks(Sentence sentence, List<FeatureFunction> featureFunctions, Grammar[] grammars, 
 +      JoshuaConfiguration config) {
 +
 +    this.sentence = sentence;
 +    this.featureFunctions = featureFunctions;
 +    this.config = config;
 +    
 +    int num_phrase_tables = 0;
-     for (int i = 0; i < grammars.length; i++)
-       if (grammars[i] instanceof PhraseTable)
++    for (Grammar grammar : grammars)
++      if (grammar instanceof PhraseTable)
 +        ++num_phrase_tables;
 +    
 +    PhraseTable[] phraseTables = new PhraseTable[num_phrase_tables + 2];
 +    for (int i = 0, j = 0; i < grammars.length; i++)
 +      if (grammars[i] instanceof PhraseTable)
 +        phraseTables[j++] = (PhraseTable) grammars[i];
 +    
 +    phraseTables[phraseTables.length - 2] = new PhraseTable(UNKNOWN_OWNER, config);
 +    phraseTables[phraseTables.length - 2].addRule(Hypothesis.END_RULE);
 +    
 +    phraseTables[phraseTables.length - 1] = new PhraseTable("oov", config);
 +    AbstractGrammar.addOOVRules(phraseTables[phraseTables.length - 1], sentence.getLattice(), featureFunctions, config.true_oovs_only);
 +    
 +    this.chart = new PhraseChart(phraseTables, featureFunctions, sentence, config.num_translation_options);
 +  }
 +  
 +  
 +  /**
 +   * The main algorithm. Returns a hypergraph representing the search space.
 +   * 
 +   * @return a {@link org.apache.joshua.decoder.hypergraph.HyperGraph} representing the search space
 +   */
 +  public HyperGraph search() {
 +    
 +    long startTime = System.currentTimeMillis();
 +    
 +    Future future = new Future(chart);
-     stacks = new ArrayList<Stack>();
++    stacks = new ArrayList<>();
 +    
 +    // <s> counts as the first word. Pushing null lets us count from one.
 +    stacks.add(null);
 +
 +    // Initialize root hypothesis with <s> context and future cost for everything.
 +    ComputeNodeResult result = new ComputeNodeResult(this.featureFunctions, Hypothesis.BEGIN_RULE,
 +        null, -1, 1, null, this.sentence);
-     Stack firstStack = new Stack(featureFunctions, sentence, config);
++    Stack firstStack = new Stack(sentence, config);
 +    firstStack.add(new Hypothesis(result.getDPStates(), future.Full()));
 +    stacks.add(firstStack);
 +    
 +    // Decode with increasing numbers of source words. 
 +    for (int source_words = 2; source_words <= sentence.length(); ++source_words) {
-       Stack targetStack = new Stack(featureFunctions, sentence, config);
++      Stack targetStack = new Stack(sentence, config);
 +      stacks.add(targetStack);
 +
 +      // Iterate over stacks to continue from.
 +      for (int phrase_length = 1; phrase_length <= Math.min(source_words - 1, chart.MaxSourcePhraseLength());
 +          phrase_length++) {
 +        int from_stack = source_words - phrase_length;
 +        Stack tailStack = stacks.get(from_stack);
 +
 +        LOG.debug("WORDS {} MAX {} (STACK {} phrase_length {})", source_words,
 +            chart.MaxSourcePhraseLength(), from_stack, phrase_length);
 +        
-         // Iterate over antecedents in this stack.
++        /* Each from stack groups together lots of different coverage vectors that all cover the
++         * same number of words. We have the number of covered words from from_stack, and the length
++         * of the phrases we are going to add from (source_words - from_stack). We now iterate over
++         * all coverage vectors, finding the set of phrases that can extend each of them, given
++         * the two constraints: the phrase length, and the current coverage vector. These will all
++         * be grouped under the same target stack.
++         */
 +        for (Coverage coverage: tailStack.getCoverages()) {
 +          ArrayList<Hypothesis> hypotheses = tailStack.get(coverage); 
 +          
 +          // the index of the starting point of the first possible phrase
 +          int begin = coverage.firstZero();
 +          
 +          // the absolute position of the ending spot of the last possible phrase
 +          int last_end = Math.min(coverage.firstZero() + config.reordering_limit, chart.SentenceLength());
 +          int last_begin = (last_end > phrase_length) ? (last_end - phrase_length) : 0;
 +
 +          for (begin = coverage.firstZero(); begin <= last_begin; begin++) {
 +            if (!coverage.compatible(begin, begin + phrase_length) ||
 +                ! permissible(coverage, begin, begin + phrase_length)) {
 +              continue;
 +            }
 +
-             Span span = new Span(begin, begin + phrase_length);
- 
 +            // Don't append </s> until the end
 +            if (begin == sentence.length() - 1 && source_words != sentence.length()) 
 +              continue;            
 +
-             TargetPhrases phrases = chart.getRange(begin, begin + phrase_length);
++            /* We have found a permissible phrase start point and length for the current coverage
++             * vector. Find all the phrases over that span.
++             */
++            PhraseNodes phrases = chart.getRange(begin, begin + phrase_length);
 +            if (phrases == null)
 +              continue;
 +
- 
 +            LOG.debug("Applying {} target phrases over [{}, {}]",
 +                phrases.size(), begin, begin + phrase_length);
 +            
 +            // TODO: could also compute some number of features here (e.g., non-LM ones)
 +            // float score_delta = context.GetScorer().transition(ant, phrases, begin, begin + phrase_length);
 +            
 +            // Future costs: remove span to be filled.
 +            float future_delta = future.Change(coverage, begin, begin + phrase_length);
 +            
 +            /* This associates with each span a set of hypotheses that can be extended by
 +             * phrases from that span. The hypotheses are wrapped in HypoState objects, which
 +             * augment the hypothesis score with a future cost.
 +             */
-             Candidate cand = new Candidate(hypotheses, phrases, span, future_delta);
++            Candidate cand = new Candidate(featureFunctions, sentence, hypotheses, phrases, future_delta, new int[] {0, 0});
 +            targetStack.addCandidate(cand);
 +          }
 +        }
 +      }
 +
 +      /* At this point, every vertex contains a list of all existing hypotheses that the target
 +       * phrases in that vertex could extend. Now we need to create the search object, which
 +       * implements cube pruning. There are up to O(n^2) cubes, n the size of the current stack,
 +       * one cube each over each span of the input. Each "cube" has two dimensions: one representing
 +       * the target phrases over the span, and one representing all of these incoming hypotheses.
 +       * We seed the chart with the best item in each cube, and then repeatedly pop and extend.
 +       */
 +      
 +//      System.err.println(String.format("\nBuilding cube-pruning chart for %d words", source_words));
 +
 +      targetStack.search();
 +    }
 +    
 +    LOG.info("Input {}: Search took {} seconds", sentence.id(),
 +        (System.currentTimeMillis() - startTime) / 1000.0f);
 +    
 +    return createGoalNode();
 +  }
 +    
 +  /**
 +   * Enforces reordering constraints. Our version of Moses' ReorderingConstraint::Check() and
 +   * SearchCubePruning::CheckDistortion(). 
 +   * 
 +   * @param coverage
 +   * @param begin
 +   * @param i
 +   * @return
 +   */
 +  private boolean permissible(Coverage coverage, int begin, int end) {
 +    int firstZero = coverage.firstZero();
 +
 +    if (config.reordering_limit < 0)
 +      return true;
 +    
 +    /* We can always start with the first zero since it doesn't create a reordering gap
 +     */
 +    if (begin == firstZero)
 +      return true;
 +
 +    /* If a gap is created by applying this phrase, make sure that you can reach the first
 +     * zero later on without violating the distortion constraint.
 +     */
-     if (end - firstZero > config.reordering_limit) {
-       return false;
-     }
-     
-     return true;
++    return end - firstZero <= config.reordering_limit;
++
 +  }
 +
 +
 +  /**
 +   * Searches through the goal stack, calling the final transition function on each node, and then returning
 +   * the best item. Usually the final transition code doesn't add anything, because all features
 +   * have already computed everything they need to. The standard exception is language models that
 +   * have not yet computed their prefix probabilities (which is not the case with KenLM, the default).
 +   * 
 +   * @return
 +   */
 +  private HyperGraph createGoalNode() {
 +    Stack lastStack = stacks.get(sentence.length());
 +    
 +    for (Hypothesis hyp: lastStack) {
 +      float score = hyp.getScore();
-       List<HGNode> tailNodes = new ArrayList<HGNode>();
++      List<HGNode> tailNodes = new ArrayList<>();
 +      tailNodes.add(hyp);
 +      
 +      float finalTransitionScore = ComputeNodeResult.computeFinalCost(featureFunctions, tailNodes, 0, sentence.length(), null, sentence);
 +
++//      System.err.println(String.format("createGoalNode: final score: %f -> %f", score, finalTransitionScore));
++      
 +      if (null == this.end)
 +        this.end = new Hypothesis(null, score + finalTransitionScore, hyp, sentence.length(), null);
 +
 +      HyperEdge edge = new HyperEdge(null, score + finalTransitionScore, finalTransitionScore, tailNodes, null);
 +      end.addHyperedgeInNode(edge);
 +    }
 +    
 +    return new HyperGraph(end, -1, -1, this.sentence);
 +  }
 +}


[34/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/SentenceFilteredGrammar.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/SentenceFilteredGrammar.java
index 54f68b2,0000000..4f545b7
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/SentenceFilteredGrammar.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/SentenceFilteredGrammar.java
@@@ -1,366 -1,0 +1,366 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm;
 +
 +import java.util.Collection;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.Map.Entry;
 +
 +import org.apache.joshua.decoder.ff.tm.hash_based.ExtensionIterator;
 +import org.apache.joshua.decoder.ff.tm.hash_based.MemoryBasedBatchGrammar;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class implements dynamic sentence-level filtering. This is accomplished with a parallel
 + * trie, a subset of the original trie, that only contains trie paths that are reachable from
 + * traversals of the current sentence.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class SentenceFilteredGrammar extends MemoryBasedBatchGrammar {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(SentenceFilteredGrammar.class);
 +
-   private AbstractGrammar baseGrammar;
-   private SentenceFilteredTrie filteredTrie;
-   private int[] tokens;
-   private Sentence sentence;
++  private final AbstractGrammar baseGrammar;
++  private final SentenceFilteredTrie filteredTrie;
++  private final int[] tokens;
++  private final Sentence sentence;
 +
 +  /**
 +   * Construct a new sentence-filtered grammar. The main work is done in the enclosed trie (obtained
 +   * from the base grammar, which contains the complete grammar).
 +   * 
 +   * @param baseGrammar a new {@link org.apache.joshua.decoder.ff.tm.AbstractGrammar} to populate
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   */
 +  SentenceFilteredGrammar(AbstractGrammar baseGrammar, Sentence sentence) {
 +    super(OwnerMap.getOwner(baseGrammar.getOwner()), baseGrammar.joshuaConfiguration, baseGrammar.getSpanLimit());
 +    this.baseGrammar = baseGrammar;
 +    this.sentence = sentence;
 +    this.tokens = sentence.getWordIDs();
 +
 +    int origCount = getNumRules(baseGrammar.getTrieRoot());
 +    long startTime = System.currentTimeMillis();
 +
 +    /* Filter the rules; returns non-null object */
 +    this.filteredTrie = filter(baseGrammar.getTrieRoot());
 +    int filteredCount = getNumRules();
 +
 +    float seconds = (System.currentTimeMillis() - startTime) / 1000.0f;
 +
 +    LOG.debug("Sentence-level filtering of sentence {} ({} -> {} rules) in {} seconds",
 +        sentence.id(), origCount, filteredCount, seconds);
 +  }
 +
 +  @Override
 +  public Trie getTrieRoot() {
 +    return filteredTrie;
 +  }
 +
 +  /**
 +   * This function is poorly named: it doesn't mean whether a rule exists in the grammar for the
 +   * current span, but whether the grammar is permitted to apply rules to the current span (a
 +   * grammar-level parameter). As such we can just chain to the underlying grammar.
 +   */
 +  @Override
 +  public boolean hasRuleForSpan(int startIndex, int endIndex, int pathLength) {
 +    return baseGrammar.hasRuleForSpan(startIndex, endIndex, pathLength);
 +  }
 +
 +  @Override
 +  public int getNumRules() {
 +    return getNumRules(getTrieRoot());
 +  }
 +
 +  /**
 +   * A convenience function that counts the number of rules in a grammar's trie.
 +   * 
 +   * @param node the {@link org.apache.joshua.decoder.ff.tm.Trie} implementation for which to count rules
 +   * @return the number of rules
 +   */
 +  public int getNumRules(Trie node) {
 +    int numRules = 0;
 +    if (node != null) {
 +      if (node.getRuleCollection() != null)
 +        numRules += node.getRuleCollection().getRules().size();
 +
 +      if (node.getExtensions() != null)
 +        for (Trie child : node.getExtensions())
 +          numRules += getNumRules(child);
 +    }
 +
 +    return numRules;
 +  }
 +
 +  /**
 +   * What is the algorithm?
 +   * 
 +   * Take the first word of the sentence, and start at the root of the trie. There are two things to
 +   * consider: (a) word matches and (b) nonterminal matches.
 +   * 
 +   * For a word match, simply follow that arc along the trie. We create a parallel arc in our
 +   * filtered grammar to represent it. Each arc in the filtered trie knows about its
 +   * corresponding/underlying node in the unfiltered grammar trie.
 +   * 
 +   * A nonterminal is always permitted to match. The question then is how much of the input sentence
 +   * we imagine it consumed. The answer is that it could have been any amount. So the recursive call
 +   * has to be a set of calls, one each to the next trie node with different lengths of the sentence
 +   * remaining.
 +   * 
 +   * A problem occurs when we have multiple sequential nonterminals. For scope-3 grammars, there can
 +   * be four sequential nonterminals (in the case when they are grounded by terminals on both ends
 +   * of the nonterminal chain). We'd like to avoid looking at all possible ways to split up the
 +   * subsequence, because with respect to filtering rules, they are all the same.
 +   * 
 +   * We accomplish this with the following restriction: for purposes of grammar filtering, only the
 +   * first in a sequence of nonterminal traversals can consume more than one word. Each of the
 +   * subsequent ones would have to consume just one word. We then just have to record in the
 +   * recursive call whether the last traversal was a nonterminal or not.
 +   * 
 +   * @param unfilteredTrieRoot todo
 +   * @return the root of the filtered trie
 +   */
 +  private SentenceFilteredTrie filter(Trie unfilteredTrieRoot) {
 +    SentenceFilteredTrie filteredTrieRoot = new SentenceFilteredTrie(unfilteredTrieRoot);
 +
 +    // System.err.println(String.format("FILTERING TO SENTENCE\n  %s\n",
 +    // Vocabulary.getWords(tokens)));
 +
 +    /*
 +     * The root of the trie is where rule applications start, so we simply try all possible
 +     * positions in the sentence.
 +     */
 +    for (int i = 0; i < tokens.length; i++) {
 +      filter(i, filteredTrieRoot, false);
 +    }
 +
 +    return filteredTrieRoot;
 +  }
 +
 +  /**
 +   * Matches rules against the sentence. Intelligently handles chains of sequential nonterminals.
 +   * Marks arcs that are traversable for this sentence.
 +   * 
 +   * @param i the position in the sentence to start matching
 +   * @param trie the trie node to match against
 +   * @param lastWasNT true if the match that brought us here was against a nonterminal
 +   */
 +  private void filter(int i, SentenceFilteredTrie trieNode, boolean lastWasNT) {
 +    if (i >= tokens.length)
 +      return;
 +
 +    /* Make sure the underlying unfiltered node has children. */
 +    Trie unfilteredTrieNode = trieNode.unfilteredTrieNode;
 +    if (unfilteredTrieNode.getChildren() == null) {
 +      // trieNode.path.retreat();
 +      return;
 +    }
 +
 +    /* Match a word */
 +    Trie trie = unfilteredTrieNode.match(tokens[i]);
 +    if (trie != null) {
 +      /*
 +       * The current filtered node might already have an arc for this label. If so, retrieve it
 +       * (since we still need to follow it); if not, create it.
 +       */
 +      SentenceFilteredTrie nextFilteredTrie = trieNode.match(tokens[i]);
 +      if (nextFilteredTrie == null) {
 +        nextFilteredTrie = new SentenceFilteredTrie(trie);
 +        trieNode.children.put(tokens[i], nextFilteredTrie);
 +      }
 +
 +      /*
 +       * Now continue, trying to match the child node against the next position in the sentence. The
 +       * third argument records that this match was not against a nonterminal.
 +       */
 +      filter(i + 1, nextFilteredTrie, false);
 +    }
 +
 +    /*
 +     * Now we attempt to match nonterminals. Any nonterminal is permitted to match any region of the
 +     * sentence, up to the maximum span for that grammar. So we enumerate all children of the
 +     * current (unfiltered) trie grammar node, looking for nonterminals (items whose label value is
 +     * less than 0), then recurse.
 +     * 
 +     * There is one subtlely. Adjacent nonterminals in a grammar rule can match a span (i, j) in (j
 +     * - i - 1) ways, but for purposes of determining whether a rule fits, this is all wasted
 +     * effort. To handle this, we allow the first nonterminal in a sequence to record 1, 2, 3, ...
 +     * terminals (up to the grammar's span limit, or the rest of the sentence, whichever is
 +     * shorter). Subsequent adjacent nonterminals are permitted to consume only a single terminal.
 +     */
 +    HashMap<Integer, ? extends Trie> children = unfilteredTrieNode.getChildren();
 +    if (children != null) {
 +      for (int label : children.keySet()) {
 +        if (label < 0) {
 +          SentenceFilteredTrie nextFilteredTrie = trieNode.match(label);
 +          if (nextFilteredTrie == null) {
 +            nextFilteredTrie = new SentenceFilteredTrie(unfilteredTrieNode.match(label));
 +            trieNode.children.put(label, nextFilteredTrie);
 +          }
 +
 +          /*
 +           * Recurse. If the last match was a nonterminal, we can only consume one more token.
 +           * 
 +           * TODO: This goes too far by looking at the whole sentence; each grammar has a maximum
 +           * span limit which should be consulted. What we should be doing is passing the point
 +           * where we started matching the current sentence, so we can apply this span limit, which
 +           * is easily accessible (baseGrammar.spanLimit).
 +           */
 +          int maxJ = lastWasNT ? (i + 1) : tokens.length;
 +          for (int j = i + 1; j <= maxJ; j++) {
 +            filter(j, nextFilteredTrie, true);
 +          }
 +        }
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Alternate filter that uses regular expressions, walking the grammar trie and matching the
 +   * source side of each rule collection against the input sentence. Failed matches are discarded,
 +   * and trie nodes extending from that position need not be explored.
 +   * 
 +   * @param unfilteredTrie todo
 +   * @return the root of the filtered trie if any rules were retained, otherwise null
 +   */
 +  @SuppressWarnings("unused")
 +  private SentenceFilteredTrie filter_regexp(Trie unfilteredTrie) {
 +    SentenceFilteredTrie trie = null;
 +
 +    /* Case 1: keep the trie node if it has a rule collection that matches the sentence */
 +    if (unfilteredTrie.hasRules())
 +      if (matchesSentence(unfilteredTrie))
 +        trie = new SentenceFilteredTrie(unfilteredTrie);
 +      else
 +        return null;
 +
 +    /* Case 2: keep the trie node if it has children who have valid rule collections */
 +    if (unfilteredTrie.hasExtensions())
 +      for (Entry<Integer, ? extends Trie> arc : unfilteredTrie.getChildren().entrySet()) {
 +        Trie unfilteredChildTrie = arc.getValue();
 +        SentenceFilteredTrie nextTrie = filter_regexp(unfilteredChildTrie);
 +        if (nextTrie != null) {
 +          if (trie == null)
 +            trie = new SentenceFilteredTrie(unfilteredTrie);
 +          trie.children.put(arc.getKey(), nextTrie);
 +        }
 +      }
 +
 +    return trie;
 +  }
 +
 +  private boolean matchesSentence(Trie childTrie) {
 +    Rule rule = childTrie.getRuleCollection().getRules().get(0);
 +    return rule.matches(sentence);
 +  }
 +
 +  /**
 +   * Implements a filtered trie, by sitting on top of a base trie and annotating nodes that match
 +   * the given input sentence.
 +   * 
 +   * @author Matt Post post@cs.jhu.edu
 +   * 
 +   */
 +  public class SentenceFilteredTrie implements Trie {
 +
 +    /* The underlying unfiltered trie node. */
-     private Trie unfilteredTrieNode;
++    private final Trie unfilteredTrieNode;
 +
 +    /* The child nodes in the filtered trie. */
 +    private HashMap<Integer, SentenceFilteredTrie> children = null;
 +
 +    /**
 +     * Constructor.
 +     * 
 +     * @param unfilteredTrieNode todo
 +     */
 +    public SentenceFilteredTrie(Trie unfilteredTrieNode) {
 +      this.unfilteredTrieNode = unfilteredTrieNode;
-       this.children = new HashMap<Integer, SentenceFilteredTrie>();
++      this.children = new HashMap<>();
 +    }
 +
 +    @Override
 +    public SentenceFilteredTrie match(int wordID) {
 +      if (children != null)
 +        return children.get(wordID);
 +      return null;
 +    }
 +
 +    @Override
 +    public boolean hasExtensions() {
 +      return children != null;
 +    }
 +
 +    @Override
 +    public Collection<SentenceFilteredTrie> getExtensions() {
 +      if (children != null)
 +        return children.values();
 +
 +      return null;
 +    }
 +
 +    @Override
 +    public HashMap<Integer, SentenceFilteredTrie> getChildren() {
 +      return children;
 +    }
 +
 +    @Override
 +    public boolean hasRules() {
 +      // Chain to the underlying unfiltered node.
 +      return unfilteredTrieNode.hasRules();
 +    }
 +
 +    @Override
 +    public RuleCollection getRuleCollection() {
 +      // Chain to the underlying unfiltered node, since the rule collection just varies by target
 +      // side.
 +      return unfilteredTrieNode.getRuleCollection();
 +    }
 +
 +    /**
 +     * Counts the number of rules.
 +     * 
 +     * @return the number of rules rooted at this node.
 +     */
 +    public int getNumRules() {
 +      int numRules = 0;
 +      if (getTrieRoot() != null)
 +        if (getTrieRoot().getRuleCollection() != null)
 +          numRules += getTrieRoot().getRuleCollection().getRules().size();
 +
 +      for (SentenceFilteredTrie node : getExtensions())
 +        numRules += node.getNumRules();
 +
 +      return numRules;
 +    }
 +
 +    @Override
 +    public Iterator<Integer> getTerminalExtensionIterator() {
 +      return new ExtensionIterator(children, true);
 +    }
 +
 +    @Override
 +    public Iterator<Integer> getNonterminalExtensionIterator() {
 +      return new ExtensionIterator(children, false);
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/format/MosesFormatReader.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/format/MosesFormatReader.java
index 959e607,0000000..4de5bb1
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/format/MosesFormatReader.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/format/MosesFormatReader.java
@@@ -1,110 -1,0 +1,103 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm.format;
 +
 +import java.io.IOException;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.util.Constants;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.io.LineReader;
 +
 +/***
 + * This class reads in the Moses phrase table format, with support for the source and target side,
 + * list of features, and word alignments. It works by
 + * 
 + * - casting the phrase-based rules to left-branching hierarchical rules and passing them on \
 + *   to its parent class, {@link HieroFormatReader}.
 + * - converting the probabilities to -log probabilities
 + * 
 + * There is also a tool to convert the grammars directly, so that they can be suitably packed. Usage:
 + * 
 + * <pre>
 + *     cat PHRASE_TABLE | java -cp $JOSHUA/target/classes org.apache.joshua.decoder.ff.tm.format.MosesFormatReader
 + * </pre>
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + *
 + */
 +
 +public class MosesFormatReader extends HieroFormatReader {
 +
 +  public MosesFormatReader(String grammarFile, OwnerId ownerId) throws IOException {
 +    super(grammarFile, ownerId);
 +    Vocabulary.id(Constants.defaultNT);
 +  }
 +  
 +  public MosesFormatReader(OwnerId ownerId) {
 +    super(ownerId);
 +    Vocabulary.id(Constants.defaultNT);
 +  }
 +  
 +  /**
 +   * When dealing with Moses format, this munges a Moses-style phrase table into a grammar.
 +   * 
 +   *    mots francaises ||| French words ||| 1 2 3 ||| 0-1 1-0
 +   *    
 +   * becomes
 +   * 
-    *    [X] ||| [X,1] mots francaises ||| [X,1] French words ||| 1 2 3  ||| 0-1 1-0
++   *    [X] ||| mots francaises ||| French words ||| 1 2 3  ||| 0-1 1-0
 +   *    
-    * For thrax-extracted phrasal grammars, it transforms
-    * 
-    *    [X] ||| mots francaises ||| French words ||| 1 2 3 ||| 0-1 1-0
-    *
-    * into
-    * 
-    *    [X] ||| [X,1] mots francaises ||| [X,1] French words ||| 1 2 3 ||| 0-1 1-0
++   * For thrax-extracted phrasal grammars, no transformation is needed.
 +   */
 +  @Override
 +  public Rule parseLine(String line) {
 +    String[] fields = line.split(Constants.fieldDelimiterPattern);
 +    
-     String nt = FormatUtils.cleanNonTerminal(Constants.defaultNT);
-     StringBuffer hieroLine = new StringBuffer(Constants.defaultNT + " ||| [" + nt + ",1] " + fields[0] + " ||| [" + nt + ",1] " + fields[1] + " |||");
++    StringBuffer hieroLine = new StringBuffer(Constants.defaultNT + " ||| " + fields[0] + " ||| " + fields[1] + " |||");
 +
 +    String mosesFeatureString = fields[2];
 +    for (String value: mosesFeatureString.split(" ")) {
 +      float f = Float.parseFloat(value);
 +      hieroLine.append(String.format(" %f", f <= 0.0 ? -100 : -Math.log(f)));
 +    }
 +
 +    // alignments
 +    if (fields.length >= 4)
 +      hieroLine.append(" ||| " + fields[3]);
 +    
 +    return super.parseLine(hieroLine.toString());
 +  }
 +  
 +  /**
 +   * Converts a Moses phrase table to a Joshua grammar. 
 +   * 
 +   * @param args the command-line arguments
 +   */
 +  public static void main(String[] args) {
 +    MosesFormatReader reader = new MosesFormatReader(OwnerMap.UNKNOWN_OWNER_ID);
 +    for (String line: new LineReader(System.in)) {
 +      Rule rule = reader.parseLine(line);
 +      System.out.println(rule.textFormat());
 +    }    
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/ExtensionIterator.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/ExtensionIterator.java
index ecb355d,0000000..a29ad47
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/ExtensionIterator.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/ExtensionIterator.java
@@@ -1,73 -1,0 +1,73 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm.hash_based;
 +
 +import java.util.HashMap;
 +import java.util.Iterator;
 +
 +public class ExtensionIterator implements Iterator<Integer> {
 +
 +  private Iterator<Integer> iterator;
-   private boolean terminal;
++  private final boolean terminal;
 +  private boolean done;
 +  private int next;
 +
 +  public ExtensionIterator(HashMap<Integer, ?> map, boolean terminal) {
 +    this.terminal = terminal;
 +    done = false;
 +    if (map == null) {
 +      done = true;
 +    } else {
 +      this.iterator = map.keySet().iterator();
 +      forward();
 +    }
 +  }
 +
 +  private void forward() {
 +    if (done)
 +      return;
 +    while (iterator.hasNext()) {
 +      int candidate = iterator.next();
 +      if ((terminal && candidate > 0) || (!terminal && candidate < 0)) {
 +        next = candidate;
 +        return;
 +      }
 +    }
 +    done = true;
 +  }
 +
 +  @Override
 +  public boolean hasNext() {
 +    return !done;
 +  }
 +
 +  @Override
 +  public Integer next() {
 +    if (done)
 +      throw new RuntimeException();
 +    int consumed = next;
 +    forward();
 +    return consumed;
 +  }
 +
 +  @Override
 +  public void remove() {
 +    throw new UnsupportedOperationException();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/MemoryBasedBatchGrammar.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/MemoryBasedBatchGrammar.java
index 0bc577a,0000000..d5ef019
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/MemoryBasedBatchGrammar.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/hash_based/MemoryBasedBatchGrammar.java
@@@ -1,245 -1,0 +1,243 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm.hash_based;
 +
 +import static org.apache.joshua.decoder.ff.tm.GrammarReader.createReader;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.HashMap;
 +import java.util.List;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.JoshuaConfiguration.OOVItem;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.tm.AbstractGrammar;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.format.HieroFormatReader;
 +import org.apache.joshua.util.FormatUtils;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +/**
 + * This class implements a memory-based bilingual BatchGrammar.
 + * <p>
 + * The rules are stored in a trie. Each trie node has: (1) RuleBin: a list of rules matching the
 + * french sides so far (2) A HashMap of next-layer trie nodes, the next french word used as the key
 + * in HashMap
 + * 
 + * @author Zhifei Li zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class MemoryBasedBatchGrammar extends AbstractGrammar {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(MemoryBasedBatchGrammar.class);
 +
 +  /* The number of rules read. */
 +  private int qtyRulesRead = 0;
 +
 +  /* The number of distinct source sides. */
 +  private int qtyRuleBins = 0;
 +
 +  /* The trie root. */
-   private MemoryBasedTrie root = new MemoryBasedTrie();
++  private final MemoryBasedTrie root = new MemoryBasedTrie();
 +
 +  /* The file containing the grammar. */
 +  private String grammarFile;
 +
 +  /**
 +   * Constructor used by Decoder mostly. Default spanLimit of 20
 +   * @param owner the associated decoder-wide {@link org.apache.joshua.decoder.ff.tm.OwnerMap}
 +   * @param config a {@link org.apache.joshua.decoder.JoshuaConfiguration} object
 +   * @param spanLimit the maximum span of the input grammar rule(s) can be applied to.
 +   */
 +  public MemoryBasedBatchGrammar(String owner, JoshuaConfiguration config, int spanLimit) {
 +    super(owner, config, spanLimit);
 +  }
 +
 +  public MemoryBasedBatchGrammar(String formatKeyword, String grammarFile, String owner,
 +      String defaultLHSSymbol, int spanLimit, JoshuaConfiguration joshuaConfiguration)
 +      throws IOException {
 +
 +    super(owner, joshuaConfiguration, spanLimit);
 +    Vocabulary.id(defaultLHSSymbol);
 +    this.grammarFile = grammarFile;
 +
 +    // ==== loading grammar
 +    for (Rule rule : createReader(formatKeyword, grammarFile, getOwner()))
 +      if (rule != null) {
 +        addRule(rule);
 +      }
 +
 +    this.printGrammar();
 +  }
 +
 +  // ===============================================================
 +  // Methods
 +  // ===============================================================
 +
 +  @Override
 +  public int getNumRules() {
 +    return this.qtyRulesRead;
 +  }
 +
 +  /**
 +   * if the span covered by the chart bin is greater than the limit, then return false
 +   */
 +  public boolean hasRuleForSpan(int i, int j, int pathLength) {
 +    if (this.spanLimit == -1) { // mono-glue grammar
 +      return (i == 0);
 +    } else {
 +      // System.err.println(String.format("%s HASRULEFORSPAN(%d,%d,%d)/%d = %s",
 +      // Vocabulary.word(this.owner), i, j, pathLength, spanLimit, pathLength <= this.spanLimit));
 +      return (pathLength <= this.spanLimit);
 +    }
 +  }
 +
 +  public Trie getTrieRoot() {
 +    return this.root;
 +  }
 +
 +  /**
 +   * Adds a rule to the grammar.
 +   */
 +  public void addRule(Rule rule) {
 +
 +    this.qtyRulesRead++;
 +
 +    // === identify the position, and insert the trie nodes as necessary
 +    MemoryBasedTrie pos = root;
 +    int[] french = rule.getSource();
 +
 +    maxSourcePhraseLength = Math.max(maxSourcePhraseLength, french.length);
 +
-     for (int k = 0; k < french.length; k++) {
-       int curSymID = french[k];
- 
++    for (int curSymID : french) {
 +      /*
 +       * Note that the nonTerminal symbol in the french is not cleaned (i.e., will be sth like
 +       * [X,1]), but the symbol in the Trie has to be cleaned, so that the match does not care about
 +       * the markup (i.e., [X,1] or [X,2] means the same thing, that is X) if
 +       * (Vocabulary.nt(french[k])) { curSymID = modelReader.cleanNonTerminal(french[k]); if
 +       * (logger.isLoggable(Level.FINEST)) logger.finest("Amended to: " + curSymID); }
 +       */
 +
 +      MemoryBasedTrie nextLayer = (MemoryBasedTrie) pos.match(curSymID);
 +      if (null == nextLayer) {
 +        nextLayer = new MemoryBasedTrie();
 +        if (pos.hasExtensions() == false) {
-           pos.childrenTbl = new HashMap<Integer, MemoryBasedTrie>();
++          pos.childrenTbl = new HashMap<>();
 +        }
 +        pos.childrenTbl.put(curSymID, nextLayer);
 +      }
 +      pos = nextLayer;
 +    }
 +
 +    // === add the rule into the trie node
 +    if (!pos.hasRules()) {
 +      pos.ruleBin = new MemoryBasedRuleBin(rule.getArity(), rule.getSource());
 +      this.qtyRuleBins++;
 +    }
 +    pos.ruleBin.addRule(rule);
 +  }
 +
 +  protected void printGrammar() {
 +    LOG.info("MemoryBasedBatchGrammar: Read {} rules with {} distinct source sides from '{}'",
 +        this.qtyRulesRead, this.qtyRuleBins, grammarFile);
 +  }
 +
 +  /***
 +   * Takes an input word and creates an OOV rule in the current grammar for that word.
 +   * 
 +   * @param sourceWord integer representation of word
 +   * @param featureFunctions {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   */
 +  @Override
 +  public void addOOVRules(int sourceWord, List<FeatureFunction> featureFunctions) {
 +
 +    // TODO: _OOV shouldn't be outright added, since the word might not be OOV for the LM (but now
 +    // almost
 +    // certainly is)
 +    final int targetWord = this.joshuaConfiguration.mark_oovs ? Vocabulary.id(Vocabulary
 +        .word(sourceWord) + "_OOV") : sourceWord;
 +
 +    final int[] sourceWords = { sourceWord };
 +    final int[] targetWords = { targetWord };
 +    final byte[] alignment = { 0, 0 };
 +    final FeatureVector features = new FeatureVector(0);
 +
 +    if (this.joshuaConfiguration.oovList != null && this.joshuaConfiguration.oovList.size() != 0) {
 +      
 +      for (OOVItem item : this.joshuaConfiguration.oovList) {
 +        final Rule oovRule = new Rule(
 +            Vocabulary.id(item.label),
 +            sourceWords,
 +            targetWords,
 +            0,
 +            features,
 +            alignment,
 +            getOwner());
 +        addRule(oovRule);
 +        oovRule.estimateRuleCost(featureFunctions);
 +      }
 +      
 +    } else {
 +      
 +      final Rule oovRule = new Rule(
 +          Vocabulary.id(this.joshuaConfiguration.default_non_terminal),
 +          sourceWords,
 +          targetWords,
 +          0,
 +          features,
 +          alignment,
 +          getOwner());
 +      addRule(oovRule);
 +      oovRule.estimateRuleCost(featureFunctions);
 +      
 +    }
 +  }
 +
 +  /**
 +   * Adds a default set of glue rules.
 +   * 
 +   * @param featureFunctions an {@link java.util.ArrayList} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   */
 +  public void addGlueRules(ArrayList<FeatureFunction> featureFunctions) {
 +    final HieroFormatReader reader = new HieroFormatReader(getOwner());
 +
 +    String goalNT = FormatUtils.cleanNonTerminal(joshuaConfiguration.goal_symbol);
 +    String defaultNT = FormatUtils.cleanNonTerminal(joshuaConfiguration.default_non_terminal);
 +
 +    String[] ruleStrings = new String[] {
 +        String.format("[%s] ||| %s ||| %s ||| 0", goalNT, Vocabulary.START_SYM,
 +            Vocabulary.START_SYM),
 +        String.format("[%s] ||| [%s,1] [%s,2] ||| [%s,1] [%s,2] ||| -1", goalNT, goalNT, defaultNT,
 +            goalNT, defaultNT),
 +        String.format("[%s] ||| [%s,1] %s ||| [%s,1] %s ||| 0", goalNT, goalNT,
 +            Vocabulary.STOP_SYM, goalNT, Vocabulary.STOP_SYM) };
 +
 +    for (String ruleString : ruleStrings) {
 +      Rule rule = reader.parseLine(ruleString);
 +      addRule(rule);
 +      rule.estimateRuleCost(featureFunctions);
 +    }
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/PackedGrammar.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/PackedGrammar.java
index 23e64a1,0000000..2eb7e6f
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/PackedGrammar.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/PackedGrammar.java
@@@ -1,1005 -1,0 +1,997 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm.packed;
 +
 +/***
 + * This package implements Joshua's packed grammar structure, which enables the efficient loading
 + * and accessing of grammars. It is described in the paper:
 + * 
 + * @article{ganitkevitch2012joshua,
 + *   Author = {Ganitkevitch, J. and Cao, Y. and Weese, J. and Post, M. and Callison-Burch, C.},
 + *   Journal = {Proceedings of WMT12},
 + *   Title = {Joshua 4.0: Packing, PRO, and paraphrases},
 + *   Year = {2012}}
 + *   
 + * The packed grammar works by compiling out the grammar tries into a compact format that is loaded
 + * and parsed directly from Java arrays. A fundamental problem is that Java arrays are indexed
 + * by ints and not longs, meaning the maximum size of the packed grammar is about 2 GB. This forces
 + * the use of packed grammar slices, which together constitute the grammar. The figure in the
 + * paper above shows what each slice looks like. 
 + * 
 + * The division across slices is done in a depth-first manner. Consider the entire grammar organized
 + * into a single source-side trie. The splits across tries are done by grouping the root-level
 + * outgoing trie arcs --- and the entire trie beneath them --- across slices. 
 + * 
 + * This presents a problem: if the subtree rooted beneath a single top-level arc is too big for a 
 + * slice, the grammar can't be packed. This happens with very large Hiero grammars, for example,
 + * where there are a *lot* of rules that start with [X].
 + * 
 + * A solution being worked on is to split that symbol and pack them into separate grammars with a
 + * shared vocabulary, and then rely on Joshua's ability to query multiple grammars for rules to
 + * solve this problem. This is not currently implemented but could be done directly in the
 + * Grammar Packer.
 + *
 + * *UPDATE 10/2015*
 + * The introduction of a SliceAggregatingTrie together with sorting the grammar by the full source string
 + * (not just by the first source word) allows distributing rules with the same first source word
 + * across multiple slices.
 + * @author fhieber
 + */
 +
 +import static java.util.Collections.sort;
 +import static org.apache.joshua.decoder.ff.FeatureMap.getFeature;
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +
 +import java.io.File;
 +import java.io.FileInputStream;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.nio.BufferUnderflowException;
 +import java.nio.ByteBuffer;
 +import java.nio.IntBuffer;
 +import java.nio.MappedByteBuffer;
 +import java.nio.channels.FileChannel;
 +import java.nio.channels.FileChannel.MapMode;
 +import java.nio.file.Files;
 +import java.nio.file.Paths;
 +import java.security.DigestInputStream;
 +import java.security.MessageDigest;
 +import java.security.NoSuchAlgorithmException;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Comparator;
 +import java.util.HashMap;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.Map;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.tm.AbstractGrammar;
 +import org.apache.joshua.decoder.ff.tm.BasicRuleCollection;
 +import org.apache.joshua.decoder.ff.tm.OwnerId;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.hash_based.ExtensionIterator;
 +import org.apache.joshua.util.FormatUtils;
 +import org.apache.joshua.util.encoding.EncoderConfiguration;
 +import org.apache.joshua.util.encoding.FloatEncoder;
 +import org.apache.joshua.util.io.LineReader;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import com.google.common.base.Supplier;
 +import com.google.common.base.Suppliers;
 +import com.google.common.cache.Cache;
 +import com.google.common.cache.CacheBuilder;
 +
 +public class PackedGrammar extends AbstractGrammar {
 +
 +  private static final Logger LOG = LoggerFactory.getLogger(PackedGrammar.class);
 +  public static final String VOCABULARY_FILENAME = "vocabulary";
 +
 +  private EncoderConfiguration encoding;
 +  private PackedRoot root;
 +  private ArrayList<PackedSlice> slices;
 +
 +  private final File vocabFile; // store path to vocabulary file
 +
 +  // The version number of the earliest supported grammar packer
 +  public static final int SUPPORTED_VERSION = 3;
 +
 +  // A rule cache for commonly used tries to avoid excess object allocations
 +  // Testing shows there's up to ~95% hit rate when cache size is 5000 Trie nodes.
 +  private final Cache<Trie, List<Rule>> cached_rules;
 +
-   private String grammarDir;
++  private final String grammarDir;
 +
 +  public PackedGrammar(String grammar_dir, int span_limit, String owner, String type,
 +      JoshuaConfiguration joshuaConfiguration) throws IOException {
 +    super(owner, joshuaConfiguration, span_limit);
 +
 +    this.grammarDir = grammar_dir;
 +
 +    // Read the vocabulary.
 +    vocabFile = new File(grammar_dir + File.separator + VOCABULARY_FILENAME);
 +    LOG.info("Reading vocabulary: {}", vocabFile);
 +    if (!Vocabulary.read(vocabFile)) {
 +      throw new RuntimeException("mismatches or collisions while reading on-disk vocabulary");
 +    }
 +    
 +    // Read the config
 +    String configFile = grammar_dir + File.separator + "config";
 +    if (new File(configFile).exists()) {
 +      LOG.info("Reading packed config: {}", configFile);
 +      readConfig(configFile);
 +    }
 +    
 +    // Read the quantizer setup.
 +    LOG.info("Reading encoder configuration: {}{}encoding", grammar_dir, File.separator);
 +    encoding = new EncoderConfiguration();
 +    encoding.load(grammar_dir + File.separator + "encoding");
 +
 +    final List<String> listing = Arrays.asList(new File(grammar_dir).list());
 +    sort(listing); // File.list() has arbitrary sort order
-     slices = new ArrayList<PackedSlice>();
++    slices = new ArrayList<>();
 +    for (String prefix : listing) {
 +      if (prefix.startsWith("slice_") && prefix.endsWith(".source"))
 +        slices.add(new PackedSlice(grammar_dir + File.separator + prefix.substring(0, 11)));
 +    }
 +
 +    long count = 0;
 +    for (PackedSlice s : slices)
 +      count += s.estimated.length;
 +    root = new PackedRoot(slices);
 +    cached_rules = CacheBuilder.newBuilder().maximumSize(joshuaConfiguration.cachedRuleSize).build();
 +
 +    LOG.info("Loaded {} rules", count);
 +  }
 +
 +  @Override
 +  public Trie getTrieRoot() {
 +    return root;
 +  }
 +
 +  @Override
 +  public boolean hasRuleForSpan(int startIndex, int endIndex, int pathLength) {
 +    return (spanLimit == -1 || pathLength <= spanLimit);
 +  }
 +
 +  @Override
 +  public int getNumRules() {
 +    int num_rules = 0;
 +    for (PackedSlice ps : slices)
 +      num_rules += ps.featureSize;
 +    return num_rules;
 +  }
 +
 +  /**
 +   * Computes the MD5 checksum of the vocabulary file.
 +   * Can be used for comparing vocabularies across multiple packedGrammars.
 +   * @return the computed checksum
 +   */
 +  public String computeVocabularyChecksum() {
 +    MessageDigest md;
 +    try {
 +      md = MessageDigest.getInstance("MD5");
 +    } catch (NoSuchAlgorithmException e) {
 +      throw new RuntimeException("Unknown checksum algorithm");
 +    }
 +    byte[] buffer = new byte[1024];
 +    try (final InputStream is = Files.newInputStream(Paths.get(vocabFile.toString()));
 +        DigestInputStream dis = new DigestInputStream(is, md)) {
 +      while (dis.read(buffer) != -1) {}
 +    } catch (IOException e) {
 +      throw new RuntimeException("Can not find vocabulary file. This should not happen.");
 +    }
 +    byte[] digest = md.digest();
 +    // convert the byte to hex format
 +    StringBuffer sb = new StringBuffer("");
-     for (int i = 0; i < digest.length; i++) {
-       sb.append(Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(1));
++    for (byte aDigest : digest) {
++      sb.append(Integer.toString((aDigest & 0xff) + 0x100, 16).substring(1));
 +    }
 +    return sb.toString();
 +  }
 +
 +  /**
 +   * PackedRoot represents the root of the packed grammar trie.
 +   * Tries for different source-side firstwords are organized in
 +   * packedSlices on disk. A packedSlice can contain multiple trie
 +   * roots (i.e. multiple source-side firstwords).
 +   * The PackedRoot builds a lookup table, mapping from
 +   * source-side firstwords to the addresses in the packedSlices
 +   * that represent the subtrie for a particular firstword.
 +   * If the GrammarPacker has to distribute rules for a
 +   * source-side firstword across multiple slices, a
 +   * SliceAggregatingTrie node is created that aggregates those 
 +   * tries to hide
 +   * this additional complexity from the grammar interface
 +   * This feature allows packing of grammars where the list of rules
 +   * for a single source-side firstword would exceed the maximum array
 +   * size of Java (2gb).
 +   */
 +  public final class PackedRoot implements Trie {
 +
 +    private final HashMap<Integer, Trie> lookup;
 +
 +    public PackedRoot(final List<PackedSlice> slices) {
 +      final Map<Integer, List<Trie>> childTries = collectChildTries(slices);
 +      lookup = buildLookupTable(childTries);
 +    }
 +    
 +    /**
 +     * Determines whether trie nodes for source first-words are spread over 
 +     * multiple packedSlices by counting their occurrences.
 +     * @param slices
 +     * @return A mapping from first word ids to a list of trie nodes.
 +     */
 +    private Map<Integer, List<Trie>> collectChildTries(final List<PackedSlice> slices) {
 +      final Map<Integer, List<Trie>> childTries = new HashMap<>();
 +      for (PackedSlice packedSlice : slices) {
 +        
 +        // number of tries stored in this packedSlice
 +        final int num_children = packedSlice.source[0];
 +        for (int i = 0; i < num_children; i++) {
 +          final int id = packedSlice.source[2 * i + 1];
 +          
 +          /* aggregate tries with same root id
 +           * obtain a Trie node, already at the correct address in the packedSlice.
 +           * In other words, the lookup index already points to the correct trie node in the packedSlice.
 +           * packedRoot.match() thus can directly return the result of lookup.get(id);
 +           */
 +          if (!childTries.containsKey(id)) {
-             childTries.put(id, new ArrayList<Trie>(1));
++            childTries.put(id, new ArrayList<>(1));
 +          }
 +          final Trie trie = packedSlice.root().match(id);
 +          childTries.get(id).add(trie);
 +        }
 +      }
 +      return childTries;
 +    }
 +    
 +    /**
 +     * Build a lookup table for children tries.
 +     * If the list contains only a single child node, a regular trie node
 +     * is inserted into the table; otherwise a SliceAggregatingTrie node is
 +     * created that hides this partitioning into multiple packedSlices
 +     * upstream.
 +     */
 +    private HashMap<Integer,Trie> buildLookupTable(final Map<Integer, List<Trie>> childTries) {
 +      HashMap<Integer,Trie> lookup = new HashMap<>(childTries.size());
 +      for (int id : childTries.keySet()) {
 +        final List<Trie> tries = childTries.get(id);
 +        if (tries.size() == 1) {
 +          lookup.put(id, tries.get(0));
 +        } else {
 +          lookup.put(id, new SliceAggregatingTrie(tries));
 +        }
 +      }
 +      return lookup;
 +    }
 +
 +    @Override
 +    public Trie match(int word_id) {
 +      return lookup.get(word_id);
 +    }
 +
 +    @Override
 +    public boolean hasExtensions() {
 +      return !lookup.isEmpty();
 +    }
 +
 +    @Override
 +    public HashMap<Integer, ? extends Trie> getChildren() {
 +      return lookup;
 +    }
 +
 +    @Override
 +    public ArrayList<? extends Trie> getExtensions() {
 +      return new ArrayList<>(lookup.values());
 +    }
 +
 +    @Override
 +    public boolean hasRules() {
 +      return false;
 +    }
 +
 +    @Override
 +    public RuleCollection getRuleCollection() {
 +      return new BasicRuleCollection(0, new int[0]);
 +    }
 +
 +    @Override
 +    public Iterator<Integer> getTerminalExtensionIterator() {
 +      return new ExtensionIterator(lookup, true);
 +    }
 +
 +    @Override
 +    public Iterator<Integer> getNonterminalExtensionIterator() {
 +      return new ExtensionIterator(lookup, false);
 +    }
 +  }
 +
 +  public final class PackedSlice {
 +    private final String name;
 +
 +    private final int[] source;
 +    private final IntBuffer target;
 +    private final ByteBuffer features;
 +    private final ByteBuffer alignments;
 +
 +    private final int[] targetLookup;
 +    private int featureSize;
 +    private float[] estimated;
 +
 +    private final static int BUFFER_HEADER_POSITION = 8;
 +
 +    /**
 +     * Provides a cache of packedTrie nodes to be used in getTrie.
 +     */
 +    private HashMap<Integer, PackedTrie> tries;
 +
 +    public PackedSlice(String prefix) throws IOException {
 +      name = prefix;
 +
 +      File source_file = new File(prefix + ".source");
 +      File target_file = new File(prefix + ".target");
 +      File target_lookup_file = new File(prefix + ".target.lookup");
 +      File feature_file = new File(prefix + ".features");
 +      File alignment_file = new File(prefix + ".alignments");
 +
 +      source = fullyLoadFileToArray(source_file);
 +      // First int specifies the size of this file, load from 1st int on
 +      targetLookup = fullyLoadFileToArray(target_lookup_file, 1);
 +
 +      target = associateMemoryMappedFile(target_file).asIntBuffer();
 +      features = associateMemoryMappedFile(feature_file);
 +      initializeFeatureStructures();
 +
 +      if (alignment_file.exists()) {
 +        alignments = associateMemoryMappedFile(alignment_file);
 +      } else {
 +        alignments = null;
 +      }
 +
-       tries = new HashMap<Integer, PackedTrie>();
++      tries = new HashMap<>();
 +    }
 +
 +    /**
 +     * Helper function to help create all the structures which describe features
 +     * in the Slice. Only called during object construction.
 +     */
 +    private void initializeFeatureStructures() {
 +      int num_blocks = features.getInt(0);
 +      estimated = new float[num_blocks];
 +      Arrays.fill(estimated, Float.NEGATIVE_INFINITY);
 +      featureSize = features.getInt(4);
 +    }
 +
 +    private int getIntFromByteBuffer(int position, ByteBuffer buffer) {
 +      return buffer.getInt(BUFFER_HEADER_POSITION + (4 * position));
 +    }
 +
 +    private int[] fullyLoadFileToArray(File file) throws IOException {
 +      return fullyLoadFileToArray(file, 0);
 +    }
 +
 +    /**
 +     * This function will use a bulk loading method to fully populate a target
 +     * array from file.
 +     *
 +     * @param file
 +     *          File that will be read from disk.
 +     * @param startIndex
 +     *          an offset into the read file.
 +     * @return an int array of size length(file) - offset containing ints in the
 +     *         file.
 +     * @throws IOException
 +     */
 +    private int[] fullyLoadFileToArray(File file, int startIndex) throws IOException {
 +      IntBuffer buffer = associateMemoryMappedFile(file).asIntBuffer();
 +      int size = (int) (file.length() - (4 * startIndex))/4;
 +      int[] result = new int[size];
 +      buffer.position(startIndex);
 +      buffer.get(result, 0, size);
 +      return result;
 +    }
 +
 +    private ByteBuffer associateMemoryMappedFile(File file) throws IOException {
 +      try(FileInputStream fileInputStream = new FileInputStream(file)) {
 +        FileChannel fileChannel = fileInputStream.getChannel();
 +        int size = (int) fileChannel.size();
-         MappedByteBuffer result = fileChannel.map(MapMode.READ_ONLY, 0, size);
-         return result;
++        return fileChannel.map(MapMode.READ_ONLY, 0, size);
 +      }
 +    }
 +
 +    private final int[] getTargetArray(int pointer) {
 +      // Figure out level.
 +      int tgt_length = 1;
 +      while (tgt_length < (targetLookup.length + 1) && targetLookup[tgt_length] <= pointer)
 +        tgt_length++;
 +      int[] tgt = new int[tgt_length];
 +      int index = 0;
 +      int parent;
 +      do {
 +        parent = target.get(pointer);
 +        if (parent != -1)
 +          tgt[index++] = target.get(pointer + 1);
 +        pointer = parent;
 +      } while (pointer != -1);
 +      return tgt;
 +    }
 +
 +    private synchronized PackedTrie getTrie(final int node_address) {
 +      PackedTrie t = tries.get(node_address);
 +      if (t == null) {
 +        t = new PackedTrie(node_address);
 +        tries.put(node_address, t);
 +      }
 +      return t;
 +    }
 +
 +    private synchronized PackedTrie getTrie(int node_address, int[] parent_src, int parent_arity,
 +        int symbol) {
 +      PackedTrie t = tries.get(node_address);
 +      if (t == null) {
 +        t = new PackedTrie(node_address, parent_src, parent_arity, symbol);
 +        tries.put(node_address, t);
 +      }
 +      return t;
 +    }
 +
 +    /**
 +     * Returns the FeatureVector associated with a rule (represented as a block ID).
 +     * The feature ids are hashed corresponding to feature names prepended with the owner string:
 +     * i.e. '0' becomes '<owner>_0'.
 +     * @param block_id
 +     * @return feature vector
 +     */
 +    private final FeatureVector loadFeatureVector(int block_id, OwnerId ownerId) {
 +      int featurePosition = getIntFromByteBuffer(block_id, features);
 +      final int numFeatures = encoding.readId(features, featurePosition);
 +
 +      featurePosition += EncoderConfiguration.ID_SIZE;
 +      final FeatureVector featureVector = new FeatureVector(encoding.getNumDenseFeatures());
 +      FloatEncoder encoder;
 +
 +      for (int i = 0; i < numFeatures; i++) {
 +        final int innerId = encoding.readId(features, featurePosition);
 +        encoder = encoding.encoder(innerId);
 +        final int outerId = encoding.outerId(innerId);
 +        final int ownedFeatureId = hashFeature(getFeature(outerId), ownerId);
 +        final float value = encoder.read(features, featurePosition);
 +        
 +        featureVector.add(ownedFeatureId, value);
 +        featurePosition += EncoderConfiguration.ID_SIZE + encoder.size();
 +      }
 +      
 +      return featureVector;
 +    }
 +
 +    /**
 +     * We need to synchronize this method as there is a many to one ratio between
 +     * PackedRule/PhrasePair and this class (PackedSlice). This means during concurrent first
 +     * getAlignments calls to PackedRule objects they could alter each other's positions within the
 +     * buffer before calling read on the buffer.
 +     */
-     private synchronized final byte[] getAlignmentArray(int block_id) {
++    private synchronized byte[] getAlignmentArray(int block_id) {
 +      if (alignments == null)
 +        throw new RuntimeException("No alignments available.");
 +      int alignment_position = getIntFromByteBuffer(block_id, alignments);
 +      int num_points = (int) alignments.get(alignment_position);
 +      byte[] alignment = new byte[num_points * 2];
 +
 +      alignments.position(alignment_position + 1);
 +      try {
 +        alignments.get(alignment, 0, num_points * 2);
 +      } catch (BufferUnderflowException bue) {
 +        LOG.warn("Had an exception when accessing alignment mapped byte buffer");
 +        LOG.warn("Attempting to access alignments at position: {}",  alignment_position + 1);
 +        LOG.warn("And to read this many bytes: {}",  num_points * 2);
 +        LOG.warn("Buffer capacity is : {}", alignments.capacity());
 +        LOG.warn("Buffer position is : {}", alignments.position());
 +        LOG.warn("Buffer limit is : {}", alignments.limit());
 +        throw bue;
 +      }
 +      return alignment;
 +    }
 +
-     private final PackedTrie root() {
++    private PackedTrie root() {
 +      return getTrie(0);
 +    }
 +
 +    public String toString() {
 +      return name;
 +    }
 +
 +    /**
 +     * A trie node within the grammar slice. Identified by its position within the source array,
 +     * and, as a supplement, the source string leading from the trie root to the node.
 +     * 
 +     * @author jg
 +     * 
 +     */
 +    public class PackedTrie implements Trie, RuleCollection {
 +
 +      private final int position;
 +
 +      private boolean sorted = false;
 +
-       private int[] src;
++      private final int[] src;
 +      private int arity;
 +
 +      private PackedTrie(int position) {
 +        this.position = position;
 +        src = new int[0];
 +        arity = 0;
 +      }
 +
 +      private PackedTrie(int position, int[] parent_src, int parent_arity, int symbol) {
 +        this.position = position;
 +        src = new int[parent_src.length + 1];
 +        System.arraycopy(parent_src, 0, src, 0, parent_src.length);
 +        src[src.length - 1] = symbol;
 +        arity = parent_arity;
 +        if (FormatUtils.isNonterminal(symbol))
 +          arity++;
 +      }
 +
 +      @Override
 +      public final Trie match(int token_id) {
 +        int num_children = source[position];
 +        if (num_children == 0)
 +          return null;
 +        if (num_children == 1 && token_id == source[position + 1])
 +          return getTrie(source[position + 2], src, arity, token_id);
 +        int top = 0;
 +        int bottom = num_children - 1;
 +        while (true) {
 +          int candidate = (top + bottom) / 2;
 +          int candidate_position = position + 1 + 2 * candidate;
 +          int read_token = source[candidate_position];
 +          if (read_token == token_id) {
 +            return getTrie(source[candidate_position + 1], src, arity, token_id);
 +          } else if (top == bottom) {
 +            return null;
 +          } else if (read_token > token_id) {
 +            top = candidate + 1;
 +          } else {
 +            bottom = candidate - 1;
 +          }
 +          if (bottom < top)
 +            return null;
 +        }
 +      }
 +
 +      @Override
 +      public HashMap<Integer, ? extends Trie> getChildren() {
-         HashMap<Integer, Trie> children = new HashMap<Integer, Trie>();
++        HashMap<Integer, Trie> children = new HashMap<>();
 +        int num_children = source[position];
 +        for (int i = 0; i < num_children; i++) {
 +          int symbol = source[position + 1 + 2 * i];
 +          int address = source[position + 2 + 2 * i];
 +          children.put(symbol, getTrie(address, src, arity, symbol));
 +        }
 +        return children;
 +      }
 +
 +      @Override
 +      public boolean hasExtensions() {
 +        return (source[position] != 0);
 +      }
 +
 +      @Override
 +      public ArrayList<? extends Trie> getExtensions() {
 +        int num_children = source[position];
-         ArrayList<PackedTrie> tries = new ArrayList<PackedTrie>(num_children);
++        ArrayList<PackedTrie> tries = new ArrayList<>(num_children);
 +
 +        for (int i = 0; i < num_children; i++) {
 +          int symbol = source[position + 1 + 2 * i];
 +          int address = source[position + 2 + 2 * i];
 +          tries.add(getTrie(address, src, arity, symbol));
 +        }
 +
 +        return tries;
 +      }
 +
 +      @Override
 +      public boolean hasRules() {
 +        int num_children = source[position];
 +        return (source[position + 1 + 2 * num_children] != 0);
 +      }
 +
 +      @Override
 +      public RuleCollection getRuleCollection() {
 +        return this;
 +      }
 +
 +      @Override
 +      public List<Rule> getRules() {
 +        List<Rule> rules = cached_rules.getIfPresent(this);
 +        if (rules != null) {
 +          return rules;
 +        }
 +
 +        int num_children = source[position];
 +        int rule_position = position + 2 * (num_children + 1);
 +        int num_rules = source[rule_position - 1];
 +
-         rules = new ArrayList<Rule>(num_rules);
++        rules = new ArrayList<>(num_rules);
 +        for (int i = 0; i < num_rules; i++) {
 +          rules.add(new PackedRule(rule_position + 3 * i));
 +        }
 +
 +        cached_rules.put(this, rules);
 +        return rules;
 +      }
 +
 +      /**
 +       * We determine if the Trie is sorted by checking if the estimated cost of the first rule in
 +       * the trie has been set.
 +       */
 +      @Override
 +      public boolean isSorted() {
 +        return sorted;
 +      }
 +
 +      /**
 +       * Estimates rule costs for all rules at this trie node.
 +       */
 +      private synchronized void sortRules(List<FeatureFunction> featureFunctions) {
 +        int num_children = source[position];
 +        int rule_position = position + 2 * (num_children + 1);
 +        int num_rules = source[rule_position - 1];
 +        if (num_rules == 0) {
 +          this.sorted = true;
 +          return;
 +        }
 +        final Integer[] rules = new Integer[num_rules];
 +
 +        int block_id;
 +        int lhs;
 +        int[] target;
 +        byte[] alignments;
 +        FeatureVector features;
 +        
 +        for (int i = 0; i < num_rules; ++i) {
 +          // we construct very short-lived rule objects for sorting
 +          rules[i] = rule_position + 2 + 3 * i;
 +          block_id = source[rules[i]];
 +          lhs = source[rule_position + 3 * i];
 +          target = getTargetArray(source[rule_position + 1 + 3 * i]);
 +          features = loadFeatureVector(block_id, owner);
 +          alignments = getAlignmentArray(block_id);
 +          final Rule rule = new Rule(lhs, src, target, arity, features, alignments, owner);
 +          estimated[block_id] = rule.estimateRuleCost(featureFunctions);
 +        }
 +
-         Arrays.sort(rules, new Comparator<Integer>() {
-           public int compare(Integer a, Integer b) {
-             float a_cost = estimated[source[a]];
-             float b_cost = estimated[source[b]];
-             if (a_cost == b_cost)
-               return 0;
-             return (a_cost > b_cost ? -1 : 1);
-           }
++        Arrays.sort(rules, (a, b) -> {
++          float a_cost = estimated[source[a]];
++          float b_cost = estimated[source[b]];
++          if (a_cost == b_cost)
++            return 0;
++          return (a_cost > b_cost ? -1 : 1);
 +        });
 +
 +        int[] sorted = new int[3 * num_rules];
 +        int j = 0;
-         for (int i = 0; i < rules.length; i++) {
-           int address = rules[i];
++        for (Integer address : rules) {
 +          sorted[j++] = source[address - 2];
 +          sorted[j++] = source[address - 1];
 +          sorted[j++] = source[address];
 +        }
-         for (int i = 0; i < sorted.length; i++)
-           source[rule_position + i] = sorted[i];
++        System.arraycopy(sorted, 0, source, rule_position + 0, sorted.length);
 +
 +        // Replace rules in cache with their sorted values on next getRules()
 +        cached_rules.invalidate(this);
 +        this.sorted = true;
 +      }
 +
 +      @Override
 +      public List<Rule> getSortedRules(List<FeatureFunction> featureFunctions) {
 +        if (!isSorted())
 +          sortRules(featureFunctions);
 +        return getRules();
 +      }
 +
 +      @Override
 +      public int[] getSourceSide() {
 +        return src;
 +      }
 +
 +      @Override
 +      public int getArity() {
 +        return arity;
 +      }
 +
 +      @Override
 +      public Iterator<Integer> getTerminalExtensionIterator() {
 +        return new PackedChildIterator(position, true);
 +      }
 +
 +      @Override
 +      public Iterator<Integer> getNonterminalExtensionIterator() {
 +        return new PackedChildIterator(position, false);
 +      }
 +
 +      public final class PackedChildIterator implements Iterator<Integer> {
 +
 +        private int current;
-         private boolean terminal;
++        private final boolean terminal;
 +        private boolean done;
 +        private int last;
 +
 +        PackedChildIterator(int position, boolean terminal) {
 +          this.terminal = terminal;
 +          int num_children = source[position];
 +          done = (num_children == 0);
 +          if (!done) {
 +            current = (terminal ? position + 1 : position - 1 + 2 * num_children);
 +            last = (terminal ? position - 1 + 2 * num_children : position + 1);
 +          }
 +        }
 +
 +        @Override
 +        public boolean hasNext() {
 +          if (done)
 +            return false;
 +          int next = (terminal ? current + 2 : current - 2);
 +          if (next == last)
 +            return false;
 +          return (terminal ? source[next] > 0 : source[next] < 0);
 +        }
 +
 +        @Override
 +        public Integer next() {
 +          if (done)
 +            throw new RuntimeException("No more symbols!");
 +          int symbol = source[current];
 +          if (current == last)
 +            done = true;
 +          if (!done) {
 +            current = (terminal ? current + 2 : current - 2);
 +            done = (terminal ? source[current] < 0 : source[current] > 0);
 +          }
 +          return symbol;
 +        }
 +
 +        @Override
 +        public void remove() {
 +          throw new UnsupportedOperationException();
 +        }
 +      }
 +      
 +      /**
 +       * A packed phrase pair represents a rule of the form of a phrase pair, packed with the
 +       * grammar-packer.pl script, which simply adds a nonterminal [X] to the left-hand side of
 +       * all phrase pairs (and converts the Moses features). The packer then packs these. We have
 +       * to then put a nonterminal on the source and target sides to treat the phrase pairs like
 +       * left-branching rules, which is how Joshua deals with phrase decoding. 
 +       * 
 +       * @author Matt Post post@cs.jhu.edu
 +       *
 +       */
 +      public final class PackedPhrasePair extends PackedRule {
 +
 +        private final Supplier<int[]> targetSupplier;
 +        private final Supplier<byte[]> alignmentSupplier;
 +
 +        public PackedPhrasePair(int address) {
 +          super(address);
 +          targetSupplier = initializeTargetSupplier();
 +          alignmentSupplier = initializeAlignmentSupplier();
 +        }
 +
 +        @Override
 +        public int getArity() {
 +          return PackedTrie.this.getArity() + 1;
 +        }
 +
 +        /**
 +         * Initialize a number of suppliers which get evaluated when their respective getters
 +         * are called.
 +         * Inner lambda functions are guaranteed to only be called once, because of this underlying
 +         * structures are accessed in a threadsafe way.
 +         * Guava's implementation makes sure only one read of a volatile variable occurs per get.
 +         * This means this implementation should be as thread-safe and performant as possible.
 +         */
- 
 +        private Supplier<int[]> initializeTargetSupplier(){
 +          Supplier<int[]> result = Suppliers.memoize(() ->{
 +            int[] phrase = getTargetArray(source[address + 1]);
 +            int[] tgt = new int[phrase.length + 1];
 +            tgt[0] = -1;
 +            for (int i = 0; i < phrase.length; i++)
 +              tgt[i+1] = phrase[i];
 +            return tgt;
 +          });
 +          return result;
 +        }
 +
 +        private Supplier<byte[]> initializeAlignmentSupplier(){
-           Supplier<byte[]> result = Suppliers.memoize(() ->{
++          return Suppliers.memoize(() ->{
 +            byte[] raw_alignment = getAlignmentArray(source[address + 2]);
 +            byte[] points = new byte[raw_alignment.length + 2];
 +            points[0] = points[1] = 0;
 +            for (int i = 0; i < raw_alignment.length; i++)
 +              points[i + 2] = (byte) (raw_alignment[i] + 1);
 +            return points;
 +          });
-           return result;
 +        }
 +
 +        /**
 +         * Take the target phrase of the underlying rule and prepend an [X].
 +         * 
 +         * @return the augmented phrase
 +         */
 +        @Override
 +        public int[] getTarget() {
 +          return this.targetSupplier.get();
 +        }
 +        
 +        /**
 +         * Take the source phrase of the underlying rule and prepend an [X].
 +         * 
 +         * @return the augmented source phrase
 +         */
 +        @Override
 +        public int[] getSource() {
 +          int phrase[] = new int[src.length + 1];
 +          int ntid = Vocabulary.id(PackedGrammar.this.joshuaConfiguration.default_non_terminal);
 +          phrase[0] = ntid;
 +          System.arraycopy(src,  0, phrase, 1, src.length);
 +          return phrase;
 +        }
 +        
 +        /**
 +         * Similarly the alignment array needs to be shifted over by one.
 +         * 
 +         * @return the byte[] alignment
 +         */
 +        @Override
 +        public byte[] getAlignment() {
 +          // if no alignments in grammar do not fail
 +          if (alignments == null) {
 +            return null;
 +          }
 +
 +          return this.alignmentSupplier.get();
 +        }
 +      }
 +
 +      public class PackedRule extends Rule {
 +        protected final int address;
 +        private final Supplier<int[]> targetSupplier;
 +        private final Supplier<FeatureVector> featureVectorSupplier;
 +        private final Supplier<byte[]> alignmentsSupplier;
 +
 +        public PackedRule(int address) {
 +          super(source[address], src, null, PackedTrie.this.getArity(), null, null, owner);
 +          this.address = address;
 +          this.targetSupplier = intializeTargetSupplier();
 +          this.featureVectorSupplier = initializeFeatureVectorSupplier();
 +          this.alignmentsSupplier = initializeAlignmentsSupplier();
 +        }
 +
 +        private Supplier<int[]> intializeTargetSupplier(){
 +          Supplier<int[]> result = Suppliers.memoize(() ->{
 +            return getTargetArray(source[address + 1]);
 +          });
 +          return result;
 +        }
 +
 +        private Supplier<FeatureVector> initializeFeatureVectorSupplier(){
 +          Supplier<FeatureVector> result = Suppliers.memoize(() ->{
 +            return loadFeatureVector(source[address + 2], owner);
 +         });
 +          return result;
 +        }
 +
 +        private Supplier<byte[]> initializeAlignmentsSupplier(){
-           Supplier<byte[]> result = Suppliers.memoize(()->{
++          return Suppliers.memoize(()->{
 +            // if no alignments in grammar do not fail
 +            if (alignments == null){
 +              return null;
 +            }
 +            return getAlignmentArray(source[address + 2]);
 +          });
-           return result;
 +        }
 +
 +        @Override
 +        public int getArity() {
 +          return PackedTrie.this.getArity();
 +        }
 +
 +        @Override
 +        public int getLHS() {
 +          return source[address];
 +        }
 +
 +        @Override
 +        public int[] getTarget() {
 +          return this.targetSupplier.get();
 +        }
 +
 +        @Override
 +        public int[] getSource() {
 +          return src;
 +        }
 +
 +        @Override
 +        public FeatureVector getFeatureVector() {
 +          return this.featureVectorSupplier.get();
 +        }
 +        
 +        @Override
 +        public byte[] getAlignment() {
 +          return this.alignmentsSupplier.get();
 +        }
 +
 +        @Override
 +        public float getEstimatedCost() {
 +          return estimated[source[address + 2]];
 +        }
 +
 +        @Override
 +        public float estimateRuleCost(List<FeatureFunction> models) {
 +          return estimated[source[address + 2]];
 +        }
 +      }
 +    }
 +  }
 +
 +  @Override
 +  public void addOOVRules(int word, List<FeatureFunction> featureFunctions) {
 +    throw new RuntimeException("PackedGrammar.addOOVRules(): I can't add OOV rules");
 +  }
 +  
 +  @Override
 +  public void addRule(Rule rule) {
 +    throw new RuntimeException("PackedGrammar.addRule(): I can't add rules");
 +  }
 +  
 +  /** 
 +   * Read the config file
 +   * 
 +   * TODO: this should be rewritten using typeconfig.
 +   * 
 +   * @param config
 +   * @throws IOException
 +   */
 +  private void readConfig(String config) throws IOException {
 +    int version = 0;
 +    
 +    for (String line: new LineReader(config)) {
 +      String[] tokens = line.split(" = ");
 +      if (tokens[0].equals("max-source-len"))
 +        this.maxSourcePhraseLength = Integer.parseInt(tokens[1]);
 +      else if (tokens[0].equals("version")) {
 +        version = Integer.parseInt(tokens[1]);
 +      }
 +    }
 +    
 +    if (version != 3) {
 +      String message = String.format("The grammar at %s was packed with packer version %d, but the earliest supported version is %d",
 +          this.grammarDir, version, SUPPORTED_VERSION);
 +      throw new RuntimeException(message);
 +    }
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/SliceAggregatingTrie.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/SliceAggregatingTrie.java
index c6d03a6,0000000..7ec55ee
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/SliceAggregatingTrie.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/tm/packed/SliceAggregatingTrie.java
@@@ -1,236 -1,0 +1,236 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.ff.tm.packed;
 +
 +import static java.util.Collections.emptyList;
 +import static java.util.Collections.unmodifiableList;
 +
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Collection;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.Iterator;
 +import java.util.List;
 +import java.util.Set;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.ff.tm.RuleCollection;
 +import org.apache.joshua.decoder.ff.tm.Trie;
 +import org.apache.joshua.decoder.ff.tm.hash_based.ExtensionIterator;
 +
 +/**
 + * <p>SliceAggregatingTrie collapses multiple tries
 + * with the same source root (i.e. tries from multiple packed slices).</p>
 + * 
 + * <p>Consider the example below.
 + * Without SliceAggregatingTries, the following grammar rules could have only
 + * partitioned by splitting rule lists when the first word of SOURCE changes. ("&gt;" markers).</p>
 + * 
 + * <p>Using a SliceAggregatingTrie allows splitting at changes of second SOURCE words ("&gt;&gt;" marker).</p>
 + * 
 + * <pre>
 + * EXAMPLE: (LHS ||| SOURCE ||| TARGET)
 + * [X] ||| - ||| -
 + * &gt;
 + * [X] ||| [X] ||| [X]
 + * &gt;&gt;
 + * [X] ||| [X] a ||| [X] A
 + * [X] ||| [X] a ||| [X] A
 + * &gt;&gt;
 + * [X] ||| [X] b ||| [X] B
 + * &gt;
 + * [X] ||| u ||| u
 + * </pre>
 + * <p>A SliceAggregatingTrie node behaves just like a regular Trie node but subsumes a list of extensions/children.
 + * This class hides the complexity of having multiple tries with the same root
 + * from nodes one level up.
 + * Similar to PackedRoot, it maintains a lookup table of children's
 + * source-side words to know
 + * in which subtrie (i.e. packedSlice) it needs to traverse into when 
 + * match() is called.
 + * A SliceAggregatingTrie never holds any rules associated with it, thus
 + * rules with the source-side represented by the SliceAggregatingTrie node
 + * must be found in exactly one of the subtries.
 + * (!) This assumption relies on the sort order of the packed grammar.
 + * If the grammar was incorrectly sorted and then packed, construction
 + * of SliceAggregatingTrie nodes fails.</p>
 + * 
 + * @author fhieber
 + */
 +public class SliceAggregatingTrie implements Trie, RuleCollection {
 +  
 +  /**
 +   * A multitude of packedTries with the same source-side
 +   * firstword. The order is induced by the
 +   * sorting order of the text grammar that was input to the GrammarPacker.
 +   * This implies that rules for the node represented by this SliceAggregatingTrie
 +   * instance must be found in ONE of the sub tries.
 +   * This is checked below in the constructor. 
 +   */
 +  private final List<Trie> tries;
 +  /** reference to the only subtrie that can contain rules. Set by buildLookupTable() */
 +  private Trie trieWithRules = null;
 +  
 +  /** Maintains an index of all children of all sub tries */
 +  private final HashMap<Integer, Trie> lookup = new HashMap<>();
 +  
 +  public SliceAggregatingTrie(final List<Trie> tries) {
 +    if (tries == null || tries.isEmpty()) {
 +      throw new RuntimeException(
 +          "SliceAggregatingTrie node requires at least one packedTrie");
 +    }
 +    this.tries = unmodifiableList(tries);
 +    buildLookupTable();
 +  }
 +  
 +  /**
 +   * Fills the lookup table for child nodes.
 +   * Also performs various checks to ensure correctness of the 
 +   * PackedTrie aggregation. 
 +   */
 +  private void buildLookupTable() {
 +    final Set<Integer> seen_child_ids = new HashSet<>();
 +    Trie previous_trie = null;
 +    boolean first = true;
 +    for (final Trie trie : this.tries) {
 +      /*
 +       * perform some checks to make sure tries are correctly split.
 +       */
 +      if (!first) {
 +        if (!haveSameSourceSide(previous_trie, trie) || !haveSameArity(previous_trie, trie)) {
 +          throw new RuntimeException("SliceAggregatingTrie's subtries differ in sourceSide or arity. Was the text grammar sorted insufficiently?");
 +        }
 +      } else {
 +        first = false;
 +      }
 +      previous_trie = trie;
 +      
 +      if (trie.hasRules()) {
 +        if (trieWithRules != null) {
 +          throw new RuntimeException("SliceAggregatingTrie can only have one subtrie with rules. Was the text grammar sorted insufficiently?");
 +        }
 +        trieWithRules = trie;
 +      }
 +
 +      final HashMap<Integer, ? extends Trie> children = trie.getChildren();
 +      for (int id : children.keySet()) {
 +        if (seen_child_ids.contains(id)) {
 +          throw new RuntimeException("SliceAggregatingTrie's subtries contain non-disjoint child words. Was the text grammar sorted insufficiently?");
 +        }
 +        seen_child_ids.add(id);
 +        lookup.put(id, children.get(id));
 +      }
 +    }
 +  }
 +  
 +  private boolean haveSameSourceSide(final Trie t1, final Trie t2) {
 +    return Arrays.equals(
 +        t1.getRuleCollection().getSourceSide(),
 +        t2.getRuleCollection().getSourceSide());
 +  }
 +  
 +  private boolean haveSameArity(final Trie t1, final Trie t2) {
 +    return t1.getRuleCollection().getArity() == t2.getRuleCollection().getArity();
 +  }
 +  
 +  @Override
 +  public Trie match(int wordId) {
 +    return lookup.get(wordId);
 +  }
 +
 +  @Override
 +  public boolean hasExtensions() {
 +    return !lookup.isEmpty();
 +  }
 +
 +  @Override
 +  public Collection<? extends Trie> getExtensions() {
 +    return new ArrayList<>(lookup.values());
 +  }
 +
 +  @Override
 +  public HashMap<Integer, ? extends Trie> getChildren() {
 +    return lookup;
 +  }
 +
 +  @Override
 +  public Iterator<Integer> getTerminalExtensionIterator() {
 +    return new ExtensionIterator(lookup, true);
 +  }
 +
 +  @Override
 +  public Iterator<Integer> getNonterminalExtensionIterator() {
 +    return new ExtensionIterator(lookup, true);
 +  }
 +  
 +  @Override
 +  public RuleCollection getRuleCollection() {
 +    return this;
 +  }
 +  
 +  /*
 +   * The following method's return values depend on whether there is 
 +   * a single subtrie encoding rules (trieWithRules).
 +   * All other subtries can only contain rules some levels deeper.
 +   */ 
 +  
 +  @Override
 +  public boolean hasRules() {
-     return trieWithRules == null ? false : trieWithRules.hasRules();
++    return trieWithRules != null && trieWithRules.hasRules();
 +  }
 +  
 +  @Override
 +  public List<Rule> getRules() {
 +    if (!hasRules()) {
 +      return emptyList();
 +    }
 +    return trieWithRules.getRuleCollection().getRules();
 +  }
 +  
 +  @Override
 +  public List<Rule> getSortedRules(List<FeatureFunction> models) {
 +    if (!hasRules()) {
 +      return emptyList();
 +    }
 +    return trieWithRules.getRuleCollection().getSortedRules(models);
 +  }
 +
 +  @Override
 +  public boolean isSorted() {
-     return !hasRules() ? false : trieWithRules.getRuleCollection().isSorted();
++    return hasRules() && trieWithRules.getRuleCollection().isSorted();
 +  }
 +
 +  /*
 +   * The constructor checked that all sub tries have the same arity and sourceSide.
 +   * We can thus simply return the value from the first in list.
 +   */
 +
 +  @Override
 +  public int[] getSourceSide() {
 +    return tries.get(0).getRuleCollection().getSourceSide();
 +  }
 +
 +  @Override
 +  public int getArity() {
 +    return tries.get(0).getRuleCollection().getArity();
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AlignedSourceTokens.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AlignedSourceTokens.java
index 864b383,0000000..c0ca4fa
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AlignedSourceTokens.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AlignedSourceTokens.java
@@@ -1,112 -1,0 +1,112 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.LinkedList;
 +import java.util.ListIterator;
 +
 +/**
 + * Class that represents a one to (possibly) many alignment from target to
 + * source. Extends from a LinkedList. Instances of this class are updated by the
 + * WordAlignmentExtractor.substitute() method. 
 + * The {@link org.apache.joshua.decoder.hypergraph.AlignedSourceTokens#shiftBy(int, int)} 
 + * method shifts the
 + * elements in the list by a scalar to reflect substitutions of non terminals in
 + * the rule. if indexes are final, i.e. the point instance has been substituted
 + * into a parent WordAlignmentState once, 
 + * {@link org.apache.joshua.decoder.hypergraph.AlignedSourceTokens#isFinal} is set to true. 
 + * This is
 + * necessary since the final source index of a point is known once we have
 + * substituted in a complete WordAlignmentState into its parent. If the index in
 + * the list is a non terminal, {@link org.apache.joshua.decoder.hypergraph.AlignedSourceTokens#isNonTerminal} = true
 + */
 +class AlignedSourceTokens extends LinkedList<Integer> {
 +
 +  private static final long serialVersionUID = 1L;
 +  /** whether this Point refers to a non terminal in source&target */
 +  private boolean isNonTerminal = false;
 +  /** whether this instance does not need to be updated anymore */
 +  private boolean isFinal = false;
 +  /** whether the word this Point corresponds to has no alignment in source */
 +  private boolean isNull = false;
 +
 +  AlignedSourceTokens() {}
 +
 +  void setFinal() {
 +    isFinal = true;
 +  }
 +
 +  void setNonTerminal() {
 +    isNonTerminal = true;
 +  }
 +
 +  void setNull() {
 +    isNull = true;
 +  }
 +
 +  @Override
 +  /**
 +   * returns true if element was added.
 +   */
 +  public boolean add(Integer x) {
-     return isNull ? false : super.add(x);
++    return !isNull && super.add(x);
 +  }
 +
 +  public boolean isNonTerminal() {
 +    return isNonTerminal;
 +  }
 +
 +  public boolean isFinal() {
 +    return isFinal;
 +  }
 +
 +  public boolean isNull() {
 +    return isNull;
 +  }
 +
 +  /**
 +   * shifts each item in the LinkedList by <shift>.
 +   * Only applies to items larger than <start>
 +   */
 +  void shiftBy(int start, int shift) {
 +    if (!isFinal && !isNull) {
 +      final ListIterator<Integer> it = this.listIterator();
 +      while (it.hasNext()) {
 +        final int x = it.next();
 +        if (x > start) {
 +          it.set(x + shift);
 +        }
 +      }
 +    }
 +  }
 +
 +  public String toString() {
 +    StringBuilder sb = new StringBuilder();
 +    if (isFinal)
 +      sb.append("f");
 +    if (isNull) {
 +      sb.append("[NULL]");
 +    } else {
 +      sb.append(super.toString());
 +    }
 +    if (isNonTerminal)
 +      sb.append("^");
 +    return sb.toString();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AllSpansWalker.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AllSpansWalker.java
index 1aad06f,0000000..3f1c504
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AllSpansWalker.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/AllSpansWalker.java
@@@ -1,63 -1,0 +1,60 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.HashSet;
 +import java.util.Set;
 +
 +import org.apache.joshua.corpus.Span;
 +
 +/***
 + * Uses {@link ForestWalker} to visit one {@link HGNode} per span of the chart. No guarantees are
 + * provided as to which HGNode will be visited in each span.
 + * 
 + * @author Matt Post post@cs.jhu.edu
 + * 
 + */
 +
 +public class AllSpansWalker {
-   private Set<Span> visitedSpans;
++  private final Set<Span> visitedSpans;
 +
 +  public AllSpansWalker() {
-     visitedSpans = new HashSet<Span>();
++    visitedSpans = new HashSet<>();
 +  }
 +
 +  /**
 +   * This function wraps a {@link ForestWalker}, preventing calls to its walker function for all but
 +   * the first node reached for each span.
 +   * 
 +   * @param node the {@link org.apache.joshua.decoder.hypergraph.HGNode} we wish to walk
 +   * @param walker the {@link org.apache.joshua.decoder.hypergraph.WalkerFunction} 
 +   * implementation to do the walking
 +   */
 +  public void walk(HGNode node, final WalkerFunction walker) {
-     new ForestWalker().walk(node, new org.apache.joshua.decoder.hypergraph.WalkerFunction() {
-       @Override
-       public void apply(HGNode node, int index) {
-         if (node != null) {
-           Span span = new Span(node.i, node.j);
-           if (!visitedSpans.contains(span)) {
-             walker.apply(node, 0);
-             visitedSpans.add(span);
-           }
++    new ForestWalker().walk(node, (node1, index) -> {
++      if (node1 != null) {
++        Span span = new Span(node1.i, node1.j);
++        if (!visitedSpans.contains(span)) {
++          walker.apply(node1, 0);
++          visitedSpans.add(span);
 +        }
 +      }
 +    });
 +  }
 +}


[32/50] [abbrv] incubator-joshua git commit: Merge branch 'master' into 7

Posted by mj...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/KBestExtractor.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/KBestExtractor.java
index 131498b,0000000..cb79bf9
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/KBestExtractor.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/KBestExtractor.java
@@@ -1,1055 -1,0 +1,1052 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import static java.util.Collections.emptyList;
 +import static org.apache.joshua.decoder.ff.FeatureMap.hashFeature;
 +import static org.apache.joshua.util.FormatUtils.removeSentenceMarkers;
 +import static org.apache.joshua.util.FormatUtils.unescapeSpecialSymbols;
 +
 +import java.io.BufferedWriter;
 +import java.io.IOException;
 +import java.io.OutputStreamWriter;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Comparator;
 +import java.util.HashMap;
 +import java.util.HashSet;
 +import java.util.List;
 +import java.util.PriorityQueue;
 +
 +import org.apache.joshua.corpus.Vocabulary;
 +import org.apache.joshua.decoder.BLEU;
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.StructuredTranslation;
 +import org.apache.joshua.decoder.StructuredTranslationFactory;
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.ff.fragmentlm.Tree;
 +import org.apache.joshua.decoder.ff.state_maintenance.DPState;
 +import org.apache.joshua.decoder.ff.tm.OwnerMap;
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.io.DeNormalize;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +import org.apache.joshua.decoder.segment_file.Token;
 +import org.apache.joshua.util.FormatUtils;
 +
 +/**
 + * <p>This class implements lazy k-best extraction on a hyper-graph.</p>
 + * 
 + * <p>K-best extraction over hypergraphs is a little hairy, but is best understood in the following
 + * manner. Imagine a hypergraph, which is composed of nodes connected by hyperedges. A hyperedge has
 + * exactly one parent node and 1 or more tail nodes, corresponding to the rank of the rule that gave
 + * rise to the hyperedge. Each node has 1 or more incoming hyperedges.</p>
 + * 
 + * <p>K-best extraction works in the following manner. A derivation is a set of nodes and hyperedges
 + * that leads from the root node down and exactly covers the source-side sentence. To define a
 + * derivation, we start at the root node, choose one of its incoming hyperedges, and then recurse to
 + * the tail (or antecedent) nodes of that hyperedge, where we continually make the same decision.</p>
 + * 
 + * <p>Each hypernode has its hyperedges sorted according to their model score. To get the best
 + * (Viterbi) derivation, we simply recursively follow the best hyperedge coming in to each
 + * hypernode.</p>
 + * 
 + * <p>How do we get the second-best derivation? It is defined by changing exactly one of the decisions
 + * about which hyperedge to follow in the recursion. Somewhere, we take the second-best. Similarly,
 + * the third-best derivation makes a single change from the second-best: either making another
 + * (differnt) second-best choice somewhere along the 1-best derivation, or taking the third-best
 + * choice at the same spot where the second-best derivation took the second-best choice. And so on.</p>
 + * 
 + * <p>This class uses two classes that encode the necessary meta-information. The first is the
 + * DerivationState class. It roughly corresponds to a hyperedge, and records, for each of that
 + * hyperedge's tail nodes, which-best to take. So for a hyperedge with three tail nodes, the 1-best
 + * derivation will be (1,1,1), the second-best will be one of (2,1,1), (1,2,1), or (1,1,2), the
 + * third best will be one of</p>
 + * 
 + * <code>(3,1,1), (2,2,1), (1,1,3)</code>
 + * 
 + * <p>and so on.</p>
 + * 
 + * <p>The configuration parameter `output-format` controls what exactly is extracted from the forest.
 + * See documentation for that below. Note that Joshua does not store individual feature values while 
 + * decoding, but only the cost of each edge (in the form of a float). Therefore, if you request
 + * the features values (`%f` in `output-format`), the feature functions must be replayed, which
 + * is expensive.</p>
 + * 
 + * <p>The configuration parameter `top-n` controls how many items are returned. If this is set to 0,
 + * k-best extraction should be turned off entirely.</p>
 + * 
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +public class KBestExtractor {
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  private final String outputFormat;
-   private final HashMap<HGNode, VirtualNode> virtualNodesTable = new HashMap<HGNode, VirtualNode>();
++  private final HashMap<HGNode, VirtualNode> virtualNodesTable = new HashMap<>();
 +
 +  // static final String rootSym = JoshuaConfiguration.goal_symbol;
 +  static final String rootSym = "ROOT";
 +  static final int rootID = Vocabulary.id(rootSym);
 +
 +  private enum Side {
 +    SOURCE, TARGET
-   };
++  }
 +
 +  /* Whether to extract only unique strings */
 +  private final boolean extractUniqueNbest;
 +
 +  /* Which side to output (source or target) */
 +  private final Side defaultSide;
 +
 +  /* The input sentence */
 +  private final Sentence sentence;
 +
 +  /* The weights being used to score the forest */
 +  private final FeatureVector weights;
 +
 +  /* The feature functions */
 +  private final List<FeatureFunction> featureFunctions;
 +
 +  /* BLEU statistics of the references */
 +  private BLEU.References references = null;
 +
 +  public KBestExtractor(
 +      Sentence sentence,
 +      List<FeatureFunction> featureFunctions,
 +      FeatureVector weights,
 +      boolean isMonolingual,
 +      JoshuaConfiguration joshuaConfiguration) {
 +
 +    this.featureFunctions = featureFunctions;
 +
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    this.outputFormat = this.joshuaConfiguration.outputFormat;
 +    this.extractUniqueNbest = joshuaConfiguration.use_unique_nbest;
 +
 +    this.weights = weights;
 +    this.defaultSide = (isMonolingual ? Side.SOURCE : Side.TARGET);
 +    this.sentence = sentence;
 +
 +    if (joshuaConfiguration.rescoreForest) {
 +      references = new BLEU.References(sentence.references());
 +    }
 +  }
 +
 +  /**
 +   * Returns the kth derivation.
 +   * 
 +   * You may need to reset_state() before you call this function for the first time.
 +   * 
 +   * @param node the node to start at
 +   * @param k the kth best derivation (indexed from 1)
 +   * @return the derivation object
 +   */
 +  public DerivationState getKthDerivation(HGNode node, int k) {
 +    final VirtualNode virtualNode = getVirtualNode(node);
 +    return virtualNode.lazyKBestExtractOnNode(this, k);
 +  }
 +  
 +  /**
 +   * Returns the k-th Structured Translation.
 +   * 
 +   * @param node The node to extract from
 +   * @param k The (1-indexed) index of the item wanted
 +   * @return a StructuredTranslation object
 +   */
 +  public StructuredTranslation getKthStructuredTranslation(HGNode node, int k) {
 +    StructuredTranslation result = null;
 +    final DerivationState derivationState = getKthDerivation(node, k);
 +    if (derivationState != null) {
 +      result = StructuredTranslationFactory.fromKBestDerivation(sentence, derivationState);
 +    }
 +    return result;
 +  }
 +  
 +  /**
 +   * This is an entry point for extracting k-best hypotheses as StructuredTranslation objects.
 +   * It computes all of them and returning a list of StructuredTranslation objects.
 +   * These objects hold all translation information (string, tokens, features, alignments, score).
 +   * 
 +   * @param hg the hypergraph to extract from
 +   * @param topN how many to extract
 +   * @return list of StructuredTranslation objects, empty if there is no HyperGraph goal node.
 +   */
 +  public List<StructuredTranslation> KbestExtractOnHG(HyperGraph hg, int topN) {
 +    resetState();
 +    if (hg == null || hg.goalNode == null) {
 +      return emptyList();
 +    }
 +    final List<StructuredTranslation> kbest = new ArrayList<>(topN);
 +    for (int k = 1; k <= topN; k++) {
 +      StructuredTranslation translation = getKthStructuredTranslation(hg.goalNode, k);
 +      if (translation == null) {
 +        break;
 +      }
 +      kbest.add(translation);
 +    }
 +    return kbest;
 +  }
 +  
 +  /**
 +   * Compute the string that is output from the decoder, using the "output-format" config file
 +   * parameter as a template.
 +   * 
 +   * You may need to {@link org.apache.joshua.decoder.hypergraph.KBestExtractor#resetState()} 
 +   * before you call this function for the first time.
 +   * 
 +   * @param node todo
 +   * @param k todo
 +   * @return todo
 +   */
 +  public String getKthHyp(HGNode node, int k) {
 +
 +    String outputString = null;
 +    DerivationState derivationState = getKthDerivation(node, k);
 +    if (derivationState != null) {
 +      // ==== read the kbest from each hgnode and convert to output format
 +      String hypothesis = maybeProjectCase(
 +                            unescapeSpecialSymbols(
 +                              removeSentenceMarkers(
 +                                derivationState.getHypothesis())), derivationState);
 +      
 +      
 +      /*
 +       * To save space, the decoder only stores the model cost,
 +       * no the individual feature values.
 +       * If you want to output them, you have to replay them.
 +       */
 +
 +      FeatureVector features = new FeatureVector(0);
 +      if (outputFormat.contains("%f") || outputFormat.contains("%d"))
 +        features = derivationState.getFeatures();
 +
 +      outputString = outputFormat
 +          .replace("%k", Integer.toString(k))
 +          .replace("%s", hypothesis)
 +          .replace("%S", DeNormalize.processSingleLine(hypothesis))
 +          // TODO (kellens): Fix the recapitalization here
 +          .replace("%i", Integer.toString(sentence.id()))
 +          .replace("%f", features.textFormat())
 +          .replace("%c", String.format("%.3f", derivationState.cost));
 +
 +      if (outputFormat.contains("%t")) {
 +        outputString = outputString.replace("%t", derivationState.getTree());
 +      }
 +
 +      if (outputFormat.contains("%e")) {
 +        outputString = outputString.replace("%e", removeSentenceMarkers(derivationState.getHypothesis(Side.SOURCE)));
 +      }
 +
 +      /* %d causes a derivation with rules one per line to be output */
 +      if (outputFormat.contains("%d")) {
 +        outputString = outputString.replace("%d", derivationState.getDerivation());
 +      }
 +      
 +      /* %a causes output of word level alignments between input and output hypothesis */
 +      if (outputFormat.contains("%a")) {
 +        outputString = outputString.replace("%a",  derivationState.getWordAlignment());
 +      }
 +      
 +    }
 +
 +    return outputString;
 +  }
 +
 +  // =========================== end kbestHypergraph
 +
 +  /**
 +   * If requested, projects source-side lettercase to target, and appends the alignment from
 +   * to the source-side sentence in ||s.
 +   * 
 +   * @param hypothesis todo
 +   * @param state todo
 +   * @return source-side lettercase to target, and appends the alignment from to the source-side sentence in ||s
 +   */
 +  private String maybeProjectCase(String hypothesis, DerivationState state) {
 +    String output = hypothesis;
 +
 +    if (joshuaConfiguration.project_case) {
 +      String[] tokens = hypothesis.split("\\s+");
 +      List<List<Integer>> points = state.getWordAlignmentList();
 +      for (int i = 0; i < points.size(); i++) {
 +        List<Integer> target = points.get(i);
 +        for (int source: target) {
 +          Token token = sentence.getTokens().get(source + 1); // skip <s>
 +          String annotation = "";
 +          if (token != null && token.getAnnotation("lettercase") != null)
 +            annotation = token.getAnnotation("lettercase");
 +          if (source != 0 && annotation.equals("upper"))
 +            tokens[i] = FormatUtils.capitalize(tokens[i]);
 +          else if (annotation.equals("all-upper"))
 +            tokens[i] = tokens[i].toUpperCase();
 +        }
 +      }
 +
 +      output = String.join(" ",  tokens);
 +    }
 +
 +    return output;
 +  }
 +
 +  /**
 +   * Convenience function for k-best extraction that prints to STDOUT.
 +   * @param hg the {@link org.apache.joshua.decoder.hypergraph.HyperGraph} from which to extract
 +   * @param topN the number of k
 +   * @throws IOException if there is an error writing the extraction
 +   */
 +  public void lazyKBestExtractOnHG(HyperGraph hg, int topN) throws IOException {
 +    lazyKBestExtractOnHG(hg, topN, new BufferedWriter(new OutputStreamWriter(System.out)));
 +  }
 +
 +  /**
 +   * This is the entry point for extracting k-best hypotheses. It computes all of them, writing
 +   * the results to the BufferedWriter passed in. If you want intermediate access to the k-best
 +   * derivations, you'll want to call getKthHyp() or getKthDerivation() directly.
 +   * 
 +   * The number of derivations that are looked for is controlled by the `top-n` parameter.
 +   * Note that when `top-n` is set to 0, k-best extraction is disabled entirely, and only things 
 +   * like the viterbi string and the model score are available to the decoder. Since k-best
 +   * extraction involves the recomputation of features to get the component values, turning off
 +   * that extraction saves a lot of time when only the 1-best string is desired.
 +   * 
 +   * @param hg the hypergraph to extract from
 +   * @param topN how many to extract
 +   * @param out object to write to
 +   * @throws IOException if there is an error writing the extraction
 +   */
 +  public void lazyKBestExtractOnHG(HyperGraph hg, int topN, BufferedWriter out) throws IOException {
 +
 +    resetState();
 +
 +    if (null == hg.goalNode)
 +      return;
 +
 +    for (int k = 1; k <= topN; k++) {
 +      String hypStr = getKthHyp(hg.goalNode, k);
 +      if (null == hypStr)
 +        break;
 +
 +      out.write(hypStr);
 +      out.write("\n");
 +      out.flush();
 +    }
 +  }
 +
 +  /**
 +   * This clears the virtualNodesTable, which maintains a list of virtual nodes. This should be
 +   * called in between forest rescorings.
 +   */
 +  public void resetState() {
 +    virtualNodesTable.clear();
 +  }
 +
 +  /**
 +   * Returns the {@link org.apache.joshua.decoder.hypergraph.KBestExtractor.VirtualNode} 
 +   * corresponding to an {@link org.apache.joshua.decoder.hypergraph.HGNode}. 
 +   * If no such VirtualNode exists, it is created.
 +   * 
 +   * @param hgnode from which we wish to create a 
 +   *    {@link org.apache.joshua.decoder.hypergraph.KBestExtractor.VirtualNode}
 +   * @return the corresponding {@link org.apache.joshua.decoder.hypergraph.KBestExtractor.VirtualNode}
 +   */
 +  private VirtualNode getVirtualNode(HGNode hgnode) {
 +    VirtualNode virtualNode = virtualNodesTable.get(hgnode);
 +    if (null == virtualNode) {
 +      virtualNode = new VirtualNode(hgnode);
 +      virtualNodesTable.put(hgnode, virtualNode);
 +    }
 +    return virtualNode;
 +  }
 +
 +  /**
 +   * This class is essentially a wrapper around an HGNode, annotating it with information needed to
 +   * record which hypotheses have been explored from this point. There is one virtual node for
 +   * each HGNode in the underlying hypergraph. This VirtualNode maintains information about the
 +   * k-best derivations from that point on, retaining the derivations computed so far and a priority 
 +   * queue of candidates.
 +   */
 +  private class VirtualNode {
 +
 +    // The node being annotated.
 +    HGNode node = null;
 +
 +    // sorted ArrayList of DerivationState, in the paper is: D(^) [v]
-     public List<DerivationState> nbests = new ArrayList<DerivationState>();
++    public final List<DerivationState> nbests = new ArrayList<>();
 +
 +    // remember frontier states, best-first; in the paper, it is called cand[v]
 +    private PriorityQueue<DerivationState> candHeap = null;
 +
 +    // Remember which DerivationState has been explored (positions in the hypercube). This allows
 +    // us to avoid duplicated states that are reached from different places of expansion, e.g.,
 +    // position (2,2) can be reached be extending (1,2) and (2,1).
 +    private HashSet<DerivationState> derivationTable = null;
 +
 +    // This records unique *strings* at each item, used for unique-nbest-string extraction.
 +    private HashSet<String> uniqueStringsTable = null;
 +
 +    public VirtualNode(HGNode it) {
 +      this.node = it;
 +    }
 +
 +    /**
 +     * This returns a DerivationState corresponding to the kth-best derivation rooted at this node.
 +     * 
 +     * @param kbestExtractor todo
 +     * @param k (indexed from one)
 +     * @return the k-th best (1-indexed) hypothesis, or null if there are no more.
 +     */
 +    // return: the k-th hyp or null; k is started from one
 +    private DerivationState lazyKBestExtractOnNode(KBestExtractor kbestExtractor, int k) {
 +      if (nbests.size() >= k) { // no need to continue
 +        return nbests.get(k - 1);
 +      }
 +
 +      // ### we need to fill in the l_nest in order to get k-th hyp
 +      DerivationState derivationState = null;
 +
 +      /*
 +       * The first time this is called, the heap of candidates (the frontier of the cube) is
 +       * uninitialized. This recursive call will seed the candidates at each node.
 +       */
 +      if (null == candHeap) {
 +        getCandidates(kbestExtractor);
 +      }
 +
 +      /*
 +       * Now build the kbest list by repeatedly popping the best candidate and then placing all
 +       * extensions of that hypothesis back on the candidates list.
 +       */
 +      int tAdded = 0; // sanity check
 +      while (nbests.size() < k) {
 +        if (candHeap.size() > 0) {
 +          derivationState = candHeap.poll();
 +          // derivation_tbl.remove(res.get_signature());//TODO: should remove? note that two state
 +          // may be tied because the cost is the same
 +          if (extractUniqueNbest) {
 +            // We pass false for extract_nbest_tree because we want; to check that the hypothesis
 +            // *strings* are unique, not the trees.
 +            final String res_str = derivationState.getHypothesis();
 +            
 +            if (!uniqueStringsTable.contains(res_str)) {
 +              nbests.add(derivationState);
 +              uniqueStringsTable.add(res_str);
 +            }
 +          } else {
 +            nbests.add(derivationState);
 +          }
 +
 +          // Add all extensions of this hypothesis to the candidates list.
 +          lazyNext(kbestExtractor, derivationState);
 +
 +          // debug: sanity check
 +          tAdded++;
 +          // this is possible only when extracting unique nbest
 +          if (!extractUniqueNbest && tAdded > 1) {
 +            throw new RuntimeException("In lazyKBestExtractOnNode, add more than one time, k is "
 +                + k);
 +          }
 +        } else {
 +          break;
 +        }
 +      }
 +      if (nbests.size() < k) {
 +        derivationState = null;// in case we do not get to the depth of k
 +      }
 +      // debug: sanity check
 +      // if (l_nbest.size() >= k && l_nbest.get(k-1) != res) {
 +      // throw new RuntimeException("In lazy_k_best_extract, ranking is not correct ");
 +      // }
 +
 +      return derivationState;
 +    }
 +
 +    /**
 +     * This function extends the current hypothesis, adding each extended item to the list of
 +     * candidates (assuming they have not been added before). It does this by, in turn, extending
 +     * each of the tail node items.
 +     * 
 +     * @param kbestExtractor
 +     * @param previousState
 +     */
 +    private void lazyNext(KBestExtractor kbestExtractor, DerivationState previousState) {
 +      /* If there are no tail nodes, there is nothing to do. */
 +      if (null == previousState.edge.getTailNodes())
 +        return;
 +
 +      /* For each tail node, create a new state candidate by "sliding" that item one position. */
 +      for (int i = 0; i < previousState.edge.getTailNodes().size(); i++) {
 +        /* Create a new virtual node that is a copy of the current node */
-         HGNode tailNode = (HGNode) previousState.edge.getTailNodes().get(i);
++        HGNode tailNode = previousState.edge.getTailNodes().get(i);
 +        VirtualNode virtualTailNode = kbestExtractor.getVirtualNode(tailNode);
 +        // Copy over the ranks.
 +        int[] newRanks = new int[previousState.ranks.length];
-         for (int c = 0; c < newRanks.length; c++) {
-           newRanks[c] = previousState.ranks[c];
-         }
++        System.arraycopy(previousState.ranks, 0, newRanks, 0, newRanks.length);
 +        // Now increment/slide the current tail node by one
 +        newRanks[i] = previousState.ranks[i] + 1;
 +
 +        // Create a new state so we can see if it's new. The cost will be set below if it is.
 +        DerivationState nextState = new DerivationState(previousState.parentNode,
 +            previousState.edge, newRanks, 0.0f, previousState.edgePos);
 +
 +        // Don't add the state to the list of candidates if it's already been added.
 +        if (!derivationTable.contains(nextState)) {
 +          // Make sure that next candidate exists
 +          virtualTailNode.lazyKBestExtractOnNode(kbestExtractor, newRanks[i]);
 +          // System.err.println(String.format("  newRanks[%d] = %d and tail size %d", i,
 +          // newRanks[i], virtualTailNode.nbests.size()));
 +          if (newRanks[i] <= virtualTailNode.nbests.size()) {
 +            // System.err.println("NODE: " + this.node);
 +            // System.err.println("  tail is " + virtualTailNode.node);
 +            float cost = previousState.getModelCost()
 +                - virtualTailNode.nbests.get(previousState.ranks[i] - 1).getModelCost()
 +                + virtualTailNode.nbests.get(newRanks[i] - 1).getModelCost();
 +            nextState.setCost(cost);
 +
 +            if (joshuaConfiguration.rescoreForest)
 +              nextState.bleu = nextState.computeBLEU();
 +
 +            candHeap.add(nextState);
 +            derivationTable.add(nextState);
 +
 +            // System.err.println(String.format("  LAZYNEXT(%s", nextState));
 +          }
 +        }
 +      }
 +    }
 +
 +    /**
 +     * this is the seeding function, for example, it will get down to the leaf, and sort the
 +     * terminals get a 1best from each hyperedge, and add them into the heap_cands
 +     * 
 +     * @param kbestExtractor
 +     */
 +    private void getCandidates(KBestExtractor kbestExtractor) {
 +      /* The list of candidates extending from this (virtual) node. */
-       candHeap = new PriorityQueue<DerivationState>(11, new DerivationStateComparator());
++      candHeap = new PriorityQueue<>(11, new DerivationStateComparator());
 +
 +      /*
 +       * When exploring the cube frontier, there are multiple paths to each candidate. For example,
 +       * going down 1 from grid position (2,1) is the same as going right 1 from grid position
 +       * (1,2). To avoid adding states more than once, we keep a list of derivation states we have
 +       * already added to the candidates heap.
 +       * 
 +       * TODO: these should really be keyed on the states themselves instead of a string
 +       * representation of them.
 +       */
-       derivationTable = new HashSet<DerivationState>();
++      derivationTable = new HashSet<>();
 +
 +      /*
 +       * A Joshua configuration option allows the decoder to output only unique strings. In that
 +       * case, we keep an list of the frontiers of derivation states extending from this node.
 +       */
 +      if (extractUniqueNbest) {
-         uniqueStringsTable = new HashSet<String>();
++        uniqueStringsTable = new HashSet<>();
 +      }
 +
 +      /*
 +       * Get the single-best derivation along each of the incoming hyperedges, and add the lot of
 +       * them to the priority queue of candidates in the form of DerivationState objects.
 +       * 
 +       * Note that since the hyperedges are not sorted according to score, the first derivation
 +       * computed here may not be the best. But since the loop over all hyperedges seeds the entire
 +       * candidates list with the one-best along each of them, when the candidate heap is polled
 +       * afterwards, we are guaranteed to have the best one.
 +       */
 +      int pos = 0;
 +      for (HyperEdge edge : node.hyperedges) {
 +        DerivationState bestState = getBestDerivation(kbestExtractor, node, edge, pos);
 +        // why duplicate, e.g., 1 2 + 1 0 == 2 1 + 0 1 , but here we should not get duplicate
 +        if (!derivationTable.contains(bestState)) {
 +          candHeap.add(bestState);
 +          derivationTable.add(bestState);
 +        } else { // sanity check
 +          throw new RuntimeException(
 +              "get duplicate derivation in get_candidates, this should not happen"
 +                  + "\nsignature is " + bestState + "\nl_hyperedge size is "
 +                  + node.hyperedges.size());
 +        }
 +        pos++;
 +      }
 +
 +      // TODO: if tem.size is too large, this may cause unnecessary computation, we comment the
 +      // segment to accommodate the unique nbest extraction
 +      /*
 +       * if(tem.size()>global_n){ heap_cands=new PriorityQueue<DerivationState>(new DerivationStateComparator()); for(int i=1;
 +       * i<=global_n; i++) heap_cands.add(tem.poll()); }else heap_cands=tem;
 +       */
 +    }
 +
 +    // get my best derivation, and recursively add 1best for all my children, used by get_candidates
 +    // only
 +    /**
 +     * This computes the best derivation along a particular hyperedge. It is only called by
 +     * getCandidates() to initialize the candidates priority queue at each (virtual) node.
 +     * 
 +     * @param kbestExtractor
 +     * @param parentNode
 +     * @param hyperEdge
 +     * @param edgePos
 +     * @return an object representing the best derivation from this node
 +     */
 +    private DerivationState getBestDerivation(KBestExtractor kbestExtractor, HGNode parentNode,
 +        HyperEdge hyperEdge, int edgePos) {
 +      int[] ranks;
 +      float cost = 0.0f;
 +
 +      /*
 +       * There are two cases: (1) leaf nodes and (2) internal nodes. A leaf node is represented by a
 +       * hyperedge with no tail nodes.
 +       */
 +      if (hyperEdge.getTailNodes() == null) {
 +        ranks = null;
 +
 +      } else {
 +        // "ranks" records which derivation to take at each of the tail nodes. Ranks are 1-indexed.
 +        ranks = new int[hyperEdge.getTailNodes().size()];
 +
 +        /* Initialize the one-best at each tail node. */
 +        for (int i = 0; i < hyperEdge.getTailNodes().size(); i++) { // children is ready
 +          ranks[i] = 1;
 +          VirtualNode childVirtualNode = kbestExtractor.getVirtualNode(hyperEdge.getTailNodes()
 +              .get(i));
 +          // recurse
 +          childVirtualNode.lazyKBestExtractOnNode(kbestExtractor, ranks[i]);
 +        }
 +      }
-       cost = (float) hyperEdge.getBestDerivationScore();
++      cost = hyperEdge.getBestDerivationScore();
 +
 +      DerivationState state = new DerivationState(parentNode, hyperEdge, ranks, cost, edgePos);
 +      if (joshuaConfiguration.rescoreForest)
 +        state.bleu = state.computeBLEU();
 +
 +      return state;
 +    }
-   };
++  }
 +
 +  /**
 +   * A DerivationState describes which path to follow through the hypergraph. For example, it
 +   * might say to use the 1-best from the first tail node, the 9th-best from the second tail node,
 +   * and so on. This information is represented recursively through a chain of DerivationState
 +   * objects. This function follows that chain, extracting the information according to a number
 +   * of parameters, and returning results to a string, and also (optionally) accumulating the
 +   * feature values into the passed-in FeatureVector.
 +   */
 +
 +  // each DerivationState roughly corresponds to a hypothesis
 +  public class DerivationState {
 +    /* The edge ("e" in the paper) */
-     public HyperEdge edge;
++    public final HyperEdge edge;
 +
 +    /* The edge's parent node */
-     public HGNode parentNode;
++    public final HGNode parentNode;
 +
 +    /*
 +     * This state's position in its parent node's list of incoming hyperedges (used in signature
 +     * calculation)
 +     */
-     public int edgePos;
++    public final int edgePos;
 +
 +    /*
 +     * The rank item to select from each of the incoming tail nodes ("j" in the paper, an ArrayList
 +     * of size |e|)
 +     */
-     public int[] ranks;
++    public final int[] ranks;
 +
 +    /*
 +     * The cost of the hypothesis, including a weighted BLEU score, if any.
 +     */
 +    private float cost;
 +
 +    private float bleu = 0.0f;
 +
 +    /*
 +     * The BLEU sufficient statistics associated with the edge's derivation. Note that this is a
 +     * function of the complete derivation headed by the edge, i.e., all the particular
 +     * subderivations of edges beneath it. That is why it must be contained in DerivationState
 +     * instead of in the HyperEdge itself.
 +     */
 +    BLEU.Stats stats = null;
 +
 +    public DerivationState(HGNode pa, HyperEdge e, int[] r, float c, int pos) {
 +      parentNode = pa;
 +      edge = e;
 +      ranks = r;
 +      cost = c;
 +      edgePos = pos;
 +      bleu = 0.0f;
 +    }
 +
 +    /**
 +     * Computes a scaled approximate BLEU from the accumulated statistics. We know the number of
 +     * words; to compute the effective reference length, we take the real reference length statistic
 +     * and scale it by the percentage of the input sentence that is consumed, based on the
 +     * assumption that the total number of words in the hypothesis scales linearly with the input
 +     * sentence span.
 +     * 
 +     * @return float representing {@link org.apache.joshua.decoder.BLEU} score
 +     */
 +    public float computeBLEU() {
 +      if (stats == null) {
 +        float percentage = 1.0f * (parentNode.j - parentNode.i) / (sentence.length());
 +        // System.err.println(String.format("computeBLEU: (%d - %d) / %d = %f", parentNode.j,
 +        // parentNode.i, sentence.length(), percentage));
 +        stats = BLEU.compute(edge, percentage, references);
 +
 +        if (edge.getTailNodes() != null) {
 +          for (int id = 0; id < edge.getTailNodes().size(); id++) {
 +            stats.add(getChildDerivationState(edge, id).stats);
 +          }
 +        }
 +      }
 +
 +      return BLEU.score(stats);
 +    }
 +
 +    public void setCost(float cost2) {
 +      this.cost = cost2;
 +    }
 +
 +    /**
 +     * Returns the model cost. This is obtained by subtracting off the incorporated BLEU score (if
 +     * used).
 +     * 
 +     * @return float representing model cost
 +     */
 +    public float getModelCost() {
 +      return this.cost;
 +    }
 +
 +    /**
 +     * Returns the model cost plus the BLEU score.
 +     * 
 +     * @return float representing model cost plus the BLEU score
 +     */
 +    public float getCost() {
 +      return cost - weights.getOrDefault(hashFeature("BLEU")) * bleu;
 +    }
 +
 +    public String toString() {
 +      StringBuilder sb = new StringBuilder(String.format("DS[[ %s (%d,%d)/%d ||| ",
 +          Vocabulary.word(parentNode.lhs), parentNode.i, parentNode.j, edgePos));
 +      sb.append("ranks=[ ");
 +      if (ranks != null)
-         for (int i = 0; i < ranks.length; i++)
-           sb.append(ranks[i] + " ");
-       sb.append("] ||| " + String.format("%.5f ]]", cost));
++        for (int rank : ranks)
++          sb.append(rank + " ");
++      sb.append("] ||| ").append(String.format("%.5f ]]", cost));
 +      return sb.toString();
 +    }
 +
 +    public boolean equals(Object other) {
 +      if (other instanceof DerivationState) {
 +        DerivationState that = (DerivationState) other;
 +        if (edgePos == that.edgePos) {
 +          if (ranks != null && that.ranks != null) {
 +            if (ranks.length == that.ranks.length) {
 +              for (int i = 0; i < ranks.length; i++)
 +                if (ranks[i] != that.ranks[i])
 +                  return false;
 +              return true;
 +            }
 +          }
 +        }
 +      }
 +
 +      return false;
 +    }
 +
 +    /**
 +     * DerivationState objects are unique to each VirtualNode, so the unique identifying information
 +     * only need contain the edge position and the ranks.
 +     * @return hashof the edge position and ranks
 +     */
 +    public int hashCode() {
 +      int hash = edgePos;
 +      if (ranks != null) {
 +        for (int i = 0; i < ranks.length; i++)
 +          hash = hash * 53 + i;
 +      }
 +
 +      return hash;
 +    }
 +
 +    /**
 +     * Visits every state in the derivation in a depth-first order.
 +     * @param visitor todo
 +     * @return todo
 +     */
 +    private DerivationVisitor visit(DerivationVisitor visitor) {
 +      return visit(visitor, 0, 0);
 +    }
 +
 +    private DerivationVisitor visit(DerivationVisitor visitor, int indent, int tailNodeIndex) {
 +
 +      visitor.before(this, indent, tailNodeIndex);
 +
 +      final Rule rule = edge.getRule();
 +      final List<HGNode> tailNodes = edge.getTailNodes();
 +
 +      if (rule == null) {
 +        getChildDerivationState(edge, 0).visit(visitor, indent + 1, 0);
 +      } else {
 +        if (tailNodes != null) {
 +          for (int index = 0; index < tailNodes.size(); index++) {
 +            getChildDerivationState(edge, index).visit(visitor, indent + 1, index);
 +          }
 +        }
 +      }
 +
 +      visitor.after(this, indent, tailNodeIndex);
 +
 +      return visitor;
 +    }
 +    
 +    public String getWordAlignment() {
 +      return visit(new WordAlignmentExtractor()).toString();
 +    }
 +    
 +    public List<List<Integer>> getWordAlignmentList() {
 +      final WordAlignmentExtractor visitor = new WordAlignmentExtractor();
 +      visit(visitor);
 +      return visitor.getFinalWordAlignments();
 +    }
 +
 +    public String getTree() {
 +      return visit(new TreeExtractor()).toString();
 +    }
 +    
 +    public String getHypothesis() {
 +      return getHypothesis(defaultSide);
 +    }
 +
 +    private String getHypothesis(final Side side) {
 +      return visit(new OutputStringExtractor(side.equals(Side.SOURCE))).toString();
 +    }
 +
 +    public FeatureVector getFeatures() {
 +      final FeatureVectorExtractor extractor = new FeatureVectorExtractor(featureFunctions, sentence);
 +      visit(extractor);
 +      return extractor.getFeatures();
 +    }
 +
 +    public String getDerivation() {
 +      return visit(new DerivationExtractor()).toString();
 +    }
 +
 +    /**
 +     * Helper function for navigating the hierarchical list of DerivationState objects. This
 +     * function looks up the VirtualNode corresponding to the HGNode pointed to by the edge's
 +     * {tailNodeIndex}th tail node.
 +     * 
 +     * @param edge todo
 +     * @param tailNodeIndex todo
 +     * @return todo
 +     */
 +    public DerivationState getChildDerivationState(HyperEdge edge, int tailNodeIndex) {
 +      HGNode child = edge.getTailNodes().get(tailNodeIndex);
 +      VirtualNode virtualChild = getVirtualNode(child);
 +      return virtualChild.nbests.get(ranks[tailNodeIndex] - 1);
 +    }
 +
 +  } // end of Class DerivationState
 +
 +  public static class DerivationStateComparator implements Comparator<DerivationState> {
 +    // natural order by cost
 +    public int compare(DerivationState one, DerivationState another) {
 +      if (one.getCost() > another.getCost()) {
 +        return -1;
 +      } else if (one.getCost() == another.getCost()) {
 +        return 0;
 +      } else {
 +        return 1;
 +      }
 +    }
 +  }
 +
 +  /**
 +   * This interface provides a generic way to do things at each stage of a derivation. The
 +   * DerivationState::visit() function visits every node in a derivation and calls the
 +   * DerivationVisitor functions both before and after it visits each node. This provides a common
 +   * way to do different things to the tree (e.g., extract its words, assemble a derivation, and so
 +   * on) without having to rewrite the node-visiting code.
 +   * 
 +   * @author Matt Post post@cs.jhu.edu
 +   */
 +  public interface DerivationVisitor {
 +    /**
 +     * Called before each node's children are visited.
 +     *
 +     * @param state the derivation state
 +     * @param level the tree depth
 +     * @param tailNodeIndex the tailNodeIndex corresponding to state
 +     */
 +    void before(DerivationState state, int level, int tailNodeIndex);
 +
 +    /**
 +     * Called after a node's children have been visited.
 +     * 
 +     * @param state the derivation state
 +     * @param level the tree depth
 +     * @param tailNodeIndex the tailNodeIndex corresponding to state
 +     */
 +    void after(DerivationState state, int level, int tailNodeIndex);
 +  }
 +  
 +  /**
 +   * Assembles a Penn treebank format tree for a given derivation.
 +   */
 +  public class TreeExtractor implements DerivationVisitor {
 +
 +    /* The tree being built. */
 +    private Tree tree;
 +
 +    public TreeExtractor() {
 +      tree = null;
 +    }
 +
 +    /**
 +     * Before visiting the children, find the fragment representation for the current rule,
 +     * and merge it into the tree we're building.
 +     */
 +    @Override
 +    public void before(DerivationState state, int indent, int tailNodeIndex) {
 +      HyperEdge edge = state.edge;
 +      Rule rule = edge.getRule();
 +
 +      // Skip the special top-level rule
 +      if (rule == null) {
 +        return;
 +      }
 +
 +      String lhs = Vocabulary.word(rule.getLHS());
 +      String unbracketedLHS = lhs.substring(1, lhs.length() - 1);
 +
 +      /* Find the fragment corresponding to this flattened rule in the fragment map; if it's not
 +       * there, just pretend it's a depth-one rule.
 +       */
 +      Tree fragment = Tree.getFragmentFromYield(rule.getTargetWords());
 +      if (fragment == null) {
 +        String subtree = String.format("(%s{%d-%d} %s)", unbracketedLHS, 
 +            state.parentNode.i, state.parentNode.j, 
 +            quoteTerminals(rule.getTargetWords()));
 +        fragment = Tree.fromString(subtree);
 +      }
 +      
 +      merge(fragment);
 +    }
 +
 +    /**
 +     * Quotes just the terminals in the yield of a tree, represented as a string. This is to force
 +     * compliance with the Tree class, which interprets all non-quoted strings as nonterminals. 
 +     * 
 +     * @param words a string of words representing a rule's yield
 +     * @return
 +     */
 +    private String quoteTerminals(String words) {
 +      StringBuilder quotedWords = new StringBuilder();
 +      for (String word: words.split("\\s+"))
 +        if (word.startsWith("[") && word.endsWith("]"))
 +          quotedWords.append(String.format("%s ", word));
 +        else
 +        quotedWords.append(String.format("\"%s\" ", word));
 +
 +      return quotedWords.substring(0, quotedWords.length() - 1);
 +    }
 +
 +    @Override
 +    public void after(DerivationState state, int indent, int tailNodeIndex) {
 +      // do nothing
 +    }
 +
 +    public String toString() {
 +      return tree.unquotedString();
 +    }
 +
 +    /**
 +     * Either set the root of the tree or merge this tree by grafting it onto the first nonterminal
 +     * in the yield of the parent tree.
 +     * 
 +     * @param fragment
 +     */
 +    private void merge(Tree fragment) {
 +      if (tree == null) {
 +        tree = fragment;
 +      } else {
 +        Tree parent = tree.getNonterminalYield().get(0);
 +        parent.setLabel(Vocabulary.word(fragment.getLabel()));
 +        parent.setChildren(fragment.getChildren());
 +      }
 +    }
 +  }
 +
 +  /**
 +   * Assembles an informative version of the derivation. Each rule is printed as it is encountered.
 +   * Don't try to parse this output; make something that writes out JSON or something, instead.
 +   * 
 +   * @author Matt Post post@cs.jhu.edu
 +   */
 +  public class DerivationExtractor implements DerivationVisitor {
 +
-     StringBuffer sb;
++    final StringBuffer sb;
 +
 +    public DerivationExtractor() {
 +      sb = new StringBuffer();
 +    }
 +
 +    @Override
 +    public void before(DerivationState state, int indent, int tailNodeIndex) {
 +
 +      HyperEdge edge = state.edge;
 +      Rule rule = edge.getRule();
 +
 +      if (rule != null) {
 +
 +        for (int i = 0; i < indent * 2; i++)
 +          sb.append(" ");
 +
 +        final FeatureVectorExtractor extractor = new FeatureVectorExtractor(featureFunctions, sentence);
 +        extractor.before(state, indent, tailNodeIndex);
 +        final FeatureVector transitionFeatures = extractor.getFeatures();
 +
 +        // sb.append(rule).append(" ||| " + features + " ||| " +
 +        // KBestExtractor.this.weights.innerProduct(features));
 +        sb.append(String.format("%d-%d", state.parentNode.i, state.parentNode.j));
 +        sb.append(" ||| " + Vocabulary.word(rule.getLHS()) + " -> "
 +            + Vocabulary.getWords(rule.getSource()) + " /// " + rule.getTargetWords());
 +        sb.append(" |||");
 +        for (DPState dpState : state.parentNode.getDPStates()) {
-           sb.append(" " + dpState);
++          sb.append(" ").append(dpState);
 +        }
-         sb.append(" ||| " + transitionFeatures.textFormat());
-         sb.append(" ||| " + weights.innerProduct(transitionFeatures));
++        sb.append(" ||| ").append(transitionFeatures);
++        sb.append(" ||| ").append(weights.innerProduct(transitionFeatures));
 +        if (rule.getAlignment() != null)
-           sb.append(" ||| " + Arrays.toString(rule.getAlignment()));
-         sb.append(" ||| " + OwnerMap.getOwner(rule.getOwner()));
++          sb.append(" ||| ").append(Arrays.toString(rule.getAlignment()));
 +        sb.append("\n");
 +      }
 +    }
 +
 +    public String toString() {
 +      return sb.toString();
 +    }
 +
 +    @Override
 +    public void after(DerivationState state, int level, int tailNodeIndex) {}
 +  }
 +  
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/OutputStringExtractor.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/OutputStringExtractor.java
index 1f5bb6b,0000000..9a59e3c
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/OutputStringExtractor.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/OutputStringExtractor.java
@@@ -1,195 -1,0 +1,195 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import static java.lang.Math.min;
 +import static org.apache.joshua.corpus.Vocabulary.getWords;
 +
 +import java.util.Stack;
 +
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationState;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationVisitor;
 +import org.apache.joshua.util.FormatUtils;
 +
 +public class OutputStringExtractor implements WalkerFunction, DerivationVisitor {
 +  
 +  public OutputStringExtractor(final boolean extractSource) {
 +    this.extractSource = extractSource;
 +  }
 +  
-   private Stack<OutputString> outputStringStack = new Stack<>();
++  private final Stack<OutputString> outputStringStack = new Stack<>();
 +  private final boolean extractSource;
 +
 +  @Override
 +  public void apply(HGNode node, int nodeIndex) {
 +    apply(node.bestHyperedge.getRule(), nodeIndex);
 +  }
 +  
 +  /**
 +   * Visiting a node during k-best extraction is the same as
 +   * apply() for Viterbi extraction but using the edge from
 +   * the Derivation state.
 +   */
 +  @Override
 +  public void before(final DerivationState state, int level, int tailNodeIndex) {
 +      apply(state.edge.getRule(), tailNodeIndex);
 +  }
 +  
 +  private void apply(Rule rule, int nodeIndex) {
 +    if (rule != null) {
 +      final int[] words = extractSource ? rule.getSource() : rule.getTarget();
 +      merge(new OutputString(words, rule.getArity(), nodeIndex));
 +    }
 +  }
 +  
 +  /** Nothing to do */
 +  @Override
 +  public void after(DerivationState state, int level, int tailNodeIndex) {}
 +  
 +  private static int getSourceNonTerminalPosition(final int[] words, int nonTerminalIndex) {
 +    int nonTerminalsSeen = 0;
 +    for (int i = 0; i < words.length; i++) {
 +      if (FormatUtils.isNonterminal(words[i])) {
 +        nonTerminalsSeen++;
 +        if (nonTerminalsSeen == nonTerminalIndex) {
 +          return i;
 +        }
 +      }
 +    }
 +    throw new RuntimeException(
 +        String.format(
 +            "Can not find %s-th non terminal in source ids: %s. This should not happen!",
 +            nonTerminalIndex,
 +            arrayToString(words)));
 +  }
 +  
 +  /**
 +   * Returns the position of the nonTerminalIndex-th nonTerminal words.
 +   * Non-terminals on target sides of rules are indexed by
 +   * their order on the source side, e.g. '-1', '-2',
 +   * Thus, if index==0 we return the index of '-1'.
 +   * For index==1, we return index of '-2'
 +   */
 +  private static int getTargetNonTerminalPosition(int[] words, int nonTerminalIndex) {
 +    for (int pos = 0; pos < words.length; pos++) {
 +      if (FormatUtils.isNonterminal(words[pos]) && -(words[pos] + 1) == nonTerminalIndex) {
 +        return pos;
 +      }
 +    }
 +    throw new RuntimeException(
 +        String.format(
 +            "Can not find %s-th non terminal in target ids: %s. This should not happen!",
 +            nonTerminalIndex,
 +            arrayToString(words)));
 +  }
 +  
 +  private static String arrayToString(int[] ids) {
 +    StringBuilder sb = new StringBuilder();
 +    for (int i : ids) {
-       sb.append(i + " ");
++      sb.append(i).append(" ");
 +    }
 +    return sb.toString().trim();
 +  }
 +  
 +  private void substituteNonTerminal(
 +      final OutputString parentState,
 +      final OutputString childState) {
 +    int mergePosition;
 +    if (extractSource) {
 +      /* correct nonTerminal is given by the tailNodePosition of the childState (zero-index, thus +1) and 
 +       * current parentState's arity. If the parentState has already filled one of two available slots,
 +       * we need to use the remaining one, even if childState refers to the second slot.
 +       */
 +       mergePosition = getSourceNonTerminalPosition(
 +          parentState.words, min(childState.tailNodePosition + 1, parentState.arity));
 +    } else {
 +      mergePosition = getTargetNonTerminalPosition(
 +          parentState.words, childState.tailNodePosition);
 +    }
 +    parentState.substituteNonTerminalAtPosition(childState.words, mergePosition);
 +  }
 +
 +  private void merge(final OutputString state) {
 +    if (!outputStringStack.isEmpty()
 +        && state.arity == 0) {
 +      if (outputStringStack.peek().arity == 0) {
 +          throw new IllegalStateException("Parent OutputString has arity of 0. Cannot merge.");
 +      }
 +      final OutputString parent = outputStringStack.pop();
 +      substituteNonTerminal(parent, state);
 +      merge(parent);
 +    } else {
 +      outputStringStack.add(state);
 +    }
 +  }
 +  
 +  @Override
 +  public String toString() {
 +    if (outputStringStack.isEmpty()) {
 +      return "";
 +    }
 +    
 +    if (outputStringStack.size() != 1) {
 +      throw new IllegalStateException(
 +          String.format(
 +              "Stack should contain only a single (last) element, but was size %d", outputStringStack.size()));
 +    }
 +    return getWords(outputStringStack.pop().words);
 +  }
 +  
 +  /** Stores necessary information to obtain an output string on source or target side */
 +  private class OutputString {
 +    
 +    private int[] words;
 +    private int arity;
 +    private final int tailNodePosition;
 +    
 +    private OutputString(int[] words, int arity, int tailNodePosition) {
 +      this.words = words;
 +      this.arity = arity;
 +      this.tailNodePosition = tailNodePosition;
 +    }
 +    
 +    /**
 +     * Merges child words into this at the correct
 +     * non terminal position of this.
 +     * The correct position is determined by the tailNodePosition
 +     * of child and the arity of this.
 +     */
 +    private void substituteNonTerminalAtPosition(final int[] words, final int position) {
 +      assert(FormatUtils.isNonterminal(this.words[position]));
 +      final int[] result = new int[words.length + this.words.length - 1];
 +      int resultIndex = 0;
 +      for (int i = 0; i < position; i++) {
 +        result[resultIndex++] = this.words[i];
 +      }
-       for (int i = 0; i < words.length; i++) {
-         result[resultIndex++] = words[i];
++      for (int word : words) {
++        result[resultIndex++] = word;
 +      }
 +      for (int i = position + 1; i < this.words.length; i++) {
 +        result[resultIndex++] = this.words[i];
 +      }
 +      // update words and reduce arity of this OutputString
 +      this.words = result;
 +      arity--;
 +    }
 +  }
 +  
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/StringToTreeConverter.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/StringToTreeConverter.java
index f393a01,0000000..d71cba6
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/StringToTreeConverter.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/StringToTreeConverter.java
@@@ -1,74 -1,0 +1,78 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import java.util.Stack;
 +
 +// example: (ROOT ([S] ([X] ([X] scientists completed ([X] for ([X] ([X] chromosome) related to ([X]
 +// early ([X] OOV))))) sequencing)))
 +
 +public class StringToTreeConverter {
 +
 +  static private final String beginSymbol = "(b";
 +  static private final String nodeSymbol = "node";
 +
 +  HyperGraph convert(String inputStr) {
 +
 +    HyperGraph tree = null;
 +
-     Stack<String> stack = new Stack<String>();
++    Stack<String> stack = new Stack<>();
 +    for (int i = 0; i < inputStr.length(); i++) {
 +      char curChar = inputStr.charAt(i);
 +
 +      if (curChar == ')' && inputStr.charAt(i - 1) != ' ') {// end of a rule
 +        StringBuffer ruleString = new StringBuffer();
 +
++        label:
 +        while (stack.empty() == false) {
 +          String cur = stack.pop();
-           if (cur.equals(beginSymbol)) {// stop
++          switch (cur) {
++          case beginSymbol: // stop
 +            // setup a node
 +            // HGNode(int i, int j, int lhs, HashMap<Integer,DPState> dpStates, HyperEdge
 +            // initHyperedge, double estTotalLogP)
 +            // public HyperEdge(Rule rule, double bestDerivationLogP, Double transitionLogP,
 +            // List<HGNode> antNodes, SourcePath srcPath)
 +            // public Rule(int lhs, int[] sourceRhs, int[] targetRhs, float[]
 +            // featureScores, int arity, int owner, float latticeCost, int ruleID)
 +
- 
 +            stack.add(nodeSymbol);// TODO: should be lHS+id
-             break;
-           } else if (cur.equals(nodeSymbol)) {
 +
-           } else {
++            break label;
++          case nodeSymbol:
++
++            break;
++          default:
 +            ruleString.append(cur);
++            break;
 +          }
 +        }
 +      } else if (curChar == '(' && inputStr.charAt(i + 1) != ' ') {// begin of a rule
 +        stack.add(beginSymbol);
 +      } else {
 +        stack.add("" + curChar);
 +      }
 +    }
 +
 +
 +
 +    return tree;
 +  }
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ViterbiExtractor.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ViterbiExtractor.java
index 7cf7dc1,0000000..8df12b7
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ViterbiExtractor.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/ViterbiExtractor.java
@@@ -1,179 -1,0 +1,177 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import static java.util.Collections.emptyList;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import org.apache.joshua.decoder.ff.FeatureFunction;
 +import org.apache.joshua.decoder.ff.FeatureVector;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + * @author Zhifei Li, zhifei.work@gmail.com
 + * @author Matt Post post@cs.jhu.edu
 + */
 +
 +public class ViterbiExtractor {
 +
 +  /**
 +   * This function recursively visits the nodes of the Viterbi derivation in a depth-first
 +   * traversal, applying the walker to each of the nodes. It provides a more general framework for
 +   * implementing operations on a tree.
 +   * 
 +   * @param node the node to start viterbi traversal from
 +   * @param walker an implementation of the WalkerFunction interface, to be applied to each node in
 +   *        the tree
 +   * @param nodeIndex the tail node index of the given node. This allows implementations of the
 +   *        WalkerFunction to associate nonTerminals with the index of node in the outgoing edges
 +   *        list of tail nodes.
 +   */
 +  public static void viterbiWalk(
 +      final HGNode node,
 +      final WalkerFunction walker,
 +      final int nodeIndex) {
 +    // apply the walking function to the node
 +    walker.apply(node, nodeIndex);
 +    // recurse on the anterior nodes of the best hyperedge in source order
 +    final HyperEdge bestEdge = node.bestHyperedge;
 +    final List<HGNode> tailNodes = bestEdge.getTailNodes();
 +    if (tailNodes != null) {
 +      for (int tailNodeIndex = 0; tailNodeIndex < tailNodes.size(); tailNodeIndex++) {
 +        viterbiWalk(tailNodes.get(tailNodeIndex), walker, tailNodeIndex);
 +      }
 +    }
 +  }
 +
 +  public static void viterbiWalk(final HGNode node, final WalkerFunction walker) {
 +    viterbiWalk(node, walker, 0);
 +  }
 +
 +  /**
 +   * Returns the Viterbi translation of the Hypergraph (includes sentence markers)
 +   * @param hg a {@link org.apache.joshua.decoder.hypergraph.HyperGraph} we wish to 
 +   * obtain a Viterbi translation for
 +   * @return a String Viterbi translation
 +   */
 +  public static String getViterbiString(final HyperGraph hg) {
 +    if (hg == null)
 +      return "";
 +
 +    final WalkerFunction viterbiOutputStringWalker = new OutputStringExtractor(false);
 +    viterbiWalk(hg.goalNode, viterbiOutputStringWalker);
 +    return viterbiOutputStringWalker.toString();
 +  }
 +
 +  /**
 +   * Returns the Viterbi feature vector
 +   * @param hg a {@link org.apache.joshua.decoder.hypergraph.HyperGraph} we wish to 
 +   * obtain a Viterbi features for
 +   * @param featureFunctions a {@link java.util.List} of {@link org.apache.joshua.decoder.ff.FeatureFunction}'s
 +   * @param sentence {@link org.apache.joshua.lattice.Lattice} input
 +   * @return a Viterbi {@link org.apache.joshua.decoder.ff.FeatureVector}
 +   */
 +  public static FeatureVector getViterbiFeatures(
 +      final HyperGraph hg,
 +      final List<FeatureFunction> featureFunctions,
 +      final Sentence sentence) {
 +    if (hg == null) {
 +      return new FeatureVector(0);
 +    }
 +
 +    final FeatureVectorExtractor extractor = new FeatureVectorExtractor(
 +        featureFunctions, sentence);
 +    viterbiWalk(hg.goalNode, extractor);
 +    return extractor.getFeatures();
 +  }
 +
 +  /**
 +   * Returns the Viterbi Word Alignments as String.
 +   * @param hg input {@link org.apache.joshua.decoder.hypergraph.HyperGraph}
 +   * @return the Viterbi Word Alignments as String
 +   */
 +  public static String getViterbiWordAlignments(final HyperGraph hg) {
 +    if (hg == null)
 +      return "";
 +
 +    final WordAlignmentExtractor wordAlignmentWalker = new WordAlignmentExtractor();
 +    viterbiWalk(hg.goalNode, wordAlignmentWalker);
 +    return wordAlignmentWalker.toString();
 +  }
 +
 +  /**
 +   * Returns the Viterbi Word Alignments as list of lists (target-side).
 +   * @param hg input {@link org.apache.joshua.decoder.hypergraph.HyperGraph}
 +   * @return a {@link java.util.List} of Viterbi Word Alignments
 +   */
 +  public static List<List<Integer>> getViterbiWordAlignmentList(final HyperGraph hg) {
 +    if (hg == null)
 +      return emptyList();
 +
 +    final WordAlignmentExtractor wordAlignmentWalker = new WordAlignmentExtractor();
 +    viterbiWalk(hg.goalNode, wordAlignmentWalker);
 +    return wordAlignmentWalker.getFinalWordAlignments();
 +  }
 +
 +  /**
 +   * find 1best hypergraph 
 +   * @param hg_in input {@link org.apache.joshua.decoder.hypergraph.HyperGraph}
 +   * @return new best {@link org.apache.joshua.decoder.hypergraph.HyperGraph}
 +   */
 +  public static HyperGraph getViterbiTreeHG(HyperGraph hg_in) {
 +    HyperGraph res =
 +        new HyperGraph(cloneNodeWithBestHyperedge(hg_in.goalNode), -1, -1, null); 
 +    // TODO: number of items/deductions
 +    get1bestTreeNode(res.goalNode);
 +    return res;
 +  }
 +
 +  private static void get1bestTreeNode(HGNode it) {
 +    HyperEdge dt = it.bestHyperedge;
 +    if (null != dt.getTailNodes()) {
 +      for (int i = 0; i < dt.getTailNodes().size(); i++) {
 +        HGNode antNode = dt.getTailNodes().get(i);
 +        HGNode newNode = cloneNodeWithBestHyperedge(antNode);
 +        dt.getTailNodes().set(i, newNode);
 +        get1bestTreeNode(newNode);
 +      }
 +    }
 +  }
 +
 +  // TODO: tbl_states
 +  private static HGNode cloneNodeWithBestHyperedge(HGNode inNode) {
-     List<HyperEdge> hyperedges = new ArrayList<HyperEdge>(1);
++    List<HyperEdge> hyperedges = new ArrayList<>(1);
 +    HyperEdge cloneEdge = cloneHyperedge(inNode.bestHyperedge);
 +    hyperedges.add(cloneEdge);
 +    return new HGNode(inNode.i, inNode.j, inNode.lhs, hyperedges, cloneEdge, inNode.getDPStates());
 +  }
 +
 +
 +  private static HyperEdge cloneHyperedge(HyperEdge inEdge) {
 +    List<HGNode> antNodes = null;
 +    if (null != inEdge.getTailNodes()) {
-       antNodes = new ArrayList<HGNode>(inEdge.getTailNodes());// l_ant_items will be changed in
++      antNodes = new ArrayList<>(inEdge.getTailNodes());// l_ant_items will be changed in
 +      // get_1best_tree_item
 +    }
-     HyperEdge res =
-         new HyperEdge(inEdge.getRule(), inEdge.getBestDerivationScore(), inEdge.getTransitionLogP(false),
-             antNodes, inEdge.getSourcePath());
-     return res;
++    return new HyperEdge(inEdge.getRule(), inEdge.getBestDerivationScore(), inEdge.getTransitionLogP(false),
++        antNodes, inEdge.getSourcePath());
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentExtractor.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentExtractor.java
index 04d0897,0000000..c949699
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentExtractor.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentExtractor.java
@@@ -1,134 -1,0 +1,134 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import static java.util.Collections.emptyList;
 +
 +import java.util.List;
 +import java.util.Stack;
 +
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationState;
 +import org.apache.joshua.decoder.hypergraph.KBestExtractor.DerivationVisitor;
 +
 +/**
 + * This class enables extraction of word-level alignments from hypotheses.
 + * It implements two interfaces, WalkerFunction and DerivationVisitor.
 + * The former is for using the Viterbi walk function, the latter is for
 + * k-best extraction.
 + * Intermediate WordAlignmentStates are placed on a stack and/or merged down
 + * if possible.
 + * @author fhieber
 + */
 +public class WordAlignmentExtractor implements WalkerFunction, DerivationVisitor {
 +  
-   private final Stack<WordAlignmentState> stack = new Stack<WordAlignmentState>();
++  private final Stack<WordAlignmentState> stack = new Stack<>();
 +
 +  /**
 +   * Merges a state with the top of the stack if applicable or places it on top of the stack.
 +   */
 +  private void merge(final WordAlignmentState state) {
 +    // if alignment state has no NTs left AND stack is not empty
 +    // and parent state on stack still needs something to substitute
 +    if (!stack.isEmpty()
 +        && state.isComplete()) {
 +      final WordAlignmentState parentState = stack.pop();
 +      if (parentState.isComplete()) {
 +          throw new IllegalStateException("Parent state already complete");
 +      }
 +      parentState.substituteIn(state);
 +      merge(parentState);
 +    } else {
 +      stack.add(state);
 +    }
 +  }
 +  
 +  /**
 +   * Common entry point for WalkerFunction and DerivationVisitor.
 +   */
 +  private void extract(final Rule rule, final int spanStart) {
 +    if (rule != null) {
 +      merge(new WordAlignmentState(rule, spanStart));
 +    }
 +  }
 +  
 +  /**
 +   * entry for Viterbi walker. Calls word alignment extraction
 +   * for best hyperedge from given node.
 +   */
 +  @Override
 +  public void apply(HGNode node, int nodeIndex) {
 +    extract(node.bestHyperedge.getRule(), node.i);
 +  }
 +  
 +  /**
 +   * Visiting a node during k-best extraction is the same as
 +   * apply() for Viterbi extraction but using the edge from
 +   * the Derivation state.
 +   */
 +  @Override
 +  public void before(final DerivationState state, final int level, int tailNodeIndex) {
 +    extract(state.edge.getRule(), state.parentNode.i);
 +  }
 +
 +  /**
 +   * Nothing to do after visiting a node.
 +   */
 +  @Override
 +  public void after(final DerivationState state, final int level, int tailNodeIndex) {}
 +  
 +  /**
 +   * Final word alignment without sentence markers
 +   * or empty list if stack is empty.
 +   * @return a final alignment list
 +   */
 +  public List<List<Integer>> getFinalWordAlignments() {
 +    if (stack.isEmpty()) {
 +      return emptyList();
 +    }
 +    
 +    if (stack.size() != 1) {
 +      throw new RuntimeException(
 +          String.format(
 +              "Stack of WordAlignmentExtractor should contain only a single (last) element, but was size %d", stack.size()));
 +    }
 +    
 +    return stack.peek().toFinalList();
 +  }
 +  
 +  /**
 +   * Returns a String representation of the (final) word alignment
 +   * state on top of the stack.
 +   * Empty string for empty stack.
 +   */
 +  @Override
 +  public String toString() {
 +    if (stack.isEmpty()) {
 +      return "";
 +    }
 +    
 +    if (stack.size() != 1) {
 +      throw new RuntimeException(
 +          String.format(
 +              "Stack of WordAlignmentExtractor should contain only a single (last) element, but was size %d", stack.size()));
 +    }
 +    
 +    return stack.peek().toFinalString();
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentState.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentState.java
index 4b8c9e4,0000000..0f0cb1a
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentState.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/hypergraph/WordAlignmentState.java
@@@ -1,192 -1,0 +1,192 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.hypergraph;
 +
 +import static java.lang.Integer.MAX_VALUE;
 +
 +import java.util.ArrayList;
 +import java.util.LinkedList;
 +import java.util.List;
 +import java.util.ListIterator;
 +import java.util.Map;
 +
 +import org.apache.joshua.decoder.ff.tm.Rule;
 +
 +/**
 + * This class encodes a derivation state in terms of a list of alignment points.
 + * Whenever a child instance is substituted into the parent instance, we need to
 + * adjust source indexes of the alignments.
 + * 
 + * @author fhieber
 + */
 +public class WordAlignmentState {
 +
 +  /**
 +   * each element in this list corresponds to a token on the target side of the
 +   * rule. The values of the elements correspond to the aligned source token on
 +   * the source side of the rule.
 +   */
-   private List<AlignedSourceTokens> trgPoints;
++  private final List<AlignedSourceTokens> trgPoints;
 +  private final int srcStart;
 +  /** number of NTs we need to substitute. */
 +  private int numNT;
 +  /** grows with substitutions of child rules. Reaches original Rule span if substitutions are complete */
 +  private int srcLength;
 +
 +  /**
 +   * construct AlignmentState object from a virgin Rule and its source span.
 +   * Determines if state is complete (if no NT present)
 +   * 
 +   * @param rule the input Rule
 +   * @param start the start index
 +   */
 +  public WordAlignmentState(final Rule rule, final int start) {
 +    trgPoints = new LinkedList<AlignedSourceTokens>();
 +    srcLength = rule.getSource().length;
 +    numNT = rule.getArity();
 +    srcStart = start;
 +    final Map<Integer, List<Integer>> alignmentMap = rule.getAlignmentMap();
 +    final int[] nonTerminalSourcePositions = rule.getNonTerminalSourcePositions();
 +    final int[] trg = rule.getTarget();
 +    // for each target index, create a TargetAlignmentPoint
 +    for (int trgIndex = 0; trgIndex < trg.length; trgIndex++) {
 +      final AlignedSourceTokens trgPoint = new AlignedSourceTokens();
 +
 +      if (trg[trgIndex] >= 0) { // this is a terminal symbol, check for alignment
 +        if (alignmentMap.containsKey(trgIndex)) {
 +          // add source indexes to TargetAlignmentPoint
 +          for (int srcIdx : alignmentMap.get(trgIndex)) {
 +            trgPoint.add(srcStart + srcIdx);
 +          }
 +        } else { // this target word is NULL-aligned
 +          trgPoint.setNull();
 +        }
 +      } else { // this is a nonterminal ([X]) [actually its the (negative) index of the NT in the source]
 +        trgPoint.setNonTerminal(); // mark as non-terminal
 +        final int absoluteNonTerminalSourcePosition = srcStart + nonTerminalSourcePositions[Math.abs(trg[trgIndex]) - 1];
 +        trgPoint.add(absoluteNonTerminalSourcePosition);
 +      }
 +      trgPoints.add(trgPoint);
 +    }
 +  }
 +
 +  /**
 +   * if there are no more NonTerminals to substitute,
 +   * this state is said to be complete
 +   * @return true if complete
 +   */
 +  public boolean isComplete() {
 +    return numNT == 0;
 +  }
 +
 +  /**
 +   * builds the final alignment string in the standard alignment format: src -
 +   * trg. Sorted by trg indexes. Disregards the sentence markers.
 +   * @return result string
 +   */
 +  public String toFinalString() {
 +    final StringBuilder sb = new StringBuilder();
 +    int t = 0;
 +    for (AlignedSourceTokens pt : trgPoints) {
 +      for (int s : pt) {
 +        sb.append(String.format(" %d-%d", s-1, t-1)); // disregard sentence markers
 +      }
 +      t++;
 +    }
 +    final String result = sb.toString();
 +    if (!result.isEmpty()) {
 +      return result.substring(1);
 +    }
 +    return result;
 +  }
 +  
 +  /**
 +   * builds the final alignment list.
 +   * each entry in the list corresponds to a list of aligned source tokens.
 +   * First and last item in trgPoints is skipped.
 +   * @return a final alignment list
 +   */
 +  public List<List<Integer>> toFinalList() {
-     final List<List<Integer>> alignment = new ArrayList<List<Integer>>(trgPoints.size());
++    final List<List<Integer>> alignment = new ArrayList<>(trgPoints.size());
 +    if (trgPoints.isEmpty()) {
 +      return alignment;
 +    }
 +    final ListIterator<AlignedSourceTokens> it = trgPoints.listIterator();
 +    it.next(); // skip first item (sentence marker)
 +    while (it.hasNext()) {
 +      final AlignedSourceTokens alignedSourceTokens = it.next();
 +      if (it.hasNext()) { // if not last element in trgPoints
-         final List<Integer> newAlignedSourceTokens = new ArrayList<Integer>();
++        final List<Integer> newAlignedSourceTokens = new ArrayList<>();
 +        for (Integer sourceIndex : alignedSourceTokens) {
 +          newAlignedSourceTokens.add(sourceIndex - 1); // shift by one to disregard sentence marker
 +        }
 +        alignment.add(newAlignedSourceTokens);
 +      }
 +    }
 +    return alignment;
 +  }
 +
 +  /**
 +   * String representation for debugging.
 +   */
 +  @Override
 +  public String toString() {
 +    return String.format("%s , len=%d start=%d, isComplete=%s",
 +        trgPoints.toString(), srcLength, srcStart, this.isComplete());
 +  }
 +
 +  /**
 +   * Substitutes a child WorldAlignmentState into this instance at the next
 +   * nonterminal slot. Also shifts the indeces in this instance by the span/width of the
 +   * child that is to be substituted.
 +   * Substitution order is determined by the source-first traversal through the hypergraph.
 +   * 
 +   * @param child The child
 +   */
 +  public void substituteIn(WordAlignmentState child) {
 +    // find the index of the NonTerminal where we substitute the child targetPoints into.
 +    // The correct NT is the first one on the SOURCE side.
 +    // Also shift all trgPoints by the child length.
 +    int substitutionIndex = 0;
 +    int sourcePosition = MAX_VALUE;
 +    for (final ListIterator<AlignedSourceTokens> trgPointsIterator = trgPoints.listIterator(); trgPointsIterator.hasNext();) {
 +      final AlignedSourceTokens trgPoint = trgPointsIterator.next();
 +      trgPoint.shiftBy(child.srcStart, child.srcLength - 1);
 +      if (trgPoint.isNonTerminal() && trgPoint.get(0) < sourcePosition) {
 +        sourcePosition = trgPoint.get(0);
 +        substitutionIndex = trgPointsIterator.previousIndex();
 +      }
 +    }
 +    
 +    // point and remove NT element determined from above
 +    final ListIterator<AlignedSourceTokens> insertionIterator = trgPoints.listIterator(substitutionIndex);
 +    insertionIterator.next();
 +    insertionIterator.remove();
 +    
 +    // insert child target points and set them to final.
 +    for (AlignedSourceTokens childElement : child.trgPoints) {
 +      childElement.setFinal();
 +      insertionIterator.add(childElement);
 +    }
 +    
 +    // update length and number of non terminal slots
 +    this.srcLength += child.srcLength - 1; // -1 (NT)
 +    this.numNT--;
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/io/JSONMessage.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/io/JSONMessage.java
index 90a550b,0000000..36415fe
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/io/JSONMessage.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/io/JSONMessage.java
@@@ -1,159 -1,0 +1,159 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.io;
 +
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import com.google.gson.Gson;
 +import com.google.gson.GsonBuilder;
 +
 +import org.apache.joshua.decoder.StructuredTranslation;
 +import org.apache.joshua.decoder.Translation;
 +
 +/**
 + * Represents a JSON object returned by the server. The object has the format
 + * 
 + * { data: { 
 + *   translations: [
 + *     { annotatedSource: "",
 + *       translatedText: "",
 + *       raw_nbest: [
 + *         { hyp: "",
 + *           totalScore: 0.0, } ]
 + *       tokenization: { ... }
 + *       translatedTextRaw: "",
 + *       nbest: [
 + *         { translatedText: "",
 + *           translatedTextRaw: "",
 + *           tokenization: { ... } } ] } ] } }
 + * 
 + * @author post
 + */
 +
 +public class JSONMessage {
 +  public Data data = null;
 +  public List<String> metadata = null;
 +  public JSONMessage() {
-     metadata = new ArrayList<String>();
++    metadata = new ArrayList<>();
 +  }
 +  
 +  public class Data {
-     public List<TranslationItem> translations;
++    public final List<TranslationItem> translations;
 +    
 +    public Data() {
-       translations = new ArrayList<TranslationItem>();
++      translations = new ArrayList<>();
 +    }
 +  }
 +//
 +//  public class Metadata {
 +//    public String metadata = null;
 +//    public List<String> rules = null;
 +//
 +//    public Metadata() {
 +//      rules = new ArrayList<String>();
 +//    }
 +//  }
 +
 +  public void addTranslation(Translation translation) {
-     String viterbi = translation.getStructuredTranslations().get(0).getTranslationString();
++    String viterbi = translation.getStructuredTranslations().get(0).getFormattedTranslationString();
 +    
 +    TranslationItem item = addTranslation(viterbi);
 +
 +    for (StructuredTranslation hyp: translation.getStructuredTranslations()) {
 +      String text = hyp.getTranslationString();
 +      float score = hyp.getTranslationScore();
 +
 +      item.addHypothesis(text, score);
 +    }
 +    
 +      // old string-based k-best output
 +  //    String[] results = translation.toString().split("\\n");
 +  //    if (results.length > 0) {
 +  //      String rawTranslation = results[0].split(" \\|\\|\\| ")[1];
 +  //      JSONMessage.TranslationItem item = message.addTranslation(rawTranslation);
 +  //
 +  //      for (String result: results) {
 +  //        String[] tokens = result.split(" \\|\\|\\| ");
 +  //        String rawResult = tokens[1];
 +  //        float score = Float.parseFloat(tokens[3]);
 +  //        item.addHypothesis(rawResult, score);
 +  //      }
 +  //    }
 +    }
 +
 +  /**
 +   * Adds a new Translation to the JSON object. A Translation represents one or more hypotheses
 +   * (or k-best items)
 +   * 
 +   * @param text the translation text
 +   * @return the new TranslationItem object
 +   */
 +  public TranslationItem addTranslation(String text) {
 +    if (data == null)
 +      data = new Data();
 +    
 +    TranslationItem newItem = new TranslationItem(text);
 +    data.translations.add(newItem);
 +    return newItem;
 +  }
 +  
 +  public void addMetaData(String msg) {
 +    this.metadata.add(msg);
 +  }
 +
 +  public class TranslationItem {
-     public String translatedText;
-     public List<NBestItem> raw_nbest;
++    public final String translatedText;
++    public final List<NBestItem> raw_nbest;
 +    
 +    public TranslationItem(String value) {
 +      this.translatedText = value;
-       this.raw_nbest = new ArrayList<NBestItem>();
++      this.raw_nbest = new ArrayList<>();
 +    }
 +    
 +    /**
 +     * Adds a new item to the translation's list of k-best items
 +     * 
 +     * @param hyp the hypothesis
 +     * @param score its score
 +     */
 +    public void addHypothesis(String hyp, float score) {
 +      this.raw_nbest.add(new NBestItem(hyp, score));
 +    }
 +  }
 +  
 +  public class NBestItem {
-     public String hyp;
-     public float totalScore;
++    public final String hyp;
++    public final float totalScore;
 +    
 +    public NBestItem(String hyp, float score) {
 +      this.hyp = hyp;
 +      this.totalScore = score;  
 +    }
 +  }
 +  
 +  public void addRule(String rule) {
 +    metadata.add("custom_rule " + rule);
 +  }
 +
 +  public String toString() {
 +    Gson gson = new GsonBuilder().setPrettyPrinting().create();
 +    return gson.toJson(this) + "\n";
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/dc756709/joshua-core/src/main/java/org/apache/joshua/decoder/io/TranslationRequestStream.java
----------------------------------------------------------------------
diff --cc joshua-core/src/main/java/org/apache/joshua/decoder/io/TranslationRequestStream.java
index 0287688,0000000..afb63ab
mode 100644,000000..100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/io/TranslationRequestStream.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/io/TranslationRequestStream.java
@@@ -1,179 -1,0 +1,177 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *  http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.joshua.decoder.io;
 +
 +import java.io.BufferedReader;
 +import java.io.IOException;
 +import java.io.Reader;
 +
 +import com.google.gson.stream.JsonReader;
 +
 +import org.apache.joshua.decoder.JoshuaConfiguration;
 +import org.apache.joshua.decoder.JoshuaConfiguration.INPUT_TYPE;
 +import org.apache.joshua.decoder.segment_file.Sentence;
 +
 +/**
 + * This class iterates over an input stream, looking for inputs to translate. By default, it
 + * expects plain-text input, which can be plain sentences or PLF-encoded lattices. If
 + * '-input-type json' is passed to the decoder, it will instead read JSON objects from the input
 + * stream, with the following format:
 + * <pre>
 + * {
 + *   "data": {
 + *     "translations": [
 + *       { "sourceText": "sentence to be translated" },
 + *       { "sourceText": "next sentence" },
 + *       { "sourceText": "@some command to run" }
 + *     ]
 + *   }
 + * }
 + * </pre>
 + * @author Matt Post post@cs.jhu.edu
 + * @author orluke
 + */
 +public class TranslationRequestStream {
 +  private final JoshuaConfiguration joshuaConfiguration;
 +  private int sentenceNo = -1;
 +
-   private Sentence nextSentence = null;
- 
-   /* Plain text or JSON input */ 
++  /* Plain text or JSON input */
 +  private StreamHandler requestHandler = null;
 +
 +  /* Whether the request has been killed by a broken client connection. */
 +  private volatile boolean isShutDown = false;
 +
 +  public TranslationRequestStream(BufferedReader reader, JoshuaConfiguration joshuaConfiguration) {
 +    this.joshuaConfiguration = joshuaConfiguration;
 +    
 +    if (joshuaConfiguration.input_type == INPUT_TYPE.json) {
 +      this.requestHandler = new JSONStreamHandler(reader);
 +    } else {
 +      this.requestHandler = new PlaintextStreamHandler(reader);
 +    }
 +  }
 +
 +  private interface StreamHandler {
 +    Sentence next() throws IOException;
 +  }
 +  
 +  private class JSONStreamHandler implements StreamHandler {
 +
 +    private JsonReader reader = null;
 +    private String line = null;
 +    
 +    public JSONStreamHandler(Reader in) {
 +      reader = new JsonReader(in);
 +      try {
 +        reader.beginObject();
 +        reader.nextName(); // "data"
 +        reader.beginObject();
 +        reader.nextName(); // "translations"
 +        reader.beginArray();
 +      } catch (IOException e) {
 +        e.printStackTrace();
 +      }
 +    }
 +    
 +    @Override
 +    public Sentence next() throws IOException {
 +      line = null;
 +
 +      if (reader.hasNext()) {
 +        reader.beginObject();
 +        reader.nextName();
 +        line = reader.nextString();
 +        reader.endObject();
 +      }
 +
 +      if (line == null)
 +        return null;
 +
 +      return new Sentence(line, -1, joshuaConfiguration);
 +    }
 +  }
 +  
 +  private class PlaintextStreamHandler implements StreamHandler {
 +
 +    private BufferedReader reader = null;
 +    
 +    public PlaintextStreamHandler(BufferedReader in) {
 +      reader = in;
 +    }
 +    
 +    @Override
 +    public Sentence next() throws IOException {
 +      
 +      String line = reader.readLine();
 +
 +      if (line != null) {
 +        return new Sentence(line, sentenceNo, joshuaConfiguration);
 +      }
 +      
 +      return null;
 +    }
 +  }
 +  
 +  public int size() {
 +    return sentenceNo + 1;
 +  }
 +
 +  /*
 +   * Returns the next sentence item, then sets it to null, so that hasNext() will know to produce a
 +   * new one.
 +   */
 +  public synchronized Sentence next() {
-     nextSentence = null;
++    Sentence nextSentence = null;
 +    
 +    if (isShutDown)
 +      return null;
 +    
 +    try {
 +      nextSentence = requestHandler.next();
 +      if (nextSentence != null) {
 +        sentenceNo++;
 +        nextSentence.id = sentenceNo;
 +      }
 +    } catch (IOException e) {
 +      this.shutdown();
 +    }
 +
 +    return nextSentence;
 +  }
 +
 +  /**
 +   * When the client socket is interrupted, we need to shut things down. On the source side, the
 +   * TranslationRequest could easily have buffered a lot of lines and so will keep discovering
 +   * sentences to translate, but the output Translation objects will start throwing exceptions when
 +   * trying to print to the closed socket. When that happens, we call this function() so that we can
 +   * tell next() to stop returning translations, which in turn will cause it to stop asking for
 +   * them.
 +   * 
 +   * Note that we don't go to the trouble of shutting down existing DecoderThreads. This would be
 +   * good to do, but for the moment would require more bookkeeping than we want to do.
 +   */
 +
 +  public void shutdown() {
 +    isShutDown = true;
 +  }
 +  
 +  public boolean isShutDown() {
 +    return isShutDown;
 +  }
 +}