|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.trees.tregex.TregexMatcher
public abstract class TregexMatcher
A TregexMatcher can be used to match a TregexPattern
against a Tree
.
Usage should to be the same as Matcher
.
Method Summary | |
---|---|
boolean |
find()
Find the next match of the pattern on the tree |
boolean |
findNextMatchingNode()
Find the next match of the pattern on the tree such that the matching node (that is, the tree node matching the root node of the pattern) differs from the previous matching node. |
abstract Tree |
getMatch()
Get the last matching tree -- that is, the tree node that matches the root node of the pattern. |
Tree |
getNode(java.lang.String name)
Returns the node labeled with name in the pattern. |
abstract boolean |
matches()
Does the pattern match the tree? It's actually closer to java.util.regex's "lookingAt" in that the root of the tree has to match the root of the pattern but the whole tree does not have to be "accounted for". |
boolean |
matchesAt(Tree node)
Rests the matcher and tests if it matches on the tree when rooted at node . |
void |
reset()
Resets the matcher so that its search starts over. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void reset()
public abstract boolean matches()
public boolean matchesAt(Tree node)
node
.
node
- The node where the match is checked
public abstract Tree getMatch()
public boolean find()
public boolean findNextMatchingNode()
public Tree getNode(java.lang.String name)
name
in the pattern.
name
- the name of the node, specified in the pattern.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |