org.cogroo.tools.shallowparser
Class ShallowParserContextGenerator
java.lang.Object
org.cogroo.tools.shallowparser.ShallowParserContextGenerator
- All Implemented Interfaces:
- opennlp.tools.util.BeamSearchContextGenerator<WordTag>, ChunkerContextGenerator
public class ShallowParserContextGenerator
- extends Object
- implements ChunkerContextGenerator
ShallowParserContextGenerator
public ShallowParserContextGenerator()
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.