edu.washington.cs.knowitall.normalization
Class NormalizedField

java.lang.Object
  extended by edu.washington.cs.knowitall.sequence.SimpleLayeredSequence
      extended by edu.washington.cs.knowitall.normalization.NormalizedField
All Implemented Interfaces:
LayeredSequence

public class NormalizedField
extends SimpleLayeredSequence

This class represents a field of a SpanExtraction that has been normalized in some way, e.g. morphological normalization. A normalized field is a SimpleLayeredSequence with two layers: a token layer, and a POS layer. The token layer contains the normalized words. The POS layer contains the POS tags for those words.

Author:
afader

Field Summary
static String POS_LAYER
           
static String TOKEN_LAYER
           
 
Constructor Summary
NormalizedField(ChunkedExtraction original, List<String> tokens, List<String> posTags)
           
NormalizedField(ChunkedExtraction original, String[] tokens, String[] posTags)
           
 
Method Summary
 ChunkedExtraction getOriginalField()
           
 List<String> getPosTags()
           
 String getPosTagsAsString()
           
 List<String> getTokens()
           
 String getTokensAsString()
           
 String toString()
          Returns the tokens joined by spaces.
 
Methods inherited from class edu.washington.cs.knowitall.sequence.SimpleLayeredSequence
addLayer, addLayer, addLayer, equals, get, getLayer, getLayerAsString, getLayerAsString, getLayerAsString, getLayerNames, getLength, getNumLayers, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, hasLayer
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TOKEN_LAYER

public static final String TOKEN_LAYER
See Also:
Constant Field Values

POS_LAYER

public static final String POS_LAYER
See Also:
Constant Field Values
Constructor Detail

NormalizedField

public NormalizedField(ChunkedExtraction original,
                       String[] tokens,
                       String[] posTags)
                throws SequenceException
Parameters:
original - the original extractions
tokens - the normalized tokens
posTags - the POS tags
Throws:
SequenceException - if tokens and posTags are not the same length

NormalizedField

public NormalizedField(ChunkedExtraction original,
                       List<String> tokens,
                       List<String> posTags)
                throws SequenceException
Parameters:
original - the original extractions
tokens - the normalized tokens
posTags - the POS tags
Throws:
SequenceException - if tokens and posTags are not the same length
Method Detail

getOriginalField

public ChunkedExtraction getOriginalField()
Returns:
the original field that this came from

getTokens

public List<String> getTokens()
Returns:
the normalized tokens

getPosTags

public List<String> getPosTags()
Returns:
the POS tags

getTokensAsString

public String getTokensAsString()
Returns:
the normalized tokens joined by spaces

getPosTagsAsString

public String getPosTagsAsString()
Returns:
the part of speech tags joined by spaces

toString

public String toString()
Returns the tokens joined by spaces.

Overrides:
toString in class Object


Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.