edu.washington.cs.knowitall.normalization
Class NormalizedField
java.lang.Object
edu.washington.cs.knowitall.sequence.SimpleLayeredSequence
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
| 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 |
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
NormalizedField
public NormalizedField(ChunkedExtraction original,
String[] tokens,
String[] posTags)
throws SequenceException
- Parameters:
original - the original extractionstokens - the normalized tokensposTags - 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 extractionstokens - the normalized tokensposTags - the POS tags
- Throws:
SequenceException - if tokens and posTags are not the same length
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.