Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.tools.GrammarPacker Class Reference
Collaboration diagram for joshua.tools.GrammarPacker:
[legend]

List of all members.

Classes

class  AlignmentBuffer
class  FeatureBuffer
class  PackingBuffer< T >
class  PackingFileTuple
class  PackingTrie< D extends PackingTrieValue >
interface  PackingTrieValue
class  SourceValue
class  TargetValue

Public Member Functions

 GrammarPacker (String config_filename, String grammar_filename, String alignments_filename) throws IOException
void pack () throws IOException

Static Public Member Functions

static void main (String[] args) throws IOException

Static Package Functions

 [static initializer]

Private Member Functions

void readConfig (String config_filename) throws IOException
void explore (LineReader grammar)
void binarize (LineReader grammar_reader, LineReader alignment_reader, Queue< PackingFileTuple > slices) throws IOException
PackingFileTuple flush (PackingTrie< SourceValue > source_trie, PackingTrie< TargetValue > target_trie, FeatureBuffer feature_buffer, AlignmentBuffer alignment_buffer, int id) throws IOException

Private Attributes

String grammar
boolean have_alignments
String alignments
QuantizerConfiguration quantization

Static Private Attributes

static final Logger logger = Logger.getLogger(GrammarPacker.class.getName())
static int SLICE_SIZE
static int DATA_SIZE_LIMIT
static int DATA_SIZE_ESTIMATE
static String WORKING_DIRECTORY

Constructor & Destructor Documentation

joshua.tools.GrammarPacker.GrammarPacker ( String  config_filename,
String  grammar_filename,
String  alignments_filename 
) throws IOException

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

joshua.tools.GrammarPacker.[static initializer] ( ) [static, package]
void joshua.tools.GrammarPacker.binarize ( LineReader  grammar_reader,
LineReader  alignment_reader,
Queue< PackingFileTuple slices 
) throws IOException [private]

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.tools.GrammarPacker.explore ( LineReader  grammar) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

PackingFileTuple joshua.tools.GrammarPacker.flush ( PackingTrie< SourceValue source_trie,
PackingTrie< TargetValue target_trie,
FeatureBuffer  feature_buffer,
AlignmentBuffer  alignment_buffer,
int  id 
) throws IOException [private]

Serializes the source, target and feature data structures into interlinked binary files. Target is written first, into a skeletal (node don't carry any data) upward-pointing trie, updating the linking source trie nodes with the position once it is known. Source and feature data are written simultaneously. The source structure is written into a downward-pointing trie and stores the rule's lhs as well as links to the target and feature stream. The feature stream is prompted to write out a block

Parameters:
source_trie
target_trie
feature_buffer
id
Exceptions:
IOException

Here is the call graph for this function:

Here is the caller graph for this function:

static void joshua.tools.GrammarPacker.main ( String[]  args) throws IOException [static]

Here is the call graph for this function:

void joshua.tools.GrammarPacker.pack ( ) throws IOException

Executes the packing.

Exceptions:
IOException

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.tools.GrammarPacker.readConfig ( String  config_filename) throws IOException [private]

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

final Logger joshua.tools.GrammarPacker.logger = Logger.getLogger(GrammarPacker.class.getName()) [static, private]