|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.constraints.UnlexTreeConstraint
danbikel.parser.constraints.LexTreeConstraint
public class LexTreeConstraint
Specifies a node in a tree of constraints, to allow the decoder only to
pursue theories that are consistent with a particular head-lexicalized
tree.
Implementation note: The public constructor of this class expects a
Sexp
object representing an unlexicalized parse tree, which
is lexicalized using the current head finder.
Field Summary | |
---|---|
protected Word |
headWord
The head word associated with this constraint. |
Fields inherited from class danbikel.parser.constraints.UnlexTreeConstraint |
---|
children, end, label, parent, satisfied, start |
Constructor Summary | |
---|---|
protected |
LexTreeConstraint(LexTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx,
HeadFinder headFinder)
Constructs a tree of constraints that is isomorphic to the specified parse tree. |
|
LexTreeConstraint(Sexp tree)
Constructs a tree of constraints that is isomorphic to the specified parse tree. |
Method Summary | |
---|---|
boolean |
isLocallySatisfiedBy(Item item)
Returns whether the specified item satisfies the local information of this constraint node, regardless of this node's place in a tree structure of constraints. |
protected boolean |
isSatisfiedByPreterminal(CKYItem item)
Returns true if this constraint is locally satisfied by the specified item and if
this constraint's span matches that of the
specified item. |
Sexp |
toSexp()
Returns a symbolic expression version of the constraint tree rooted at this constraint. |
String |
toString()
A debugging method that returns a string representation of the information of this constraint. |
Methods inherited from class danbikel.parser.constraints.UnlexTreeConstraint |
---|
end, getChildren, getParent, hasBeenSatisfied, isLeaf, isSatisfiedBy, isViolatedBy, isViolatedByChild, label, spanMatches, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Word headWord
Constructor Detail |
---|
public LexTreeConstraint(Sexp tree)
tree
- the parse tree from which to construct an isomorphic tree
of LexTreeConstraint
nodesprotected LexTreeConstraint(LexTreeConstraint parent, Sexp tree, IntCounter currWordIdx, HeadFinder headFinder)
parent
- the parent constraint node of this node, or null
if this node is the root of the constraint treetree
- the (unlexicalized) parse tree from which to construct
an isomorphic tree of constraintscurrWordIdx
- the zero-based index of the current word, as determined
by the left-to-right, top-down traversal of the specified treeheadFinder
- the HeadFinder
instance to use to
lexicalize the specified parse treeMethod Detail |
---|
protected boolean isSatisfiedByPreterminal(CKYItem item)
true
if this constraint is locally satisfied by the specified item and if
this constraint's span matches that of the
specified item. This overridden definition is in stark contrast to that of
UnlexTreeConstraint
, where preterminals are always satisfied
by preterminal constraints, meaning that parts of speech are not
constrained.
isSatisfiedByPreterminal
in class UnlexTreeConstraint
item
- the item to be tested
true
if this constraint is locally satisfied by the specified item
and if this constraint's span matches
that of the specified item.public 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.
isLocallySatisfiedBy
in interface Constraint
isLocallySatisfiedBy
in class UnlexTreeConstraint
item
- the chart item to be tested against this constraint node
that is part of a tree of constraint nodes
public Sexp toSexp()
UnlexTreeConstraint
toSexp
in interface SexpConvertible
toSexp
in class UnlexTreeConstraint
public String toString()
toString
in class UnlexTreeConstraint
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |