public class SpanExtraction extends Object
This class represents an extraction from a single sentence that is made up of one or more fields, each of which corresponds to a span in the sentence.
For example, a binary subject-verb-object relationship can be represented as
a SentenceSpanExtraction with three fields: one for the subject, one
for the verb phrase, and one for the object. This class keeps a reference to
the sentence the extraction originated from, and the ranges of each field.
Each field is represented as a ChunkedExtraction.
A SpanExtraction object is also equipped with a set of properties, mapping a String key to a String value.
| Constructor and Description |
|---|
SpanExtraction(ChunkedExtraction[] fields)
Constructs a new extraction from the given
ChunkedExtractions. |
SpanExtraction(ChunkedExtraction[] fields,
String[] fieldNames)
Constructs a new extraction from the given
ChunkedExtractions. |
SpanExtraction(ChunkedSentence sent,
List<edu.washington.cs.knowitall.commonlib.Range> fieldRanges)
Constructs a new extraction from the given sentence, with fields defined
by the given ranges.
|
SpanExtraction(ChunkedSentence sent,
List<edu.washington.cs.knowitall.commonlib.Range> fieldRanges,
List<String> fieldNames)
Constructs a new extraction from the given sentence, with fields defined
by the given ranges and names.
|
SpanExtraction(List<ChunkedExtraction> fields)
Constructs a new extraction from the given
ChunkedExtractions. |
SpanExtraction(List<ChunkedExtraction> fields,
List<String> fieldNames)
Constructs a new extraction from the given
ChunkedExtractions. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
ChunkedExtraction |
getField(int i) |
ChunkedExtraction |
getField(String name) |
String |
getFieldName(int i) |
List<String> |
getFieldNames() |
edu.washington.cs.knowitall.commonlib.Range |
getFieldRange(int i) |
edu.washington.cs.knowitall.commonlib.Range |
getFieldRange(String name) |
List<edu.washington.cs.knowitall.commonlib.Range> |
getFieldRanges() |
List<ChunkedExtraction> |
getFields() |
int |
getNumFields() |
Map<String,String> |
getProperties() |
String |
getProperty(String name) |
Set<String> |
getPropertyNames() |
ChunkedSentence |
getSentence() |
boolean |
hasField(String name) |
int |
hashCode() |
boolean |
hasProperty(String name)
Checks whether this extraction has the given property.
|
void |
setProperties(Map<String,String> props)
Sets the properties to the given map.
|
void |
setProperty(String name,
String value)
Sets the given property
|
List<String> |
toBIOLayer()
Returns a B/I/O encoding of this extraction as a list of strings.
|
public SpanExtraction(ChunkedSentence sent, List<edu.washington.cs.knowitall.commonlib.Range> fieldRanges, List<String> fieldNames)
sent - ranges - fieldNames - public SpanExtraction(ChunkedSentence sent, List<edu.washington.cs.knowitall.commonlib.Range> fieldRanges)
sent - ranges - public SpanExtraction(List<ChunkedExtraction> fields)
ChunkedExtractions.
These must all come from the same sentence. Uses the default field names
of field0, field1, field2, etc.fields - public SpanExtraction(ChunkedExtraction[] fields)
ChunkedExtractions.
These must all come from the same sentence. Uses the default field names
of field0, field1, field2, etc.fields - public SpanExtraction(List<ChunkedExtraction> fields, List<String> fieldNames)
ChunkedExtractions.
These must all come from the same sentence.fields - fieldNames - public SpanExtraction(ChunkedExtraction[] fields, String[] fieldNames)
ChunkedExtractions.
These must all come from the same sentence.fields - fieldNames - public int getNumFields()
public boolean hasField(String name)
name - public ChunkedSentence getSentence()
public List<edu.washington.cs.knowitall.commonlib.Range> getFieldRanges()
public List<ChunkedExtraction> getFields()
public edu.washington.cs.knowitall.commonlib.Range getFieldRange(int i)
i - public edu.washington.cs.knowitall.commonlib.Range getFieldRange(String name)
name - public ChunkedExtraction getField(String name)
name - public ChunkedExtraction getField(int i)
i - public String getFieldName(int i)
i - public Map<String,String> getProperties()
public void setProperty(String name, String value)
name - the name of the propertyvalue - the valuepublic void setProperties(Map<String,String> props)
props - public boolean hasProperty(String name)
name - public String getProperty(String name)
name - public Set<String> getPropertyNames()
public List<String> toBIOLayer()
Copyright © 2010-2013 University of Washington CSE. All Rights Reserved.