org.eml.sir.gn
Class GermaNetObject

java.lang.Object
  extended byorg.eml.sir.gn.GermaNetObject
Direct Known Subclasses:
StemmingGermaNetObject

public class GermaNetObject
extends java.lang.Object

An instance of GermaNetObject makes the information of the GermaNet accessible. Use the getWordsense/s() and getSynsets() methods. Then use get() methods on the WordSense resp. Synset instances thus obtained.

Version:
0.2
Author:
Hendrik Niederlich (EML-R)

Constructor Summary
GermaNetObject()
          Create a new instance of GermaNetObject.
GermaNetObject(java.util.TreeMap nounsWos, java.util.HashMap nounsSyn, java.util.TreeMap verbsWos, java.util.HashMap verbsSyn, java.util.TreeMap adjesWos, java.util.HashMap adjesSyn)
          Create a new instance of GermaNetObject.
 
Method Summary
 java.util.TreeSet getAllSynsets(char pos)
          Return all Synsets of this GermaNetObject.
 java.util.TreeSet getAllWordSenses(char pos)
          Return all WordSenses of this GermaNetObject.
 java.util.ArrayList getSynsets(java.lang.String graphs)
          Return a list of synsets that correlate to word senses, with the same graphemic representation.
 java.util.ArrayList getSynsets(java.lang.String graphs, char pos)
          Return a list of synsets that correlate to word senses, with the same graphemic representation and part of speech.
 int getSynsetsAmount(char pos)
          Return the number of Synsets in this GermaNetObject.
 WordSense getWordSense(java.lang.String graphs, char pos, int sense)
          Return a WordSense with specified parameters.
 java.util.ArrayList getWordSenses(java.lang.String graphs)
          Return a list of word senses, with the same graphemic representation.
 java.util.ArrayList getWordSenses(java.lang.String graphs, char pos)
          Return a list of word senses, which constitute a lexeme.
 int getWordSensesAmount(char pos)
          Return the number of WordSenses in this GermaNetObject.
static GermaNetObject load(java.lang.String fileName)
          Load a serialized instance of GermaNetObject.
 void printAssociations()
          Print diagnostic information on the standard output stream.
 void printInfo()
          Write some information about this GermaNetObject on the standard output stream.
 boolean save(java.lang.String fileName)
          Serialize an instance of GermaNetObject and save it to a file.
 java.util.Set wordSensesKeySet(char pos)
          Return the keys to all word senses of a specific part of speech.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GermaNetObject

public GermaNetObject()
Create a new instance of GermaNetObject. Use a GermaNetParser to get a working instance of GermaNetObject.


GermaNetObject

public GermaNetObject(java.util.TreeMap nounsWos,
                      java.util.HashMap nounsSyn,
                      java.util.TreeMap verbsWos,
                      java.util.HashMap verbsSyn,
                      java.util.TreeMap adjesWos,
                      java.util.HashMap adjesSyn)
Create a new instance of GermaNetObject. This method is used by the GermaNetParser to initialize a GermaNetObject. Use an instance of GermaNetParser to get a working GermaNetObject.

Method Detail

getWordSense

public WordSense getWordSense(java.lang.String graphs,
                              char pos,
                              int sense)
Return a WordSense with specified parameters. Note that this method is different from StemmingGermaNetObject's getWordSenses(String, char, int). So it will not be overloaded by it.

Parameters:
graphs - Graphemic representation of the requested WordSense.
pos - Part of speech of the requested WordSense.
sense - Sense number of the requested WordSense.
Returns:
Requested WordSense or null if no appropiate WordSense is available.

getWordSenses

public java.util.ArrayList getWordSenses(java.lang.String graphs,
                                         char pos)
Return a list of word senses, which constitute a lexeme.

Parameters:
graphs - Graphemic representation of the requested WordSense.
pos - Part of speech of the requested WordSense.
Returns:
Requested WordSenses or null if no appropiate WordSense is available.

getSynsets

public java.util.ArrayList getSynsets(java.lang.String graphs,
                                      char pos)
Return a list of synsets that correlate to word senses, with the same graphemic representation and part of speech.

Parameters:
graphs - Graphemic representation of the requested Synsets.
Returns:
Requested Synsets or null if no appropiate Synset is available.

getWordSenses

public java.util.ArrayList getWordSenses(java.lang.String graphs)
Return a list of word senses, with the same graphemic representation.

Parameters:
graphs - Graphemic representation of the requested WordSense.
Returns:
Requested WordSenses or null if no appropiate WordSense is available.

getSynsets

public java.util.ArrayList getSynsets(java.lang.String graphs)
Return a list of synsets that correlate to word senses, with the same graphemic representation.

Parameters:
graphs - Graphemic representation of the requested Synsets.
Returns:
Requested Synsets or null if no appropiate Synset is available.

wordSensesKeySet

public java.util.Set wordSensesKeySet(char pos)
Return the keys to all word senses of a specific part of speech.


getWordSensesAmount

public int getWordSensesAmount(char pos)
Return the number of WordSenses in this GermaNetObject.


getAllWordSenses

public java.util.TreeSet getAllWordSenses(char pos)
Return all WordSenses of this GermaNetObject.

Returns:
TreeSet containing WordSenses.

getSynsetsAmount

public int getSynsetsAmount(char pos)
Return the number of Synsets in this GermaNetObject.


getAllSynsets

public java.util.TreeSet getAllSynsets(char pos)
Return all Synsets of this GermaNetObject.

Returns:
TreeSet containing WordSenses.

printInfo

public void printInfo()
Write some information about this GermaNetObject on the standard output stream.


printAssociations

public void printAssociations()
Print diagnostic information on the standard output stream.


save

public boolean save(java.lang.String fileName)
Serialize an instance of GermaNetObject and save it to a file. (Bug: Stack overflow)

Parameters:
fileName - Complete path and file name.

load

public static GermaNetObject load(java.lang.String fileName)
Load a serialized instance of GermaNetObject. (Bug: Stack overflow)

Parameters:
fileName - Complete path and file name.