public class ChunkedSentence extends BIOLayeredSequence
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
addSpanLayer, addSpanLayerRanges, getSpans, getSpans, getSubSequence, getSubSequence, isSpanLayeraddLayer, addLayer, addLayer, equals, get, getLayer, getLayerAsString, getLayerAsString, getLayerAsString, getLayerNames, getLength, getNumLayers, hashCode, hasLayerpublic 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
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 npChunkTagspublic ChunkedSentence(edu.washington.cs.knowitall.commonlib.Range[] offsets,
String[] tokens,
String[] posTags,
String[] npChunkTags)
throws SequenceException
SequenceExceptionpublic 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 npChunkTagspublic ChunkedSentence(List<String> tokens, List<String> posTags, List<String> npChunkTags) throws SequenceException
SequenceExceptionpublic 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 - 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()
public String toOpenNlpFormat()
public String getToken(int i)
i - public String getPosTag(int i)
i - public String getChunkTag(int i)
i - Copyright © 2010-2013 University of Washington CSE. All Rights Reserved.