@@ -0,0 +1,1686 @@
+package joshua.decoder.ff.tm;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0Aimport java.util.Comparator;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport joshua.corpus.SymbolTable;%0D%0Aimport joshua.decoder.ff.FeatureFunction;%0D%0Aimport joshua.util.sentence.Vocabulary;%0D%0A%0D%0Apublic interface Rule %7B%0D%0A%09%0D%0A%09public void setRuleID(int id);%0D%0A%09%0D%0A%09public int getRuleID();%0D%0A%09%0D%0A%09%0D%0A%09public void setArity(int arity);%0D%0A%09%0D%0A%09public int getArity();%0D%0A%09%0D%0A%09public void setOwner(int ow);%0D%0A%09%0D%0A%09public int getOwner();%0D%0A%09%0D%0A%09public void setLHS(int lhs);%0D%0A%09%0D%0A%09public int getLHS();%0D%0A%09%09%0D%0A%09public void setEnglish(int%5B%5D eng_);%0D%0A%09%0D%0A%09public int%5B%5D getEnglish();%0D%0A%09%0D%0A%09public void setFrench(int%5B%5D french_);%0D%0A%09%0D%0A%09public int%5B%5D getFrench();%0D%0A%09%0D%0A%09public void setFeatureScores(float%5B%5D scores);%0D%0A%09%0D%0A%09public float%5B%5D getFeatureScores();%0D%0A%09%0D%0A%09public void setLatticeCost(float cost);%0D%0A%09%0D%0A%09public float getLatticeCost();%0D%0A%09%0D%0A%09public float getEstCost();%0D%0A%09%0D%0A%09/** %0D%0A%09 * set a lower-bound estimate inside the rule returns full estimate.%0D%0A%09 */%0D%0A%09public float estimateRuleCost(ArrayList%3CFeatureFunction%3E p_l_models);%0D%0A%09%0D%0A%0D%0A%09public static Comparator%3CRule%3E NegtiveCostComparator%09= new Comparator%3CRule%3E() %7B%0D%0A%09%09public int compare(Rule rule1, Rule rule2) %7B%0D%0A%09%09%09float cost1 = rule1.getEstCost();%0D%0A%09%09%09float cost2 = rule2.getEstCost();%0D%0A%09%09%09if (cost1 %3E cost2) %7B%0D%0A%09%09%09%09return -1;%0D%0A%09%09%09%7D else if (cost1 == cost2) %7B%0D%0A%09%09%09%09return 0;%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09return 1;%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%7D;%0D%0A%09%0D%0A%09public String toString(Map%3CInteger,String%3E ntVocab, Vocabulary sourceVocab, Vocabulary targetVocab);%0D%0A%09%0D%0A%09//print the rule in terms of Ingeters%0D%0A%09public String toString(); %0D%0A%09%0D%0A%09public String toString(SymbolTable p_symbolTable);%0D%0A%09%0D%0A%09 public String toStringWithoutFeatScores(SymbolTable p_symbolTable);%0D%0A%7D%0D%0A

Add Rule in the commit