Package joshua.decoder.ff.tm

Examples of joshua.decoder.ff.tm.BilingualRule


              sourcePattern,
              sourcePatternCount,
              translation,
              counts, p_e_given_f_denominator);

        Rule rule = new BilingualRule(
            SymbolTable.X,
            sourcePattern.getWordIDs(),
            translation.getWordIDs(),
            featureScores,
            translation.arity(),
View Full Code Here


    int[] sourceRHS = {24, -1, 42, 738};
    int[] targetRHS = {-1, 7, 8};
    float[] featureScores = {-2.35f, -1.78f, -0.52f};
    int arity = 1;
   
    Rule dummyRule = new BilingualRule(lhs, sourceRHS, targetRHS, featureScores, arity);
   
    Assert.assertEquals(featureFunction.estimateLogP(dummyRule, -1), ArityPhrasePenaltyFF.ALPHA);
   
  }
View Full Code Here

  }
 
 
  public Rule constructManualRule(int lhs, int[] sourceWords,
      int[] targetWords, float[] scores, int arity) {
    return new BilingualRule(lhs, sourceWords, targetWords, scores, arity, this.ruleOwner, 0, getOOVRuleID());
  }
View Full Code Here

     * */
    if ( (!hasLM) && numFeatures > 0) {
      feat_scores[0] = oovFeatureCost;
    }
   
    return new BilingualRule(
        this.defaultLHS, french, english,
        feat_scores, 0, this.ruleOwner,
        0, getOOVRuleID());

  }
View Full Code Here

    int i = 0;
    for (String score : scores) {
      feature_scores[i++] = Float.parseFloat(score);
    }
   
    return new BilingualRule(lhs, french, english, feature_scores, arity);
  }
View Full Code Here

    float[] feature_scores = new float[scores.length];
    for (int i = 0; i < scores.length; i++) {
      feature_scores[i] = Float.parseFloat(scores[i]);
    }
   
    return new BilingualRule(lhs, french, english,
        feature_scores, arity, owner, 0, id);
  }
View Full Code Here

     * */
    if ( (!hasLM) && qtyFeatures > 0) {
      feat_scores[0] = oovFeatureCost;
    }
   
    return new BilingualRule(this.defaultLHS, french, english, feat_scores, 0, this.defaultOwner, 0, getOOVRuleID());
  }
View Full Code Here

    return OOV_RULE_ID;
  }
 
 
  public Rule constructManualRule(int lhs, int[] sourceWords, int[] targetWords, float[] scores, int arity) {
    return new BilingualRule(lhs, sourceWords, targetWords, scores, arity, this.defaultOwner, 0, getOOVRuleID());
  }
View Full Code Here

    int i = 0;
    for (String score : scores) {
      feature_scores[i++] = Float.parseFloat(score);
    }

    return new BilingualRule(lhs, french, english, feature_scores, arity);
  }
View Full Code Here

TOP

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

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.