|
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.PartialLexTreeConstraint
public class PartialLexTreeConstraint
Represents a node in a parsing constraint tree, that requires an associated
chart item to have the same label, head word and head tag. The crucial
difference between this type of constraint and LexTreeConstraint
is that the latter uses the Word.equals(java.lang.Object)
method to determine
lexicalized node equality, whereas this constraint explicitly compares only
the corresponding Word.word()
and Word.tag()
fields
of head words, making this type of constraint suitable when the head
word objects are subclasses of Word
that include more
information (such as, for example, WordNet synsets).
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 |
PartialLexTreeConstraint(PartialLexTreeConstraint parent,
Sexp tree,
IntCounter currWordIdx,
HeadFinder headFinder)
A helper constructor used by PartialLexTreeConstraint(Sexp)
to construct an entire tree of constraints. |
|
PartialLexTreeConstraint(Sexp tree)
Constructs a tree of constraints given the specified parse tree. |
Method Summary | |
---|---|
boolean |
isLocallySatisfiedBy(Item item)
Returns whether the specified chart item satisfies the local information contained in this constraint (span and nonterminal label). |
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()
Returns a human-readable string representation of this constraint for debugging. |
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 PartialLexTreeConstraint(Sexp tree)
tree
- protected PartialLexTreeConstraint(PartialLexTreeConstraint parent, Sexp tree, IntCounter currWordIdx, HeadFinder headFinder)
PartialLexTreeConstraint(Sexp)
to construct an entire tree of constraints.
parent
- the parent of this constraint being constructed, or
null
if this constraint is the root of a tree of
constraintstree
- the root of the subtree for which to construct a
constraintcurrWordIdx
- the current 0-based word index of the left-most
word of the specified subtree (tree
)headFinder
- the head finder to be used for lexicalizing the
specified tree (typically Language.headFinder()
)Method 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)
UnlexTreeConstraint
isLocallySatisfiedBy
in interface Constraint
isLocallySatisfiedBy
in class UnlexTreeConstraint
item
- the chart item to be tested against this constraint
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 |