|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConstraintSet
Specifies methods for searching a set of parsing constraints either for satisfaction or violation of a particular chart item, as well as predicates describing properties of a constraint set and other methods to access various distinguished constraints in a set.
Constraint
,
Item
Method Summary | |
---|---|
Constraint |
constraintSatisfying(Item item)
Returns the first constraint in this set that is found that the specified item satisfies. |
boolean |
findAtLeastOneSatisfying()
Returns true if at least one satisfying constraint should
be found for every chart item, false otherwise. |
boolean |
findNoViolations()
Returns true if every chart item generated must violate
none of the constraints in this constraint set, false
otherwise. |
boolean |
hasTreeStructure()
Returns true if this constraint set forms a tree structure. |
boolean |
isViolatedBy(Item item)
Returns whether this constraint set is violated by the specified item (optional operation). |
List |
leaves()
Returns a list containing the leaves of a tree-structured set of constraints (optional operation). |
Constraint |
root()
Returns the root constraint in a set if the set forms a tree structure (optional operation). |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
boolean hasTreeStructure()
true
if this constraint set forms a tree structure.
The return value of this method for an implementation of this interface
informs the Decoder
using this ConstraintSet
that it can optimize constrain-parsing by tightly coupling
it with its bottom-up decoding algorithm.
true
if this constraint set forms a tree structure.boolean findAtLeastOneSatisfying()
true
if at least one satisfying constraint should
be found for every chart item, false
otherwise. If this
method returns true
, each chart item's satisfying constraint
should be "attached" via its
Item.setConstraint(Constraint)
method.
constraintSatisfying(Item)
boolean findNoViolations()
true
if every chart item generated must violate
none of the constraints in this constraint set, false
otherwise. Put procedurally, whenever a new chart item is generated,
all constraints in this set must be checked for violations (although
in practice, there may often be efficient ways to avoid an exhaustive
search). This method should return false
if an
implementation inherently guarantees consistency among its constraints,
thereby obviating the need for the decoder to check for violations
for every chart item generated, as is the case, for example, with the
UnlexTreeConstraintSet
class.
isViolatedBy(Item)
Constraint constraintSatisfying(Item item)
item
- the item for which a satisfying constraint is to be found
boolean isViolatedBy(Item item)
true
if there is at least one constraint
in the set for which Constraint.isViolatedBy(Item)
returns
true
, but such behavior is not required. For example,
this method may return false
simply because the specified
item fails to satisfy certain constraints in this constraint set.
item
- the item to be tested for violations
true
if this constraint set is violated by the
specified item, false
otherwise.Constraint root()
hasTreeStructure()
List leaves()
hasTreeStructure()
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |