opennlp.tools.parser.chunking
Class Parser

java.lang.Object
  extended by opennlp.tools.parser.AbstractBottomUpParser
      extended by opennlp.tools.parser.chunking.Parser
All Implemented Interfaces:
Parser

public class Parser
extends AbstractBottomUpParser

Class for a shift reduce style parser based on Adwait Ratnaparkhi's 1998 thesis.


Field Summary
 
Fields inherited from class opennlp.tools.parser.AbstractBottomUpParser
chunker, COMPLETE, completeParses, CONT, createDerivationString, debugOn, defaultAdvancePercentage, defaultBeamSize, headRules, INC_NODE, INCOMPLETE, K, M, ndh, odh, OTHER, punctSet, Q, reportFailedParse, START, tagger, TOK_NODE, TOP_NODE, ZERO
 
Constructor Summary
Parser(opennlp.model.MaxentModel buildModel, opennlp.model.MaxentModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules)
          Deprecated. 
Parser(opennlp.model.MaxentModel buildModel, opennlp.model.MaxentModel checkModel, POSTagger tagger, Chunker chunker, HeadRules headRules, int beamSize, double advancePercentage)
          Deprecated. 
Parser(ParserModel model)
           
Parser(ParserModel model, int beamSize, double advancePercentage)
           
 
Method Summary
protected  Parse[] advanceParses(Parse p, double probMass)
          Advances the specified parse and returns the an array advanced parses whose probability accounts for more than the specified amount of probability mass.
protected  void advanceTop(Parse p)
          Adds the "TOP" node to the specified parse.
static void main(String[] args)
          Deprecated. 
static opennlp.model.AbstractModel train(opennlp.model.EventStream es, int iterations, int cut)
          Deprecated. 
static ParserModel train(String languageCode, ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cut)
           
 
Methods inherited from class opennlp.tools.parser.AbstractBottomUpParser
advanceChunks, advanceTags, buildDictionary, collapsePunctuation, mapParseIndex, parse, parse, setErrorReporting, setParents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(ParserModel model,
              int beamSize,
              double advancePercentage)

Parser

public Parser(ParserModel model)

Parser

@Deprecated
public Parser(opennlp.model.MaxentModel buildModel,
                         opennlp.model.MaxentModel checkModel,
                         POSTagger tagger,
                         Chunker chunker,
                         HeadRules headRules)
Deprecated. 

Creates a new parser using the specified models and head rules.

Parameters:
buildModel - The model to assign constituent labels.
checkModel - The model to determine a constituent is complete.
tagger - The model to assign pos-tags.
chunker - The model to assign flat constituent labels.
headRules - The head rules for head word perculation.

Parser

@Deprecated
public Parser(opennlp.model.MaxentModel buildModel,
                         opennlp.model.MaxentModel checkModel,
                         POSTagger tagger,
                         Chunker chunker,
                         HeadRules headRules,
                         int beamSize,
                         double advancePercentage)
Deprecated. 

Creates a new parser using the specified models and head rules using the specified beam size and advance percentage.

Parameters:
buildModel - The model to assign constituent labels.
checkModel - The model to determine a constituent is complete.
tagger - The model to assign pos-tags.
chunker - The model to assign flat constituent labels.
headRules - The head rules for head word perculation.
beamSize - The number of different parses kept during parsing.
advancePercentage - The minimal amount of probability mass which advanced outcomes must represent. Only outcomes which contribute to the top "advancePercentage" will be explored.
Method Detail

advanceTop

protected void advanceTop(Parse p)
Description copied from class: AbstractBottomUpParser
Adds the "TOP" node to the specified parse.

Specified by:
advanceTop in class AbstractBottomUpParser
Parameters:
p - The complete parse.

advanceParses

protected Parse[] advanceParses(Parse p,
                                double probMass)
Description copied from class: AbstractBottomUpParser
Advances the specified parse and returns the an array advanced parses whose probability accounts for more than the specified amount of probability mass.

Specified by:
advanceParses in class AbstractBottomUpParser
Parameters:
p - The parse to advance.
probMass - The amount of probability mass that should be accounted for by the advanced parses.

train

@Deprecated
public static opennlp.model.AbstractModel train(opennlp.model.EventStream es,
                                                           int iterations,
                                                           int cut)
                                         throws IOException
Deprecated. 

Throws:
IOException

train

public static ParserModel train(String languageCode,
                                ObjectStream<Parse> parseSamples,
                                HeadRules rules,
                                int iterations,
                                int cut)
                         throws IOException
Throws:
IOException

main

@Deprecated
public static void main(String[] args)
                 throws IOException,
                        InvalidFormatException
Deprecated. 

Throws:
IOException
InvalidFormatException


Copyright © 2010. All Rights Reserved.