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

List of all members.

Classes

class  Span

Public Member Functions

 ManualConstraintsHandler (Chart chart, Grammar grammarForConstructManualRule, List< ConstraintSpan > constraintSpans)
List< RulefilterRules (int i, int j, List< Rule > rulesIn)
boolean shouldSurvive (ConstraintRule cRule, Rule gRule)
boolean containHardRuleConstraint (int startSpan, int endSpan)

Private Member Functions

void initialize (List< ConstraintSpan > constraintSpans)
String getSpanSignature (int i, int j)

Private Attributes

HashMap< String, ConstraintSpanconstraintSpansForFiltering
ArrayList< Span > spansWithHardRuleConstraint
Chart chart
Grammar grammarForConstructManualRule

Static Private Attributes

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

Detailed Description

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
LastChangedDate:
2009-12-31 11:37:41 -0500

Constructor & Destructor Documentation

joshua.decoder.chart_parser.ManualConstraintsHandler.ManualConstraintsHandler ( Chart  chart,
Grammar  grammarForConstructManualRule,
List< ConstraintSpan constraintSpans 
)

Here is the call graph for this function:


Member Function Documentation

if a span is within the coverage of a hard rule constraint, then this span will be only allowed to use the mannual rules

Here is the caller graph for this function:

List<Rule> joshua.decoder.chart_parser.ManualConstraintsHandler.filterRules ( int  i,
int  j,
List< Rule rulesIn 
)

if there are any LHS or RHS constraints for a span, then all the applicable grammar rules in that span will have to pass the filter.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Note that manual constraints or OOV handling is not part of seeding

(1) add manual rule (only allow flat rules) into the chart as constraints (2) add RHS or LHS constraint into constraintSpansForFiltering (3) add span signature into setOfSpansWithHardRuleConstraint; if the span contains a hard "RULE" constraint

Note that LHS and RHS constraints are always hard, while Rule constraint can be soft or hard

If the RULE constraint is hard, then we should filter all out all consituents (within this span), which are contructed from regular grammar

Here is the call graph for this function:

Here is the caller graph for this function:

should we filter out the gRule based on the manually provided constraint cRule

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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