Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.nlp.trees
Class CollocationFinder

    java.lang.Object
      edu.stanford.nlp.trees.CollocationFinder

    public class CollocationFinder

extends Object

Finds WordNet collocations in parse trees. It can restructure collocations as single words, where the original words are joined by underscores. You can test performance by using the "collocations" option to the TreePrint class.

Author:
  Chris Cox, Eric Yeh

Constructor Summary
`CollocationFinder(Tree t, WordNetConnection w)` Construct a new `CollocationFinder` over the `Tree` t.
`CollocationFinder(Tree t, WordNetConnection w, HeadFinder hf)` Construct a new `CollocationFinder` over the `Tree` t.
`CollocationFinder(Tree t, WordNetConnection w, HeadFinder hf, boolean threadSafe)` Construct a new `CollocationFinder` over the `Tree` t.

Method Summary
`Tree` | `getMangledTree()` Returns the "collocations included" parse tree.
`void` | `PrintCollocationStrings(PrintWriter pw)` Prints the collocations found in this `Tree` as strings.

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

Constructor Detail

### CollocationFinder

    public CollocationFinder(Tree t,
                             WordNetConnection w)

  Construct a new `CollocationFinder` over the `Tree` t. The default `HeadFinder` is a `CollinsHeadFinder`.

  Parameters:
    `t` - parse tree
    `w` - wordnet connection

### CollocationFinder

    public CollocationFinder(Tree t,
                             WordNetConnection w,
                             HeadFinder hf)

  Construct a new `CollocationFinder` over the `Tree` t.

  Parameters:
    `t` - parse tree
    `w` - wordnet connection
    `hf` - `HeadFinder` to use

### CollocationFinder

    public CollocationFinder(Tree t,
                             WordNetConnection w,
                             HeadFinder hf,
                             boolean threadSafe)

  Construct a new `CollocationFinder` over the `Tree` t.

  Parameters:
    `t` - parse tree
    `w` - wordnet connection
    `hf` - `HeadFinder` to use
    `threadSafe` - whether to include synchronization, etc.

Method Detail

### getMangledTree

    public Tree getMangledTree()

  Returns the "collocations included" parse tree.

  Returns:
    the mangled tree which applies collocations found in this object.

### PrintCollocationStrings

    public void PrintCollocationStrings(PrintWriter pw)

  Prints the collocations found in this `Tree` as strings. Each is followed by its boundary constituent indices in the original tree.
  Example: `throw_up (2,3)`
  `came_up_with (7,9)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Stanford NLP Group