|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| void | sortRules (List< FeatureFunction > l_models) |
| List< Rule > | getSortedRules () |
| List< Rule > | getRules () |
| int[] | getSourceSide () |
| int | getArity () |
Represents a set of rules under a particular TrieGrammar node. Therefore, all the rules under a RuleCollection will share:
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.
Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.
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.
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.
Gets the source side for all rules in this RuleCollection. This source side is the same for all the rules in the RuleCollection.
Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.
| void joshua.decoder.ff.tm.RuleCollection.sortRules | ( | List< FeatureFunction > | l_models | ) |
Sorts the grammar rules in this collection using the provided feature functions.
| l_models | Feature function models to use during sorting. |
Implemented in joshua.decoder.ff.tm.packed.PackedGrammar.PackedTrie, and joshua.decoder.ff.tm.BasicRuleCollection.