|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.cs.knowitall.sequence.SimpleLayeredSequence
edu.washington.cs.knowitall.sequence.BIOLayeredSequence
edu.washington.cs.knowitall.nlp.ChunkedSentence
public class ChunkedSentence
An immutable class that represents a tokenized, POS-tagged, and noun-phrase chunked sentence.
| Field Summary | |
|---|---|
static String |
NP_LAYER
The layer name for the NP chunk tags. |
protected com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> |
offsets
|
static String |
POS_LAYER
The layer name for the part of speech tags. |
static String |
TOKEN_LAYER
The layer name for the tokens. |
| Constructor Summary | |
|---|---|
ChunkedSentence(ChunkedSentence sent)
Constructs a new instance using the given tokens, POS tags, and NP chunk tags, each of which must have the same length. |
|
ChunkedSentence(com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> offsets,
com.google.common.collect.ImmutableList<String> tokens,
com.google.common.collect.ImmutableList<String> posTags,
com.google.common.collect.ImmutableList<String> npChunkTags)
Constructs a new instance using the given tokens, POS tags, and NP chunk tags, each of which must have the same length. |
|
ChunkedSentence(List<edu.washington.cs.knowitall.commonlib.Range> offsets,
List<String> tokens,
List<String> posTags,
List<String> npChunkTags)
|
|
ChunkedSentence(List<String> tokens,
List<String> posTags,
List<String> npChunkTags)
|
|
ChunkedSentence(edu.washington.cs.knowitall.commonlib.Range[] offsets,
String[] tokens,
String[] posTags,
String[] npChunkTags)
|
|
ChunkedSentence(String[] tokens,
String[] posTags,
String[] npChunkTags)
Constructs a new instance using the given tokens, POS tags, and NP chunk tags, each of which must have the same length. |
|
| Method Summary | |
|---|---|
ChunkedSentence |
clone()
Returns a copy of this object. |
String |
getChunkTag(int i)
|
com.google.common.collect.ImmutableList<String> |
getChunkTags()
|
com.google.common.collect.ImmutableList<String> |
getChunkTags(int start,
int length)
|
com.google.common.collect.ImmutableList<String> |
getChunkTags(edu.washington.cs.knowitall.commonlib.Range range)
|
String |
getChunkTagsAsString()
|
com.google.common.collect.ImmutableCollection<edu.washington.cs.knowitall.commonlib.Range> |
getNpChunkRanges()
|
com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> |
getOffsets()
|
String |
getOffsetsAsString()
|
String |
getPosTag(int i)
|
com.google.common.collect.ImmutableList<String> |
getPosTags()
|
com.google.common.collect.ImmutableList<String> |
getPosTags(int start,
int length)
|
com.google.common.collect.ImmutableList<String> |
getPosTags(edu.washington.cs.knowitall.commonlib.Range range)
|
String |
getPosTagsAsString()
|
String |
getPosTagsAsString(int start,
int length)
|
String |
getPosTagsAsString(edu.washington.cs.knowitall.commonlib.Range range)
|
edu.washington.cs.knowitall.commonlib.Range |
getRange()
|
ChunkedSentence |
getSubSequence(int start,
int length)
Returns a new ChunkedSentence object that starts at the given start index and has the given length. |
ChunkedSentence |
getSubSequence(edu.washington.cs.knowitall.commonlib.Range range)
Returns a new ChunkedSentence object that starts at the given range. |
String |
getToken(int i)
|
edu.washington.cs.knowitall.commonlib.Range |
getTokenRange(int charStart,
int charEnd)
Converts a character range into getTokensAsString into a bounding token range. |
com.google.common.collect.ImmutableList<String> |
getTokens()
|
com.google.common.collect.ImmutableList<String> |
getTokens(int start,
int length)
|
com.google.common.collect.ImmutableList<String> |
getTokens(edu.washington.cs.knowitall.commonlib.Range range)
|
String |
getTokensAsString()
|
String |
getTokensAsString(int start,
int length)
|
String |
getTokensAsString(edu.washington.cs.knowitall.commonlib.Range range)
|
String |
toOpenNlpFormat()
|
String |
toString()
|
| Methods inherited from class edu.washington.cs.knowitall.sequence.BIOLayeredSequence |
|---|
addSpanLayer, addSpanLayerRanges, getSpans, getSpans, getSubSequence, getSubSequence, isSpanLayer |
| Methods inherited from class edu.washington.cs.knowitall.sequence.SimpleLayeredSequence |
|---|
addLayer, addLayer, addLayer, equals, get, getLayer, getLayerAsString, getLayerAsString, getLayerAsString, getLayerNames, getLength, getNumLayers, hashCode, hasLayer |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TOKEN_LAYER
public static final String POS_LAYER
public static final String NP_LAYER
protected final com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> offsets
| Constructor Detail |
|---|
public ChunkedSentence(String[] tokens,
String[] posTags,
String[] npChunkTags)
throws SequenceException
tokens - posTags - npChunkTags -
SequenceException - if the layers are of different lengths, or if unable to
interpret npChunkTags
public ChunkedSentence(edu.washington.cs.knowitall.commonlib.Range[] offsets,
String[] tokens,
String[] posTags,
String[] npChunkTags)
throws SequenceException
SequenceException
public ChunkedSentence(com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> offsets,
com.google.common.collect.ImmutableList<String> tokens,
com.google.common.collect.ImmutableList<String> posTags,
com.google.common.collect.ImmutableList<String> npChunkTags)
throws SequenceException
tokens - posTags - npChunkTags -
SequenceException - if the layers are of different lengths, or if unable to
interpret npChunkTags
public ChunkedSentence(List<String> tokens,
List<String> posTags,
List<String> npChunkTags)
throws SequenceException
SequenceException
public ChunkedSentence(List<edu.washington.cs.knowitall.commonlib.Range> offsets,
List<String> tokens,
List<String> posTags,
List<String> npChunkTags)
throws SequenceException
SequenceExceptionpublic ChunkedSentence(ChunkedSentence sent)
tokens - posTags - npChunkTags - | Method Detail |
|---|
public com.google.common.collect.ImmutableList<edu.washington.cs.knowitall.commonlib.Range> getOffsets()
public edu.washington.cs.knowitall.commonlib.Range getRange()
public ChunkedSentence getSubSequence(edu.washington.cs.knowitall.commonlib.Range range)
getSubSequence in class BIOLayeredSequencerange -
public ChunkedSentence getSubSequence(int start,
int length)
getSubSequence in class BIOLayeredSequencestart - length -
public edu.washington.cs.knowitall.commonlib.Range getTokenRange(int charStart,
int charEnd)
charStart - charEnd -
public ChunkedSentence clone()
clone in class BIOLayeredSequencepublic com.google.common.collect.ImmutableList<String> getTokens()
public com.google.common.collect.ImmutableList<String> getPosTags()
public com.google.common.collect.ImmutableList<String> getTokens(int start,
int length)
start - length -
length tokens starting at index
start.public com.google.common.collect.ImmutableList<String> getTokens(edu.washington.cs.knowitall.commonlib.Range range)
range -
range.
public com.google.common.collect.ImmutableList<String> getPosTags(int start,
int length)
start - length -
length POS tags starting at index
start.public com.google.common.collect.ImmutableList<String> getPosTags(edu.washington.cs.knowitall.commonlib.Range range)
range -
range.public com.google.common.collect.ImmutableCollection<edu.washington.cs.knowitall.commonlib.Range> getNpChunkRanges()
public com.google.common.collect.ImmutableList<String> getChunkTags()
public com.google.common.collect.ImmutableList<String> getChunkTags(int start,
int length)
start - length -
length NP chunk tags starting at index
start.public com.google.common.collect.ImmutableList<String> getChunkTags(edu.washington.cs.knowitall.commonlib.Range range)
range -
length NP chunk tags in the range
range.public String getOffsetsAsString()
public String getTokensAsString()
public String getTokensAsString(int start,
int length)
start - length -
length tokens starting at start, joined
by spaces.public String getTokensAsString(edu.washington.cs.knowitall.commonlib.Range range)
range -
range, joined by
spaces.
public String getPosTagsAsString(int start,
int length)
start - length -
length POS tags starting at start,
joined by spaces.public String getPosTagsAsString(edu.washington.cs.knowitall.commonlib.Range range)
range -
range, joined by
spaces.public String getPosTagsAsString()
public String getChunkTagsAsString()
public String toString()
toString in class Objectpublic String toOpenNlpFormat()
public String getToken(int i)
i -
public String getPosTag(int i)
i -
public String getChunkTag(int i)
i -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||