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 {@link Segment}, {@link ConstraintSpan}, and {@link ConstraintRule}interfaces are for defining an interchange format between a SegmentFileParser and the Chart class. These interfaces should not 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
@version $LastChangedDate: 2009-03-26 15:06:57 -0400 (Thu, 26 Mar 2009) $