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

List of all members.

Public Member Functions

void sortRules (List< FeatureFunction > l_models)
List< RulegetSortedRules ()
List< RulegetRules ()
int[] getSourceSide ()
int getArity ()

Detailed Description

Represents a set of rules under a particular TrieGrammar node. Therefore, all the rules under a RuleCollection will share:

  • arity
  • source side
Author:
Zhifei Li
Lane Schwartz
Version:
$LastChangedDate$

Member Function Documentation

Gets the number of nonterminals in the source side of the rules in this RuleCollection. The source side is the same for all the rules in the RuleCollection, so the arity will also be the same for all of these rules.

Returns:
the (common) number of nonterminals in the source side of the rules in this RuleCollection

Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.

Here is the caller graph for this function:

get the list of rules (which may not be sorted or not)

Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.

Here is the caller graph for this function:

TODO: now, we assume this function will be called only after all the rules have been read; this method need to be synchronized as we will call this function only after the decoding begins to avoid the synchronized method, we should call this once the grammar is finished

public synchronized ArrayList<Rule> get_sorted_rules(){ l_models: if it is non-null, then the rules will be sorted using the new feature functions (or new weight), otherwise, just return a sorted list based on the last time of feature functions

Only CubePruning requires that rules are sorted based on est_cost (confirmed by zhifei)

Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.

Here is the caller graph for this function:

Gets the source side for all rules in this RuleCollection. This source side is the same for all the rules in the RuleCollection.

Returns:
the (common) source side for all rules in this RuleCollection

Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.

Here is the caller graph for this function:

Sorts the grammar rules in this collection using the provided feature functions.

Parameters:
l_modelsFeature function models to use during sorting.

Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.

Here is the caller graph for this function: