public class BasicSentenceData<P extends de.ims.icarus.util.CompactProperties> extends java.lang.Object implements SentenceData, LanguageConstants, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicSentenceData.Key |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
forms |
protected int |
index |
protected gnu.trove.map.TMap<BasicSentenceData.Key,java.lang.Object> |
indexedProperties |
protected P |
properties |
ROOT_INDEX
DATA_GROUP_LABEL, DATA_GROUP_VALUE, DATA_HEAD_ROOT, DATA_LEFT_LABEL, DATA_LEFT_VALUE, DATA_NO_VALUE, DATA_RIGHT_LABEL, DATA_RIGHT_VALUE, DATA_ROOT_LABEL, DATA_UNDEFINED_DOUBLE_VALUE, DATA_UNDEFINED_FLOAT_VALUE, DATA_UNDEFINED_LABEL, DATA_UNDEFINED_VALUE, DATA_YES_VALUE, DEPREL_KEY, DIRECTION_KEY, DISTANCE_KEY, EDGE_KEY, ENTITY_KEY, FEATURES_KEY, FLAG_PROJECTIVE, FLAGS_KEY, FORM_KEY, FRAMESET_KEY, GENDER_KEY, HEAD_KEY, ID_KEY, INDEX_KEY, LEMMA_KEY, LENGTH_KEY, NUMBER_KEY, PARSE_KEY, POS_KEY, ROOT_KEY, SENSE_KEY, SIZE_KEY, SPEAKER_FEATURES_KEY, SPEAKER_KEY, TAG_KEY, TRANSITIVE_KEY
Constructor and Description |
---|
BasicSentenceData() |
BasicSentenceData(SentenceData source) |
BasicSentenceData(java.lang.String... forms) |
Modifier and Type | Method and Description |
---|---|
SentenceData |
clone()
Creates a copy of this
SentenceData object |
protected P |
cloneProperties() |
protected P |
createProperties() |
java.lang.String |
getFeatures(int index) |
long |
getFlags(int index) |
java.lang.String |
getForm(int index)
Returns the
form tokens of the underlying sentence
this SentenceData object represents (i.e. |
int |
getIndex() |
protected java.lang.Object |
getIndexedProperty(int index,
java.lang.String key) |
java.lang.String |
getLemma(int index) |
java.lang.String |
getPos(int index) |
P |
getProperties() |
java.lang.Object |
getProperty(int index,
java.lang.String key) |
java.lang.Object |
getProperty(java.lang.String key) |
Grammar |
getSourceGrammar()
Returns the
Grammar that created this SentenceData
object or that encapsulates the grammatical rules and structural
terms that define the basis of this SentenceData object. |
java.lang.String |
getText() |
boolean |
isEmpty()
Returns
true if this SentenceData object
represents the empty sentence. |
boolean |
isFlagSet(int index,
long flag)
Tests whether a given flag is set on the current
SentenceData
object. |
int |
length()
Returns the length of the underlying sentence structure, i.e.
|
void |
setForms(java.lang.String[] forms) |
void |
setIndex(int index) |
void |
setProperties(P properties) |
void |
setProperty(int index,
java.lang.String key,
java.lang.Object value) |
void |
setProperty(java.lang.String key,
java.lang.Object value) |
java.lang.String |
toString() |
protected P extends de.ims.icarus.util.CompactProperties properties
protected int index
protected gnu.trove.map.TMap<BasicSentenceData.Key,java.lang.Object> indexedProperties
protected java.lang.String[] forms
public BasicSentenceData(java.lang.String... forms)
public BasicSentenceData(SentenceData source)
public BasicSentenceData()
public void setForms(java.lang.String[] forms)
public P getProperties()
protected P createProperties()
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface SentenceData
public void setProperty(java.lang.String key, java.lang.Object value)
public void setProperties(P properties)
public java.lang.String getText()
getText
in interface de.ims.icarus.ui.text.TextItem
TextItem.getText()
public java.lang.String toString()
toString
in class java.lang.Object
public int getIndex()
getIndex
in interface SentenceData
SentenceData.getIndex()
public void setIndex(int index)
public java.lang.String getForm(int index)
SentenceData
form
tokens of the underlying sentence
this SentenceData
object represents (i.e. all
the terminal symbols)getForm
in interface SentenceData
form
tokens of the underlying sentenceSentenceData.getForm(int)
protected final java.lang.Object getIndexedProperty(int index, java.lang.String key)
public void setProperty(int index, java.lang.String key, java.lang.Object value)
public java.lang.Object getProperty(int index, java.lang.String key)
getProperty
in interface SentenceData
de.ims.icarus.language.coref.DefaultCoreferenceData#getProperty(int, java.lang.String)
public java.lang.String getPos(int index)
getPos
in interface SentenceData
public java.lang.String getLemma(int index)
getLemma
in interface SentenceData
public java.lang.String getFeatures(int index)
getFeatures
in interface SentenceData
public boolean isFlagSet(int index, long flag)
SentenceData
SentenceData
object. The exact meaning of flag
values is implementation group
specific.isFlagSet
in interface SentenceData
public long getFlags(int index)
getFlags
in interface SentenceData
public boolean isEmpty()
SentenceData
true
if this SentenceData
object
represents the empty sentence. This is equivalent with
#getForms()
returning an empty array of String
tokens.isEmpty
in interface SentenceData
true
if and only if the underlying sentence is emptySentenceData.isEmpty()
public int length()
SentenceData
SentenceData
instance.length
in interface SentenceData
SentenceData.length()
public Grammar getSourceGrammar()
SentenceData
Grammar
that created this SentenceData
object or that encapsulates the grammatical rules and structural
terms that define the basis of this SentenceData
object.getSourceGrammar
in interface SentenceData
'grammatical'
source of this SentenceData
objectSentenceData.getSourceGrammar()
public SentenceData clone()
SentenceData
SentenceData
objectclone
in interface SentenceData
clone
in class java.lang.Object
SentenceData
objectprotected P cloneProperties()