|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| BasicRuleCollection (int arity, int[] sourceTokens) | |
| BasicRuleCollection (int arity, int[] sourceTokens, List< Rule > rules) | |
| int | getArity () |
| List< Rule > | getRules () |
| synchronized void | sortRules (List< FeatureFunction > l_models) |
| List< Rule > | getSortedRules () |
| int[] | getSourceSide () |
Static Public Member Functions | |
| static void | sortRules (List< Rule > rules, List< FeatureFunction > l_models) |
Protected Attributes | |
| boolean | sorted |
| final List< Rule > | rules |
| int | arity |
| int[] | sourceTokens |
Static Private Attributes | |
| static final Logger | logger = Logger.getLogger(BasicRuleCollection.class.getName()) |
Basic collection of translation rules.
| joshua.decoder.ff.tm.BasicRuleCollection.BasicRuleCollection | ( | int | arity, |
| int[] | sourceTokens | ||
| ) |
Constructs an initially empty rule collection.
| arity | Number of nonterminals in the source pattern |
| sourceTokens | Sequence of terminals and nonterminals in the source pattern |
| joshua.decoder.ff.tm.BasicRuleCollection.BasicRuleCollection | ( | int | arity, |
| int[] | sourceTokens, | ||
| List< Rule > | rules | ||
| ) |
Constructs a rule collection with the given data.
The list of rules must already be sorted
NOTE: if rules==null, the rule member variable will be initialized to an immutable empty list.
| arity | |
| sourceTokens | |
| rules |
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.
Implements joshua.decoder.ff.tm.RuleCollection.
get the list of rules (which may not be sorted or not)
Implements joshua.decoder.ff.tm.RuleCollection.
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)
Implements joshua.decoder.ff.tm.RuleCollection.
Gets the source side for all rules in this RuleCollection. This source side is the same for all the rules in the RuleCollection.
Implements joshua.decoder.ff.tm.RuleCollection.
| static void joshua.decoder.ff.tm.BasicRuleCollection.sortRules | ( | List< Rule > | rules, |
| List< FeatureFunction > | l_models | ||
| ) | [static] |
| synchronized void joshua.decoder.ff.tm.BasicRuleCollection.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. |
Implements joshua.decoder.ff.tm.RuleCollection.
int joshua.decoder.ff.tm.BasicRuleCollection.arity [protected] |
Number of nonterminals in the source pattern.
final Logger joshua.decoder.ff.tm.BasicRuleCollection.logger = Logger.getLogger(BasicRuleCollection.class.getName()) [static, private] |
Logger for this class.
Reimplemented in joshua.decoder.ff.tm.hash_based.MemoryBasedRuleBin.
final List<Rule> joshua.decoder.ff.tm.BasicRuleCollection.rules [protected] |
List of rules stored in this collection.
boolean joshua.decoder.ff.tm.BasicRuleCollection.sorted [protected] |
Indicates whether the rules in this collection have been sorted based on the latest feature function values.
int [] joshua.decoder.ff.tm.BasicRuleCollection.sourceTokens [protected] |
Sequence of terminals and nonterminals in the source pattern.