|
||||||||||
| 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
public class BIOLayeredSequence
Represents a layered sequence where some of the layers can be spans of tags,
encoded using B/I/O prefixes. For example, the sequence of tags
O B-X I-X O B-Y O B-Z B-Z I-Z represents four spans at positions 1-2,
4, 6, and 7-8.
| Constructor Summary | |
|---|---|
BIOLayeredSequence(int length)
Constructs a new BIOLayeredSequence class. |
|
| Method Summary | |
|---|---|
void |
addSpanLayer(String layerName,
List<String> input)
Adds a new layer to this sequence, but interprets it using B/I/O notation. |
void |
addSpanLayerRanges(String layerName,
String tag,
List<edu.washington.cs.knowitall.commonlib.Range> ranges)
Adds a new span layer to this sequence. |
BIOLayeredSequence |
clone()
Creates a copy of this object. |
List<edu.washington.cs.knowitall.commonlib.Range> |
getSpans(String layerName)
Returns the ranges of all of the spans on the given layer. |
com.google.common.collect.ImmutableCollection<edu.washington.cs.knowitall.commonlib.Range> |
getSpans(String layerName,
String type)
Returns the ranges of all of the spans on the given layer that are of the given type (e.g. |
BIOLayeredSequence |
getSubSequence(int start,
int length)
Constructs a new subsequence from this instance. |
BIOLayeredSequence |
getSubSequence(edu.washington.cs.knowitall.commonlib.Range r)
Constructs a new subsequence from this instance. |
com.google.common.collect.ImmutableList<String> |
getSubSequence(String layerName,
int start,
int length)
Returns a subsequence of the given layer. |
com.google.common.collect.ImmutableList<String> |
getSubSequence(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
Returns a subsequence of the given layer. |
protected boolean |
isSpanLayer(String layerName)
|
| 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, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BIOLayeredSequence(int length)
length - | Method Detail |
|---|
public BIOLayeredSequence clone()
clone in class Objectpublic List<edu.washington.cs.knowitall.commonlib.Range> getSpans(String layerName)
layerName -
public com.google.common.collect.ImmutableCollection<edu.washington.cs.knowitall.commonlib.Range> getSpans(String layerName,
String type)
layerName - type -
public void addSpanLayer(String layerName,
List<String> input)
throws SequenceException
B-,
I-, or equal O. Any tag that equals
I-X for some string X must come immediately
after either I-X or B-X.
layerName - input -
SequenceException - if unable to add a layer with the given name, or if input
does not follow the B/I/O encoding.
public void addSpanLayerRanges(String layerName,
String tag,
List<edu.washington.cs.knowitall.commonlib.Range> ranges)
throws SequenceException
tag = "NP" then
this will add B-NP, I-NP, and O
tags at the indexes covered by ranges. The ranges must not
overlap.
layerName - tag - ranges -
SequenceException - if any of the layers overlap, or if any of the ranges are
outside of the range of this sequence
public com.google.common.collect.ImmutableList<String> getSubSequence(String layerName,
int start,
int length)
getSubSequence in class SimpleLayeredSequence
public com.google.common.collect.ImmutableList<String> getSubSequence(String layerName,
edu.washington.cs.knowitall.commonlib.Range r)
getSubSequence in class SimpleLayeredSequence
public BIOLayeredSequence getSubSequence(int start,
int length)
getSubSequence in class SimpleLayeredSequencepublic BIOLayeredSequence getSubSequence(edu.washington.cs.knowitall.commonlib.Range r)
getSubSequence in class SimpleLayeredSequenceprotected boolean isSpanLayer(String layerName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||