germanet
Class LexUnit

java.lang.Object
  extended by germanet.LexUnit

public class LexUnit
extends java.lang.Object

A LexUnit consists of one or more orthForms (represented as a List of Strings), and has the following attributes: markedStyle (boolean), sense (int), orthVar (boolean), artificial (boolean), properName (boolean), status (String), and word class (WordClass).
A LexUnit also has the lexical relations:

LexRel.antonymy, LexRel.synonymy,
LexRel.pertonymy,
LexRel.participleOf,
LexRel.arg1, LexRel.arg1_pred,
LexRel.arg2, LexRel.arg2_pred

Methods are provided to get each of the attributes.

The orthographic forms can be retrieved:
   List<String> forms = aLexUnit.getOrthForms();

Lexical relations can be retrieved:
   List<LexUnit> antonyms = aLexUnit.getRelations(LexRel.antonymy);

Neighbors (all LexUnits that are related to this one) can be retrieved:
   List<LexUnit> neighbors = aLexUnit.getRelations();

Unless otherwise stated, methods will return an empty List rather than null to indicate that no objects exist for the given request.

Version:
1.0
Author:
Marie Hinrichs (meh at sfs.uni-tuebingen.de)

Method Summary
 java.lang.String getID()
          Returns the unique identifier of this LexUnit.
 java.lang.String getOrthForm(int i)
          Return the ith orth form of this LexUnit
 java.util.List<java.lang.String> getOrthForms()
          Returns a List of this LexUnit's orthForms.
 Synset getParentSynset()
          Returns the Synset to which this LexUnit belongs.
 java.util.List<LexUnit> getRelations()
          Return a List of all of the LexUnits that this LexUnit has any relation to.
 java.util.List<LexUnit> getRelations(LexRel type)
          Return a List of LexUnits that have the relation type to this LexUnit.
 WordClass getWordClass()
          Return the word class of this LexUnit.
 int getWordSense()
          Return the sense number of this LexUnit.
 boolean inWordClass(WordClass wordClass)
          Return true if this LexUnit is in wordClass.
 boolean isArtificial()
          Return true if the artificial attribute is set, false otherwise.
 boolean isMarkedStyle()
          Return true if the marked style attribute is set, false otherwise.
 boolean isOrthVar()
          Return true if the orthographic variant is set, false otherwise.
 boolean isProperName()
          Return true if the proper name attribute is set, false otherwise.
 int numOrthForms()
          Return the number of orth forms in this LexUnit.
 java.lang.String toString()
          Return a String representation of this LexUnit (orthForms only).
 java.lang.String xmlString()
          Return an xml String representation of this LexUnit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

numOrthForms

public int numOrthForms()
Return the number of orth forms in this LexUnit.

Returns:
the number of orth forms in this LexUnit.

getParentSynset

public Synset getParentSynset()
Returns the Synset to which this LexUnit belongs.

Returns:
the Synset to which this LexUnit belongs.

getWordSense

public int getWordSense()
Return the sense number of this LexUnit.

Returns:
the sense number of this LexUnit.

getID

public java.lang.String getID()
Returns the unique identifier of this LexUnit.

Returns:
the unique identifier of this LexUnit.

isMarkedStyle

public boolean isMarkedStyle()
Return true if the marked style attribute is set, false otherwise.

Returns:
true if the marked style attribute is set, false otherwise.

isOrthVar

public boolean isOrthVar()
Return true if the orthographic variant is set, false otherwise.

Returns:
true if the orthographic variant is set, false otherwise.

isArtificial

public boolean isArtificial()
Return true if the artificial attribute is set, false otherwise.

Returns:
true if the artificial attribute is set, false otherwise.

isProperName

public boolean isProperName()
Return true if the proper name attribute is set, false otherwise.

Returns:
true if the proper name attribute is set, false otherwise.

getOrthForms

public java.util.List<java.lang.String> getOrthForms()
Returns a List of this LexUnit's orthForms.

Returns:
a List of this LexUnit's orthForms.

getOrthForm

public java.lang.String getOrthForm(int i)
Return the ith orth form of this LexUnit

Parameters:
i -
Returns:
the ith orth form of this LexUnit

getWordClass

public WordClass getWordClass()
Return the word class of this LexUnit.

Returns:
the WordClass of this LexUnit (eg. WordClass.adj).

inWordClass

public boolean inWordClass(WordClass wordClass)
Return true if this LexUnit is in wordClass.

Parameters:
wordClass - the word class (eg. WordClass.adj)
Returns:
true if this LexUnit is in wordClass.

getRelations

public java.util.List<LexUnit> getRelations(LexRel type)
Return a List of LexUnits that have the relation type to this LexUnit.

Parameters:
type - type of relation to retrieve.
Returns:
a 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.

getRelations

public java.util.List<LexUnit> getRelations()
Return a List of all of the LexUnits that this LexUnit has any relation to.

Returns:
a List of all of the LexUnits that this LexUnit has any relation to.

xmlString

public java.lang.String xmlString()
Return an xml String representation of this LexUnit.

Returns:
an xml String representation of this LexUnit.

toString

public java.lang.String toString()
Return a String representation of this LexUnit (orthForms only).

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this LexUnit (orthForms only).