org.cogroo.tools.shallowparser
Class ShallowParserContextGenerator

java.lang.Object
  extended by org.cogroo.tools.shallowparser.ShallowParserContextGenerator
All Implemented Interfaces:
opennlp.tools.util.BeamSearchContextGenerator<WordTag>, ChunkerContextGenerator

public class ShallowParserContextGenerator
extends Object
implements ChunkerContextGenerator


Constructor Summary
ShallowParserContextGenerator()
           
 
Method Summary
 String[] getContext(int i, String[] toks, String[] tags, String[] chks, String[] preds)
           
 String[] getContext(int index, WordTag[] sequence, String[] priorDecisions)
          Returns the contexts for chunking of the specified index.
 String[] getContext(int index, WordTag[] sequence, String[] priorDecisions, Object[] additionalContext)
           
static opennlp.tools.util.Span[] phrasesAsSpanList(String[] aChunksIn)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShallowParserContextGenerator

public ShallowParserContextGenerator()
Method Detail

getContext

public String[] getContext(int index,
                           WordTag[] sequence,
                           String[] priorDecisions,
                           Object[] additionalContext)
Specified by:
getContext in interface opennlp.tools.util.BeamSearchContextGenerator<WordTag>

getContext

public String[] getContext(int index,
                           WordTag[] sequence,
                           String[] priorDecisions)
Description copied from interface: ChunkerContextGenerator
Returns the contexts for chunking of the specified index.

Specified by:
getContext in interface ChunkerContextGenerator
Parameters:
index - The index of the token in the specified toks array for which the context should be constructed.
priorDecisions - The previous decisions made in the taging of this sequence. Only indices less than i will be examined.
Returns:
An array of predictive contexts on which a model basis its decisions.

getContext

public String[] getContext(int i,
                           String[] toks,
                           String[] tags,
                           String[] chks,
                           String[] preds)

phrasesAsSpanList

public static opennlp.tools.util.Span[] phrasesAsSpanList(String[] aChunksIn)


Copyright © 2012-2013 CoGrOO. All Rights Reserved.