opennlp.tools.postag
Class DefaultPOSContextGenerator

java.lang.Object
  extended by opennlp.tools.postag.DefaultPOSContextGenerator
All Implemented Interfaces:
POSContextGenerator, BeamSearchContextGenerator

public class DefaultPOSContextGenerator
extends java.lang.Object
implements POSContextGenerator

A context generator for the POS Tagger.

Version:
$Revision: 1.17 $, $Date: 2008/03/05 16:45:13 $
Author:
Gann Bierner, Tom Morton

Field Summary
protected  java.lang.String SB
           
protected  java.lang.String SE
           
 
Constructor Summary
DefaultPOSContextGenerator(Dictionary dict)
          Initializes the current instance.
DefaultPOSContextGenerator(int cacheSize, Dictionary dict)
          Initializes the current instance.
 
Method Summary
 java.lang.String[] getContext(int index, java.lang.Object[] tokens, java.lang.String[] tags)
          Returns the context for making a pos tag decision at the specified token index given the specified tokens and previous tags.
 java.lang.String[] getContext(int index, java.lang.Object[] sequence, java.lang.String[] priorDecisions, java.lang.Object[] additionalContext)
          Returns the context for the specified position in the specified sequence (list).
protected static java.lang.String[] getPrefixes(java.lang.String lex)
           
protected static java.lang.String[] getSuffixes(java.lang.String lex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SE

protected final java.lang.String SE
See Also:
Constant Field Values

SB

protected final java.lang.String SB
See Also:
Constant Field Values
Constructor Detail

DefaultPOSContextGenerator

public DefaultPOSContextGenerator(Dictionary dict)
Initializes the current instance.

Parameters:
dict -

DefaultPOSContextGenerator

public DefaultPOSContextGenerator(int cacheSize,
                                  Dictionary dict)
Initializes the current instance.

Parameters:
cacheSize -
dict -
Method Detail

getPrefixes

protected static java.lang.String[] getPrefixes(java.lang.String lex)

getSuffixes

protected static java.lang.String[] getSuffixes(java.lang.String lex)

getContext

public java.lang.String[] getContext(int index,
                                     java.lang.Object[] sequence,
                                     java.lang.String[] priorDecisions,
                                     java.lang.Object[] additionalContext)
Description copied from interface: BeamSearchContextGenerator
Returns the context for the specified position in the specified sequence (list).

Specified by:
getContext in interface POSContextGenerator
Specified by:
getContext in interface BeamSearchContextGenerator
Parameters:
index - The index of the sequence.
sequence - The sequence of items over which the beam search is performed.
priorDecisions - The sequence of decisions made prior to the context for which this decision is being made.
additionalContext - Any addition context specific to a class implementing this interface.
Returns:
the context for the specified position in the specified sequence.

getContext

public java.lang.String[] getContext(int index,
                                     java.lang.Object[] tokens,
                                     java.lang.String[] tags)
Returns the context for making a pos tag decision at the specified token index given the specified tokens and previous tags.

Parameters:
index - The index of the token for which the context is provided.
tokens - The tokens in the sentence.
tags - The tags assigned to the previous words in the sentence.
Returns:
The context for making a pos tag decision at the specified token index given the specified tokens and previous tags.


Copyright 2008 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.