|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Constraint
Specifies methods to check a chart item's satisfaction or violation of a parsing constraint. A simple type of constraint, for example, might only allow a chart item that is consistent with a particular bracketing. More specific constraints might impose a specific derivation when decoding, for example, so as to guarantee that the tree that gets built is homologous to a particular labeled, bracketed tree.
ConstraintSet
,
Item
Method Summary | |
---|---|
Constraint |
getParent()
Gets the parent constraint of this constraint (optional operation). |
boolean |
hasBeenSatisfied()
Returns whether this constraint has been satisfied (optional operation). |
boolean |
isLeaf()
Returns true if this constraint is part of a tree structure of constraints and is a leaf (optional operation). |
boolean |
isLocallySatisfiedBy(Item item)
Returns whether the specified item satisfies the local information of the constraint node, regardless of its place in a tree structure of constraints (optional operation). |
boolean |
isSatisfiedBy(Item item)
Returns whether the specified item satisfies this constraint (optional operation). |
boolean |
isViolatedBy(Item item)
Returns whether the specified item violates this constraint (optional operation). |
boolean |
isViolatedByChild(Item childItem)
Returns whether the specified child item violates this constraint (optional operation). |
Method Detail |
---|
boolean isLeaf()
ConstraintSet.hasTreeStructure()
Constraint getParent()
ConstraintSet.hasTreeStructure()
boolean isSatisfiedBy(Item item)
true
if and only if the entire subtree represented by the
specified item satisfies the homologous subtree of this constraint and
its descendants.
item
- the item to test
boolean hasBeenSatisfied()
boolean isLocallySatisfiedBy(Item item)
c
, this
method may be used to determine if some proposed parent item
p
locally satisfies the information contained in
c.getConstraint().getParent()
. That is, if
c.getConstraint().getParent().isLocallySatisfiedBy(p)returns
true
, then theories building on the proposed
parent item p
should be pursued. Local constraint
information may include, for example, a nonterminal label or span
information.
item
-
boolean isViolatedBy(Item item)
item
- the item to test
boolean isViolatedByChild(Item childItem)
true
regardless of the value of the argument.
childItem
- the child item to test
ConstraintSet.hasTreeStructure()
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |