edu.umn.cs.nlp.mt.chiang2007
Class BilingualTranslationRule

java.lang.Object
  extended by edu.umn.cs.nlp.mt.TranslationRule
      extended by edu.umn.cs.nlp.mt.chiang2007.BilingualTranslationRule
All Implemented Interfaces:
Scorable, Comparable<TranslationRule>

public class BilingualTranslationRule
extends TranslationRule

The left-hand side of a Chiang-style translation rule, including associated rule features.

Version:
$LastChangedDate: 2007-07-24 16:48:53 -0500 (Tue, 24 Jul 2007) $
Author:
Lane Schwartz
See Also:
"A Hierarchical Phrase-Based Model for Statistical Machine Translation" by David Chiang (ACL, 2005)

Field Summary
 
Fields inherited from class edu.umn.cs.nlp.mt.TranslationRule
S_GLUE_RULE, S_RULE, UNKNOWN_WORD_RULE
 
Constructor Summary
BilingualTranslationRule(String targetLanguageRHS)
          Construct a bilingual translation rule with default values for the log-linear features.
BilingualTranslationRule(String targetLanguageRHS, double lexLogProbSourceGivenTarget, double lexLogProbTargetGivenSource, double ruleLogProbSourceGivenTarget, double ruleLogProbTargetGivenSource)
          Construct a bilingual translation rule with the specified log-linear feature values.
 
Method Summary
 LoglinearTranslationFeatures getFeatures()
           
 double getLexLogProbSourceGivenTarget()
           
 double getLexLogProbTargetGivenSource()
           
 int getNumberOfTargetWords()
           
 double getRuleLogProbSourceGivenTarget()
           
 double getRuleLogProbTargetGivenSource()
           
 double getScore()
          Get score
 String getSymbol()
           
 String getTargetLanguageRHS()
          Get the target language right-hand side of the rule
 String toString()
           
 
Methods inherited from class edu.umn.cs.nlp.mt.TranslationRule
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BilingualTranslationRule

public BilingualTranslationRule(String targetLanguageRHS,
                                double lexLogProbSourceGivenTarget,
                                double lexLogProbTargetGivenSource,
                                double ruleLogProbSourceGivenTarget,
                                double ruleLogProbTargetGivenSource)
Construct a bilingual translation rule with the specified log-linear feature values.

Parameters:
targetLanguageRHS - Target language right-hand side of the rule
lexLogProbSourceGivenTarget - Log-linear feature representing the log probabilibity of the source language words given the target language words
lexLogProbTargetGivenSource - Log-linear feature representing the log probabilibity of the target language words given the source language words
ruleLogProbSourceGivenTarget - Log-linear feature representing the log probabilibity of the source language phrase given the target language phrase
ruleLogProbTargetGivenSource - Log-linear feature representing the log probabilibity of the target language phrase given the source language phrase

BilingualTranslationRule

public BilingualTranslationRule(String targetLanguageRHS)
Construct a bilingual translation rule with default values for the log-linear features.

Parameters:
targetLanguageRHS - Target language right-hand side of the rule
Method Detail

getTargetLanguageRHS

public String getTargetLanguageRHS()
Get the target language right-hand side of the rule

Specified by:
getTargetLanguageRHS in class TranslationRule
Returns:
Target language right-hand side of the rule

getLexLogProbSourceGivenTarget

public double getLexLogProbSourceGivenTarget()
Returns:
the lexLogProbSourceGivenTarget

getLexLogProbTargetGivenSource

public double getLexLogProbTargetGivenSource()
Returns:
the lexLogProbTargetGivenSource

getRuleLogProbSourceGivenTarget

public double getRuleLogProbSourceGivenTarget()
Returns:
the ruleLogProbSourceGivenTarget

getRuleLogProbTargetGivenSource

public double getRuleLogProbTargetGivenSource()
Returns:
the ruleLogProbTargetGivenSource

getSymbol

public String getSymbol()
Specified by:
getSymbol in class TranslationRule

getFeatures

public LoglinearTranslationFeatures getFeatures()
Specified by:
getFeatures in class TranslationRule

getScore

public double getScore()
Description copied from interface: Scorable
Get score

Specified by:
getScore in interface Scorable
Specified by:
getScore in class TranslationRule
Returns:
score

toString

public String toString()
Overrides:
toString in class Object

getNumberOfTargetWords

public int getNumberOfTargetWords()
Specified by:
getNumberOfTargetWords in class TranslationRule