Joshua
open source statistical hierarchical phrase-based machine translation system
|
Classes | |
class | PackedChildIterator |
class | PackedPhrasePair |
class | PackedRule |
Public Member Functions | |
final Trie | match (int token_id) |
HashMap< Integer,?extends Trie > | getChildren () |
boolean | hasExtensions () |
ArrayList<?extends Trie > | getExtensions () |
boolean | hasRules () |
RuleCollection | getRuleCollection () |
List< Rule > | getRules () |
boolean | isSorted () |
List< Rule > | getSortedRules (List< FeatureFunction > featureFunctions) |
int[] | getSourceSide () |
int | getArity () |
Iterator< Integer > | getTerminalExtensionIterator () |
Iterator< Integer > | getNonterminalExtensionIterator () |
Private Member Functions | |
PackedTrie (int position) | |
PackedTrie (int position, int[] parent_src, int parent_arity, int symbol) | |
synchronized void | sortRules (List< FeatureFunction > models) |
Private Attributes | |
final int | position |
boolean | sorted = false |
int[] | src |
int | arity |
A trie node within the grammar slice. Identified by its position within the source array, and, as a supplement, the source string leading from the trie root to the node.
joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.PackedTrie | ( | int | position | ) | [private] |
joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.PackedTrie | ( | int | position, |
int[] | parent_src, | ||
int | parent_arity, | ||
int | symbol | ||
) | [private] |
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.
HashMap<Integer, ? extends Trie> joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getChildren | ( | ) |
If the trie node has extensions, get a list of their labels.
Implements joshua.decoder.ff.tm.Trie.
ArrayList<? extends Trie> joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getExtensions | ( | ) |
If the trie node has extensions, then return a list of extended trie nodes, otherwise return null.
Trie
nodes if this node has extensions, null otherwise
Implements joshua.decoder.ff.tm.Trie.
Iterator<Integer> joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getNonterminalExtensionIterator | ( | ) |
Returns an iterator over the trie node's extensions with nonterminal labels.
Implements joshua.decoder.ff.tm.Trie.
RuleCollection joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getRuleCollection | ( | ) |
Retrieve the rules at the current node/state. The implementation of this method must adhere to the following laws:
Implements joshua.decoder.ff.tm.Trie.
Get the list of rules. There are no guarantees about whether they're sorted or not.
Implements joshua.decoder.ff.tm.RuleCollection.
List<Rule> joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getSortedRules | ( | List< FeatureFunction > | models | ) |
This returns a list of the rules, sorting them if necessary.
Implementations of this function should be synchronized.
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.
Iterator<Integer> joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.getTerminalExtensionIterator | ( | ) |
Returns an iterator over the trie node's extensions with terminal labels.
Implements joshua.decoder.ff.tm.Trie.
Returns whether matchOne(Symbol) could succeed for any symbol.
true
if match(int) could succeed for some symbol, false
otherwise Implements joshua.decoder.ff.tm.Trie.
Gets whether the current node/state is a "final state" that has matching rules.
true
if the current node/state is a "final state" that has matching rules, false
otherwise Implements joshua.decoder.ff.tm.Trie.
We determine if the Trie is sorted by checking if the estimated cost of the first rule in the trie has been set.
Implements joshua.decoder.ff.tm.RuleCollection.
final Trie joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.match | ( | int | wordID | ) |
Traverse one ply further down the trie. If there is no match, the result is null.
wordID |
Implements joshua.decoder.ff.tm.Trie.
synchronized void joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.sortRules | ( | List< FeatureFunction > | models | ) | [private] |
final int joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.position [private] |
boolean joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.sorted = false [private] |
int [] joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.src [private] |