## edu.stanford.nlp.trees.tregex.tsurgeon
Class TsurgeonPattern

    java.lang.Object
      edu.stanford.nlp.trees.tregex.tsurgeon.TsurgeonPattern

Direct Known Subclasses:
  CoindexNodes

    public abstract class TsurgeonPattern

extends Object

An abstract class for patterns to manipulate `Tree`s when successfully matched on with a `TregexMatcher`.

Author:
  Roger Levy

Method Summary
`abstract Tree` `evaluate(Tree t, TregexMatcher m)` Evaluates the pattern against a `Tree` and a `TregexMatcher` that has been successfully matched against the tree.
`protected void` `setRoot(edu.stanford.nlp.trees.tregex.tsurgeon.TsurgeonPatternRoot root)`
`String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### setRoot

    protected void setRoot(edu.stanford.nlp.trees.tregex.tsurgeon.TsurgeonPatternRoot root)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### evaluate

    public abstract Tree evaluate(Tree t,
                                  TregexMatcher m)

  Evaluates the pattern against a `Tree` and a `TregexMatcher` that has been successfully matched against the tree.

  Parameters:
    `t` - the `Tree` that has been matched upon; typically this tree will be destructively modified.
    `m` - the successfully matched `TregexMatcher`
  Returns:
    some node in the tree; depends on implementation and use of the specific subclass.

Stanford NLP Group