public class LexUnit
extends java.lang.Object
LexUnit
consists of an orthForm (represented as a String),
an orthVar (can be empty), an oldOrthForm (can be empty), and an oldOrthVar
(can be empty). Examples
, Frames
, IliRecords
,
and WiktionaryParaphrases
can belong to a
LexUnit
as well as the following
attributes: styleMarking (boolean), sense (int), styleMarking (boolean),
artificial (boolean), namedEntity (boolean), and source (String).LexUnit
also has the lexical relations: LexRel.has_antonym
, LexRel.has_synonym
,
LexRel.has_pertainym
, LexRel.has_participle
String orthForm = aLexUnit.getOrthForm();
The orthographic form, and (if existent) the orthographic variant, the old
orthographic form, and the old orthographic variant can be retrieved at once:
List<String> forms = aLexUnit.getAllOrthForms();
Lexical relations can be retrieved:
List<LexUnit> antonyms = aLexUnit.getRelatedLexUnits(LexRel.antonymy);
Neighbors (all LexUnits that are related to this one) can be retrieved:
List<LexUnit> neighbors = aLexUnit.getRelatedLexUnits();
Unless otherwise stated, methods will return an empty List rather than null
to indicate that no objects exist for the given request.Modifier and Type | Method and Description |
---|---|
protected void |
addExample(Example example)
Adds an
Example to this Synset . |
protected void |
addFrame(Frame frame)
Adds a
Frame to this Synset . |
protected void |
addIliRecord(IliRecord record)
Add an
IliRecord to this LexUnit . |
protected void |
addRelation(LexRel type,
LexUnit target)
Adds a relation of the specified type to the target
LexUnit . |
void |
addWiktionaryParaphrase(WiktionaryParaphrase paraphrase)
Add a
WiktionaryParaphrase to this LexUnit . |
boolean |
equals(LexUnit other)
Return true if this
LexUnit is equal to another LexUnit . |
CompoundInfo |
getCompoundInfo()
Return the
CompoundInfo for this LexUnit , if it exists. |
java.util.List<Example> |
getExamples()
Returns a
List of this LexUnit 's
Examples . |
java.util.List<Frame> |
getFrames()
Returns a
List of this LexUnit 's
Frames . |
int |
getId()
Returns the unique identifier of this
LexUnit . |
java.util.List<IliRecord> |
getIliRecords()
Return a
List of IliRecords for this LexUnit . |
java.lang.String |
getOldOrthForm()
Returns the old orthographic form of this
LexUnit . |
java.lang.String |
getOldOrthVar()
Returns the old orthographic variant of this
LexUnit . |
java.lang.String |
getOrthForm()
Returns the orthographic form of this
LexUnit . |
java.util.List<java.lang.String> |
getOrthForms()
Returns a
List of all orthographic forms of this
LexUnit (i.e. |
java.lang.String |
getOrthVar()
Returns the orthographic variant of this
LexUnit . |
java.util.List<LexUnit> |
getRelatedLexUnits()
Returns a
List of all of the LexUnits that this
LexUnit has any relation to. |
java.util.List<LexUnit> |
getRelatedLexUnits(LexRel type)
Returns a
List of LexUnits that have the
relation type to this LexUnit . |
int |
getSense()
Returns the sense number of this
LexUnit . |
java.lang.String |
getSource()
Returns the source of this
LexUnit . |
java.util.List<LexUnit> |
getSynonyms()
Returns the synonyms of this
LexUnit - a List
of LexUnits that are part of this LexUnit 's
Synset . |
Synset |
getSynset()
Returns the
Synset to which this LexUnit belongs. |
java.util.List<WiktionaryParaphrase> |
getWiktionaryParaphrases()
Return a
List of WiktionaryParaphrases
for this LexUnit . |
WordCategory |
getWordCategory()
Return the
WordCategory of this LexUnit . |
WordClass |
getWordClass()
Return the
WordClass of this LexUnit . |
boolean |
inWordCategory(WordCategory wordCategory)
Return true if this
LexUnit is in wordCategory . |
boolean |
inWordClass(WordClass wordClass)
Return true if this
LexUnit is in wordClass . |
boolean |
isArtificial()
Returns true if the
artificial attribute is set, false otherwise. |
boolean |
isNamedEntity()
Returns true if the
namedEntity attribute is set, false otherwise. |
boolean |
isStyleMarking()
Returns true if the
styleMarking attribute is set, false otherwise. |
int |
numExamples()
Return the number of
Examples in this Synset . |
int |
numFrames()
Return the number of
Frames in this Synset . |
protected void |
setCompoundInfo(CompoundInfo compoundInfo)
Set the
CompoundInfo for this LexUnit . |
java.lang.String |
toString()
Returns a
String representation of this LexUnit . |
protected void |
trimAll()
Trims all
ArrayLists |
public Synset getSynset()
Synset
to which this LexUnit
belongs.Synset
to which this LexUnit
belongspublic int getSense()
LexUnit
.LexUnit
public int getId()
LexUnit
.LexUnit
public boolean isStyleMarking()
styleMarking
attribute is set, false otherwise.styleMarking
attribute is set, false otherwisepublic boolean isArtificial()
artificial
attribute is set, false otherwise.artificial
attribute is set, false otherwisepublic boolean isNamedEntity()
namedEntity
attribute is set, false otherwise.namedEntity
attribute is set, false otherwiseprotected void trimAll()
ArrayLists
public java.lang.String getOrthForm()
LexUnit
.LexUnit
public java.lang.String getOrthVar()
LexUnit
.LexUnit
public java.lang.String getOldOrthForm()
LexUnit
.LexUnit
public java.lang.String getOldOrthVar()
LexUnit
.LexUnit
public java.util.List<java.lang.String> getOrthForms()
List
of all orthographic forms of this
LexUnit
(i.e. the attributes orthForm
,
orthVar
, oldOrthForm
, and oldOrthVar
).List
of all orthographic forms of this
LexUnit
(i.e. the attributes orthForm
,
orthVar
, oldOrthForm
, and oldOrthVar
)protected void addRelation(LexRel type, LexUnit target)
LexUnit
.type
- the type of relation (eg. LexRel.antonymy
)target
- the target LexUnit
public java.util.List<LexUnit> getRelatedLexUnits(LexRel type)
List
of LexUnits
that have the
relation type
to this LexUnit
.type
- type of relation to retrieveList
of LexUnits
that have the
relation type
to this LexUnit
. For example,
antonyms of this LexUnit
can be retrieved with the type
LexRel.antonymy
public java.util.List<LexUnit> getSynonyms()
LexUnit
- a List
of LexUnits
that are part of this LexUnit
's
Synset
.LexUnit
Same as getRelatedLexUnits(LexRel.synonymy)
public java.util.List<LexUnit> getRelatedLexUnits()
List
of all of the LexUnits
that this
LexUnit
has any relation to.List
of all of the LexUnits
that this
LexUnit
has any relation topublic java.lang.String toString()
String
representation of this LexUnit
.toString
in class java.lang.Object
String
representation of this LexUnit
protected void addExample(Example example)
Example
to this Synset
.example
- the Example
to addprotected void addFrame(Frame frame)
Frame
to this Synset
.frame
- the Frame
to addpublic java.lang.String getSource()
LexUnit
.LexUnit
public java.util.List<Example> getExamples()
List
of this LexUnit
's
Examples
.List
of this LexUnit
's
Examples
public java.util.List<Frame> getFrames()
List
of this LexUnit
's
Frames
.List
of this LexUnit
's
Frames
public WordCategory getWordCategory()
WordCategory
of this LexUnit
.WordCategory
of this LexUnit
(eg. nomen, verben, adj).public boolean inWordCategory(WordCategory wordCategory)
LexUnit
is in wordCategory
.wordCategory
- the WordCategory
(eg. nomen, verben, adj)LexUnit
is in wordCategory
public WordClass getWordClass()
WordClass
of this LexUnit
.WordClass
of this LexUnit
(eg. Menge, Allgemein).public boolean inWordClass(WordClass wordClass)
LexUnit
is in wordClass
.wordClass
- the WordClass
(eg.Menge, Allgemein)LexUnit
is in wordClass
public int numFrames()
Frames
in this Synset
.Frames
in this Synset
public int numExamples()
Examples
in this Synset
.Examples
in this Synset
public java.util.List<IliRecord> getIliRecords()
List
of IliRecords
for this LexUnit
.List
of IliRecords
for this LexUnit
protected void addIliRecord(IliRecord record)
IliRecord
to this LexUnit
.record
- IliRecord
to add to this LexUnit
public CompoundInfo getCompoundInfo()
CompoundInfo
for this LexUnit
, if it exists.CompoundInfo
for this LexUnit
protected void setCompoundInfo(CompoundInfo compoundInfo)
CompoundInfo
for this LexUnit
.compoundInfo
- the CompoundInfo
for this LexUnit
public java.util.List<WiktionaryParaphrase> getWiktionaryParaphrases()
List
of WiktionaryParaphrases
for this LexUnit
.List
of WiktionaryParaphrase
for this LexUnit
public void addWiktionaryParaphrase(WiktionaryParaphrase paraphrase)
WiktionaryParaphrase
to this LexUnit
.paraphrase
- WiktionaryParaphrase
to add to this LexUnit
public boolean equals(LexUnit other)
LexUnit
is equal to another LexUnit
.other
- the LexUnit
to compare toLexUnit
is equal to another LexUnit