public class PunctCountingTreeVisitor extends java.lang.Object implements TreeVisitor
Constructor and Description |
---|
PunctCountingTreeVisitor()
Default to only looking for PUNC nodes.
|
PunctCountingTreeVisitor(java.lang.String regex)
Specify what regex to match for punc nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
countAnywhere(Tree t) |
void |
countFinal(Tree t) |
void |
countNode(Tree t,
IntCounter<java.lang.String> counter) |
static void |
main(java.lang.String[] args) |
void |
visitTree(Tree t)
Does whatever one needs to do to a particular parse tree.
|
public PunctCountingTreeVisitor()
public PunctCountingTreeVisitor(java.lang.String regex)
public void visitTree(Tree t)
TreeVisitor
visitTree
in interface TreeVisitor
t
- A tree. Classes implementing this interface can assume
that the tree passed in is not null
.public void countAnywhere(Tree t)
public void countFinal(Tree t)
public void countNode(Tree t, IntCounter<java.lang.String> counter)
public static void main(java.lang.String[] args)