Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.ff.tm.Rule Interface Reference
Inheritance diagram for joshua.decoder.ff.tm.Rule:
[legend]
Collaboration diagram for joshua.decoder.ff.tm.Rule:
[legend]

List of all members.

Public Member Functions

void setRuleID (int id)
int getRuleID ()
void setArity (int arity)
int getArity ()
void setOwner (int ow)
int getOwner ()
void setLHS (int lhs)
int getLHS ()
void setEnglish (int[] eng)
int[] getEnglish ()
void setFrench (int[] french)
int[] getFrench ()
void setFeatureScores (float[] scores)
float[] getFeatureScores ()
void setFeatureCost (int column, float cost)
float getFeatureCost (int column)
float incrementFeatureScore (int column, double score)
void setLatticeCost (float cost)
float getLatticeCost ()
void setEstCost (float cost)
float getEstCost ()
float estimateRuleCost (List< FeatureFunction > featureFunctions)
String toString (Map< Integer, String > ntVocab)
String toString ()
String toStringWithoutFeatScores ()

Public Attributes

Comparator< RuleNegtiveCostComparator

Detailed Description

This class define the interface for Rule. Normally, the feature score in the rule should be cost (i.e., -LogP), so that the feature weight should be positive.

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Member Function Documentation

float joshua.decoder.ff.tm.Rule.estimateRuleCost ( List< FeatureFunction featureFunctions)

Set a lower-bound estimate inside the rule returns full estimate.

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule, and joshua.decoder.ff.tm.BilingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

float joshua.decoder.ff.tm.Rule.incrementFeatureScore ( int  column,
double  score 
)
void joshua.decoder.ff.tm.Rule.setFeatureCost ( int  column,
float  cost 
)
Parameters:
columnstart from zero

Implemented in joshua.decoder.ff.tm.MonolingualRule.

void joshua.decoder.ff.tm.Rule.setFrench ( int[]  french)

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

Implemented in joshua.decoder.ff.tm.MonolingualRule.

Here is the caller graph for this function:

String joshua.decoder.ff.tm.Rule.toString ( Map< Integer, String >  ntVocab)

Implemented in joshua.decoder.ff.tm.MonolingualRule, and joshua.decoder.ff.tm.BilingualRule.

Here is the caller graph for this function:


Member Data Documentation

Initial value:
 new Comparator<Rule>() {
    public int compare(Rule rule1, Rule rule2) {
      float cost1 = rule1.getEstCost();
      float cost2 = rule2.getEstCost();
      if (cost1 > cost2) {
        return -1;
      } else if (cost1 == cost2) {
        return 0;
      } else {
        return 1;
      }
    }
  }

In order to provide sorting for cube-pruning, we need to provide this Comparator.