## edu.stanford.nlp.trees.tregex
Class TregexPatternCompiler

    java.lang.Object
      edu.stanford.nlp.trees.tregex.TregexPatternCompiler

    public class TregexPatternCompiler

extends Object

A class for compiling TregexPatterns with specific HeadFinders and or basicCategoryFunctions.

Author:
  Galen Andrew

Field Summary
`static TregexPatternCompiler` `defaultCompiler`

Constructor Summary
`TregexPatternCompiler()`
`TregexPatternCompiler(Function<String,String> basicCatFunction)` A compiler that uses this basicCatFunction and the default headfinder.
`TregexPatternCompiler(HeadFinder headFinder)` A compiler that uses this HeadFinder and the default basicCategoryFunction
`TregexPatternCompiler(HeadFinder headFinder, Function<String,String> basicCatFunction)` A compiler that uses this HeadFinder and this basicCategoryFunction

Method Summary
`TregexPattern` `compile(String tregex)` Create a TregexPattern from this tregex string using the headFinder and basicCat function this TregexPatternCompiler was created with

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

Field Detail

### defaultCompiler

    public static TregexPatternCompiler defaultCompiler

Constructor Detail

### TregexPatternCompiler

    public TregexPatternCompiler()

### TregexPatternCompiler

    public TregexPatternCompiler(Function<String,String> basicCatFunction)

  A compiler that uses this basicCatFunction and the default headfinder.

  Parameters:
    `basicCatFunction` - the function mapping Strings to Strings

### TregexPatternCompiler

    public TregexPatternCompiler(HeadFinder headFinder)

  A compiler that uses this HeadFinder and the default basicCategoryFunction

  Parameters:
    `headFinder` - the HeadFinder

### TregexPatternCompiler

    public TregexPatternCompiler(HeadFinder headFinder,
                                 Function<String,String> basicCatFunction)

  A compiler that uses this HeadFinder and this basicCategoryFunction

  Parameters:
    `headFinder` - the HeadFinder
    `basicCatFunction` - hthe function mapping Strings to Strings

Method Detail

### compile

    public TregexPattern compile(String tregex)
                          throws ParseException

  Create a TregexPattern from this tregex string using the headFinder and basicCat function this TregexPatternCompiler was created with

  Parameters:
    `tregex` - the pattern to parse
  Returns:
    a new TregexPattern object based on this string
  Throws:
    `ParseException`

Stanford NLP Group