org.cogroo.tools.chunker2
Class DefaultChunkerContextGenerator

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

public class DefaultChunkerContextGenerator
extends Object
implements ChunkerContextGenerator

Features based on chunking model described in Fei Sha and Fernando Pereira. Shallow parsing with conditional random fields. In Proceedings of HLT-NAACL 2003. Association for Computational Linguistics, 2003.


Constructor Summary
DefaultChunkerContextGenerator()
          Creates the default context generator a chunker.
 
Method Summary
 String[] getContext(int i, String[] toks, String[] tags, 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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChunkerContextGenerator

public DefaultChunkerContextGenerator()
Creates the default context generator a chunker.

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[] preds)


Copyright © 2012-2013 CoGrOO. All Rights Reserved.