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

List of all members.

Classes

class  PackedChildIterator
class  PackedPhrasePair
class  PackedRule

Public Member Functions

final Trie match (int token_id)
HashMap< Integer,?extends TriegetChildren ()
boolean hasExtensions ()
ArrayList<?extends TriegetExtensions ()
boolean hasRules ()
RuleCollection getRuleCollection ()
List< RulegetRules ()
boolean isSorted ()
List< RulegetSortedRules (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

Detailed Description

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.

Author:
jg

Constructor & Destructor Documentation

joshua.decoder.ff.tm.packed.PackedGrammar.PackedSlice.PackedTrie.PackedTrie ( int  position,
int[]  parent_src,
int  parent_arity,
int  symbol 
) [private]

Here is the call graph for this function:


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

Implements joshua.decoder.ff.tm.RuleCollection.

Here is the caller graph for this function:

If the trie node has extensions, get a list of their labels.

Returns:

Implements joshua.decoder.ff.tm.Trie.

Here is the call graph for this function:

If the trie node has extensions, then return a list of extended trie nodes, otherwise return null.

Returns:
A list of extended Trie nodes if this node has extensions, null otherwise

Implements joshua.decoder.ff.tm.Trie.

Here is the call graph for this function:

Returns an iterator over the trie node's extensions with nonterminal labels.

Returns:

Implements joshua.decoder.ff.tm.Trie.

Retrieve the rules at the current node/state. The implementation of this method must adhere to the following laws:

  1. The return value is always non-null. The collection may be empty however.
  2. The collection must be empty if hasRules() is false, and must be non-empty if hasRules() is true.
  3. The collection must be sorted (at least as used by TMGrammar)

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.

Here is the caller graph for this function:

This returns a list of the rules, sorting them if necessary.

Implementations of this function should be synchronized.

Implements joshua.decoder.ff.tm.RuleCollection.

Here is the call 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

Implements joshua.decoder.ff.tm.RuleCollection.

Returns an iterator over the trie node's extensions with terminal labels.

Returns:

Implements joshua.decoder.ff.tm.Trie.

Returns whether matchOne(Symbol) could succeed for any symbol.

Returns:
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.

Returns:
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.

Here is the caller graph for this function:

Traverse one ply further down the trie. If there is no match, the result is null.

Parameters:
wordID
Returns:
Child node of this trie

Implements joshua.decoder.ff.tm.Trie.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation