Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.segment_file.ConstraintSpan Interface Reference

List of all members.

Public Member Functions

int start ()
int end ()
boolean isHard ()
List< ConstraintRulerules ()

Detailed Description

This interface represents a collection of constraints for a given span in the associated segment. Intuitively, each constraint corresponds to one or more items in the chart for parsing, except that we pre-seed the chart with these items before beginning the parsing algorithm. Some constraints can be "hard", in which case the regular grammar is not consulted for these spans. It is an error to have hard constraints for overlapping spans.

Indices for the span boundaries mark the transitions between words. Thus, the 0 index occurs before the first word, the 1 index occurs between the first and second words, 2 is between the second and third, etc. Consequently, it is an error for the end index to be equal to or less than the start index. It is also an error to have negative indices or to have indices larger than the count of words in the segment. Clients may assume that no ConstraintSpan objects are constructed which violate these laws.

The Segment, ConstraintSpan, and ConstraintRule interfaces are for defining an interchange format between a SegmentFileParser and the Chart class. These interfaces <emph>should not</emph> be used internally by the Chart. The objects returned by a SegmentFileParser will not be optimal for use during decoding. The Chart should convert each of these objects into its own internal representation during construction. That is the contract described by these interfaces.

Author:
wren ng thornton wren@.nosp@m.user.nosp@m.s.sou.nosp@m.rcef.nosp@m.orge..nosp@m.net
Version:
LastChangedDate:
2009-03-26 15:06:57 -0400 (Thu, 26 Mar 2009)

Member Function Documentation

Return the ending index of the span covered by this constraint. Clients may assume this.end() >= 1 + this.start().

Return whether this is a hard constraint which should override the grammar. This value only really matters for sets of RULE type constraints.

Return a collection of the "rules" for this constraint span.

This return type is suboptimal for some SegmentFileParsers. It should be an java.util.Iterator instead in order to reduce the coupling between this class and Chart. See the note above about the fact that this interface should not be used internally by the Chart class because it will not be performant.

Here is the caller graph for this function:

Return the starting index of the span covered by this constraint.