|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Classes | |
| class | Span |
Public Member Functions | |
| ManualConstraintsHandler (Chart chart, Grammar grammarForConstructManualRule, List< ConstraintSpan > constraintSpans) | |
| List< Rule > | filterRules (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, ConstraintSpan > | constraintSpansForFiltering |
| ArrayList< Span > | spansWithHardRuleConstraint |
| Chart | chart |
| Grammar | grammarForConstructManualRule |
Static Private Attributes | |
| static final Logger | logger = Logger.getLogger(ManualConstraintsHandler.class.getName()) |
| joshua.decoder.chart_parser.ManualConstraintsHandler.ManualConstraintsHandler | ( | Chart | chart, |
| Grammar | grammarForConstructManualRule, | ||
| List< ConstraintSpan > | constraintSpans | ||
| ) |
| boolean joshua.decoder.chart_parser.ManualConstraintsHandler.containHardRuleConstraint | ( | int | startSpan, |
| int | endSpan | ||
| ) |
if a span is within the coverage of a hard rule constraint, then this span will be only allowed to use the mannual rules
| 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.
| String joshua.decoder.chart_parser.ManualConstraintsHandler.getSpanSignature | ( | int | i, |
| int | j | ||
| ) | [private] |
| void joshua.decoder.chart_parser.ManualConstraintsHandler.initialize | ( | List< ConstraintSpan > | constraintSpans | ) | [private] |
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
| boolean joshua.decoder.chart_parser.ManualConstraintsHandler.shouldSurvive | ( | ConstraintRule | cRule, |
| Rule | gRule | ||
| ) |
should we filter out the gRule based on the manually provided constraint cRule
HashMap<String, ConstraintSpan> joshua.decoder.chart_parser.ManualConstraintsHandler.constraintSpansForFiltering [private] |
Grammar joshua.decoder.chart_parser.ManualConstraintsHandler.grammarForConstructManualRule [private] |
final Logger joshua.decoder.chart_parser.ManualConstraintsHandler.logger = Logger.getLogger(ManualConstraintsHandler.class.getName()) [static, private] |
ArrayList<Span> joshua.decoder.chart_parser.ManualConstraintsHandler.spansWithHardRuleConstraint [private] |