org.cleartk.syntax.opennlp
Class ParserAnnotator<TOKEN_TYPE extends org.apache.uima.jcas.tcas.Annotation,SENTENCE_TYPE extends org.apache.uima.jcas.tcas.Annotation,TOP_NODE_TYPE extends org.apache.uima.jcas.tcas.Annotation>

java.lang.Object
  extended by org.apache.uima.analysis_component.AnalysisComponent_ImplBase
      extended by org.apache.uima.analysis_component.Annotator_ImplBase
          extended by org.apache.uima.analysis_component.JCasAnnotator_ImplBase
              extended by org.uimafit.component.JCasAnnotator_ImplBase
                  extended by org.cleartk.syntax.opennlp.parser.ParserWrapper_ImplBase<TOKEN_TYPE,SENTENCE_TYPE,opennlp.tools.parser.Parse,TOP_NODE_TYPE>
                      extended by org.cleartk.syntax.opennlp.ParserAnnotator<TOKEN_TYPE,SENTENCE_TYPE,TOP_NODE_TYPE>
All Implemented Interfaces:
org.apache.uima.analysis_component.AnalysisComponent

public class ParserAnnotator<TOKEN_TYPE extends org.apache.uima.jcas.tcas.Annotation,SENTENCE_TYPE extends org.apache.uima.jcas.tcas.Annotation,TOP_NODE_TYPE extends org.apache.uima.jcas.tcas.Annotation>
extends ParserWrapper_ImplBase<TOKEN_TYPE,SENTENCE_TYPE,opennlp.tools.parser.Parse,TOP_NODE_TYPE>


Copyright (c) 2010, Regents of the University of Colorado
All rights reserved. This class provides a uima wrapper for the OpenNLP chunking parser that is specific to the ClearTK type system found in the cleartk-syntax project. However, by specifying your own implementations of InputTypesHelper and OutputTypesHelper you can use your own types for sentences, tokens, and part-of-speech tags.

The default behavior of the OpenNLP chunking parser is to perform part-of-speech tagging in addition to syntactic parsing. This may not be desirable in some situations where you have already populated the CAS with part-of-speech tags. In such cases you can set the configuration parameter with the name PARAM_USE_TAGS_FROM_CAS to "true". This will bypass the OpenNLP's part-of-speech tagger and instead use tags from the CAS as defined by the implementation of InputTypesHelper you are using.

Author:
Philipp Wetzler, Philip Ogren.

Field Summary
protected  CasPosTagger<TOKEN_TYPE,SENTENCE_TYPE> casTagger
           
static float DEFAULT_ADVANCE_PERCENTAGE
           
static int DEFAULT_BEAM_SIZE
           
static String DEFAULT_PARSER_MODEL_PATH
           
static String PARAM_ADVANCE_PERCENTAGE
           
static String PARAM_BEAM_SIZE
           
static String PARAM_PARSER_MODEL_PATH
           
static String PARAM_USE_TAGS_FROM_CAS
           
protected  Parser parser
           
 
Fields inherited from class org.cleartk.syntax.opennlp.parser.ParserWrapper_ImplBase
inputTypesHelper, inputTypesHelperClassName, outputTypesHelper, outputTypesHelperClassName, PARAM_INPUT_TYPES_HELPER_CLASS_NAME, PARAM_OUTPUT_TYPES_HELPER_CLASS_NAME
 
Constructor Summary
ParserAnnotator()
           
 
Method Summary
static org.apache.uima.analysis_engine.AnalysisEngineDescription getDescription()
           
 void initialize(org.apache.uima.UimaContext ctx)
           
 void process(org.apache.uima.jcas.JCas jCas)
           
protected  void setPOSTags(opennlp.tools.parser.Parse p, Iterator<TOKEN_TYPE> tokenIterator, org.apache.uima.jcas.JCas view)
           
 
Methods inherited from class org.uimafit.component.JCasAnnotator_ImplBase
getLogger
 
Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
getRequiredCasInterface, process
 
Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase
getCasInstancesRequired, hasNext, next
 
Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
batchProcessComplete, collectionProcessComplete, destroy, getContext, getResultSpecification, reconfigure, setResultSpecification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARSER_MODEL_PATH

public static final String DEFAULT_PARSER_MODEL_PATH
See Also:
Constant Field Values

DEFAULT_BEAM_SIZE

public static final int DEFAULT_BEAM_SIZE
See Also:
Constant Field Values

DEFAULT_ADVANCE_PERCENTAGE

public static final float DEFAULT_ADVANCE_PERCENTAGE
See Also:
Constant Field Values

PARAM_PARSER_MODEL_PATH

public static final String PARAM_PARSER_MODEL_PATH

PARAM_BEAM_SIZE

public static final String PARAM_BEAM_SIZE

PARAM_ADVANCE_PERCENTAGE

public static final String PARAM_ADVANCE_PERCENTAGE

PARAM_USE_TAGS_FROM_CAS

public static final String PARAM_USE_TAGS_FROM_CAS

parser

protected Parser parser

casTagger

protected CasPosTagger<TOKEN_TYPE extends org.apache.uima.jcas.tcas.Annotation,SENTENCE_TYPE extends org.apache.uima.jcas.tcas.Annotation> casTagger
Constructor Detail

ParserAnnotator

public ParserAnnotator()
Method Detail

initialize

public void initialize(org.apache.uima.UimaContext ctx)
                throws org.apache.uima.resource.ResourceInitializationException
Specified by:
initialize in interface org.apache.uima.analysis_component.AnalysisComponent
Overrides:
initialize in class ParserWrapper_ImplBase<TOKEN_TYPE extends org.apache.uima.jcas.tcas.Annotation,SENTENCE_TYPE extends org.apache.uima.jcas.tcas.Annotation,opennlp.tools.parser.Parse,TOP_NODE_TYPE extends org.apache.uima.jcas.tcas.Annotation>
Throws:
org.apache.uima.resource.ResourceInitializationException

process

public void process(org.apache.uima.jcas.JCas jCas)
             throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
Specified by:
process in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException

setPOSTags

protected void setPOSTags(opennlp.tools.parser.Parse p,
                          Iterator<TOKEN_TYPE> tokenIterator,
                          org.apache.uima.jcas.JCas view)

getDescription

public static org.apache.uima.analysis_engine.AnalysisEngineDescription getDescription()
                                                                                throws org.apache.uima.resource.ResourceInitializationException
Throws:
org.apache.uima.resource.ResourceInitializationException


Copyright © 2013. All Rights Reserved.