|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgermanet.LexUnit
public class LexUnit
A LexUnit
consists of an orthForm (represented as a Strings),
an orthVar (can be empty), an oldOrthForm (can be empty), and an oldOrthVar
(can be empty). Examples
and Frames
can belong to a
LexUnit
as well as the following
attributes: styleMarking (boolean), sense (int), styleMarking (boolean),
artificial (boolean), namedEntity (boolean), and source (String).
A LexUnit
also has the lexical relations:
LexRel.has_antonym
, LexRel.has_synonym
,
LexRel.has_pertainym
, LexRel.has_participle
Methods are provided to get each of the attributes.
The orthographic form can be retrieved:
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.
Method Summary | |
---|---|
protected void |
addExample(Example example)
Adds an Example to this Synset . |
protected void |
addFrame(Frame frame)
Adds a Frame to this Synset . |
protected void |
addRelation(LexRel type,
LexUnit target)
Adds a relation of the specified type to the target LexUnit . |
java.util.List<Example> |
getExamples()
Returns a List of this LexUnit 's
Examples/code>. |
java.util.List<Frame> |
getFrames()
Returns a List of this LexUnit 's
Frames . |
int |
getId()
Returns the unique identifier of 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. |
WordCategory |
getWordCategory()
Return the WordCategory of this LexUnit . |
boolean |
inWordCategory(WordCategory wordCategory)
Return true if this LexUnit is in wordCategory . |
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 . |
java.lang.String |
toString()
Returns a String representation of this LexUnit . |
protected void |
trimAll()
Trims all ArrayLists |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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 retrieve
List
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/code>.
- Returns:
- a
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 int numFrames()
Frames
in this Synset
.
Frames
in this Synset
public int numExamples()
Examples
in this Synset
.
Examples
in this Synset
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |