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

List of all members.

Public Member Functions

 Chart (Sentence sentence, List< FeatureFunction > featureFunctions, List< StateComputer > stateComputers, Grammar[] grammars, boolean useMaxLMCostForOOV, String goalSymbol)
void setGoalSymbolID (int i)
HyperGraph expand ()
Cell getCell (int i, int j)
void addAxiom (int i, int j, Rule rule, SourcePath srcPath)

Package Attributes

int nPreprunedEdges = 0
int nPreprunedFuzz1 = 0
int nPreprunedFuzz2 = 0
int nPrunedItems = 0
int nMerged = 0
int nAdded = 0
int nDotitemAdded = 0
int nCalledComputeNode = 0
int segmentID

Private Member Functions

void completeSpan (int i, int j)
void logStatistics (Level level)
int addUnaryNodes (Grammar[] grs, int i, int j)
void completeCell (int i, int j, DotNode dotNode, List< Rule > sortedRules, int arity, SourcePath srcPath)

Private Attributes

Cell[][] cells
int sourceLength
List< FeatureFunctionfeatureFunctions
List< StateComputer > stateComputers
Grammar[] grammars
DotChart[] dotcharts
Cell goalBin
int goalSymbolID = -1
Lattice< Integer > inputLattice
SyntaxTree parseTree
Combiner combiner = null
ManualConstraintsHandler manualConstraintsHandler

Static Private Attributes

static final Logger logger = Logger.getLogger(Chart.class.getName())

Detailed Description

Chart class this class implements chart-parsing: (1) seeding the chart (2) cky main loop over bins, (3) identify applicable rules in each bin

Note: the combination operation will be done in Cell

Signatures of class: Cell: i, j SuperNode (used for CKY check): i,j, lhs HGNode ("or" node): i,j, lhs, edge ngrams HyperEdge ("and" node)

index of sentences: start from zero index of cell: cell (i,j) represent span of words indexed [i,j-1] where i is in [0,n-1] and j is in [1,n]

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Matt Post post@.nosp@m.jhu..nosp@m.edu

Constructor & Destructor Documentation

joshua.decoder.chart_parser.Chart.Chart ( Sentence  sentence,
List< FeatureFunction featureFunctions,
List< StateComputer >  stateComputers,
Grammar[]  grammars,
boolean  useMaxLMCostForOOV,
String  goalSymbol 
)

Here is the call graph for this function:


Member Function Documentation

void joshua.decoder.chart_parser.Chart.addAxiom ( int  i,
int  j,
Rule  rule,
SourcePath  srcPath 
)

axiom is for rules with zero-arity

Here is the call graph for this function:

Here is the caller graph for this function:

int joshua.decoder.chart_parser.Chart.addUnaryNodes ( Grammar[]  grs,
int  i,
int  j 
) [private]

agenda based extension: this is necessary in case more than two unary rules can be applied in topological order s->x; ss->s for unary rules like s->x, once x is complete, then s is also complete

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.chart_parser.Chart.completeCell ( int  i,
int  j,
DotNode  dotNode,
List< Rule sortedRules,
int  arity,
SourcePath  srcPath 
) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.chart_parser.Chart.completeSpan ( int  i,
int  j 
) [private]

Construct the hypergraph with the help from DotChart.

Here is the call graph for this function:

Here is the caller graph for this function:

a parser that can handle: - multiple grammars - on the fly binarization - unary rules (without cycle)

each dotChart can act individually (without consulting other dotCharts) because it either consumes the source input or the complete nonTerminals, which are both grammar-independent

Cube-pruning requires the nodes being sorted, when prunning for later/wider cell. Cuebe-pruning will see superNode, which contains a list of nodes. getSortedNodes() will make the nodes in the superNode get sorted

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

void joshua.decoder.chart_parser.Chart.logStatistics ( Level  level) [private]

Here is the caller graph for this function:

Manually set the goal symbol ID. The constructor expects a String representing the goal symbol, but there may be time (say, for example, in the second pass of a synchronous parse) where we want to set the goal symbol to a particular ID (regardless of String representation).

This method should be called before expanding the chart, as chart expansion depends on the goal symbol ID.

Parameters:
ithe id of the goal symbol to use

Here is the caller graph for this function:


Member Data Documentation

final Logger joshua.decoder.chart_parser.Chart.logger = Logger.getLogger(Chart.class.getName()) [static, private]

how many items have been pruned away because its cost is greater than the cutoff in calling chart.add_deduction_in_chart()

List<StateComputer> joshua.decoder.chart_parser.Chart.stateComputers [private]