public class BIOLayeredSequence extends SimpleLayeredSequence
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 and Description |
|---|
BIOLayeredSequence(int length)
Constructs a new BIOLayeredSequence class.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
addLayer, addLayer, addLayer, equals, get, getLayer, getLayerAsString, getLayerAsString, getLayerAsString, getLayerNames, getLength, getNumLayers, hashCode, hasLayerpublic BIOLayeredSequence(int length)
length - public BIOLayeredSequence clone()
public 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 sequencepublic com.google.common.collect.ImmutableList<String> getSubSequence(String layerName, int start, int length)
getSubSequence in class SimpleLayeredSequencepublic com.google.common.collect.ImmutableList<String> getSubSequence(String layerName, edu.washington.cs.knowitall.commonlib.Range r)
getSubSequence in class SimpleLayeredSequencepublic 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)
Copyright © 2010-2013 University of Washington CSE. All Rights Reserved.