org.eml.sir.rel
Class InformationContentMap

java.lang.Object
  extended byorg.eml.sir.rel.InformationContentMap
All Implemented Interfaces:
java.io.Serializable

public class InformationContentMap
extends java.lang.Object
implements java.io.Serializable

Contains synsets and their information content value. An InformationContentMap can be in two states: unaccomplished and accomplished. To create an InformationContentMap, first call the constructor. You get an unaccomplished instance. Now report all identifications and concepts to the unaccomplished map and then accomplish it by calling the accomplish()-method. Afterwards it is not possible to make any further reports.

Author:
Hendrik Niederlich (EML-R)
See Also:
Serialized Form

Field Summary
static char ORDER_ALPHABETICAL
           
static char ORDER_BY_INFO_CONTENT
           
 
Constructor Summary
InformationContentMap()
          Create a new instance of InformationContentMap.
 
Method Summary
 void accomplish()
          Accomplish this InformationContentMap.
 void createAlphabeticalFile(java.lang.String fileName)
          Create a file with a table of concepts and their values ordered alphabetically that is readable by humans.
 void createFrequencyFile(java.lang.String fileName)
          Create a file with a table of concepts and their values ordered by values that is readable by humans.
 int getConceptsNumber()
          Return the number of unique concepts in this InformationContentMap.
 java.lang.Integer getFrequency(Synset concept)
          Return the frequency of a specific concept.
 double getHighestIC()
          Return the highest information content value of this InformationContentMap.
 int getIdentificationsNumber()
          Return the number of identified items while creating this InformationContentMap.
 java.lang.Double getInformationContent(Synset concept)
          Return the information content value of a specific concept.
 double getLowestIC()
          Return the lowest information content value of this InformationContentMap.
 char getPartOfSpeech()
          Return part of speech of this InformationContentMap.
 java.lang.Double getProbability(Synset concept)
          Return the probability of a specific concept.
 double getShortestDistance()
          Return shortest distance of this InformationContentMap.
 Stemmer getStemmer()
          Return a stemmer of this InformationContentMap's stemmer class name.
 java.lang.String getStemmerName()
          Return the class name of the stemmer of this InformationContentMap.
static InformationContentMap load(java.lang.String fileName)
          Load a serialized instance of InformationContentMap.
 boolean reportConcept(Synset concept, java.lang.Integer number)
          Count a concept and its frequency.
 boolean reportConcepts(java.util.ArrayList concepts, java.lang.Integer number)
          Count concepts and their frequencies.
 boolean reportIdentifications(java.lang.Integer number)
          Count the number of identified items in this InformationContentMap.
 boolean save(java.lang.String fileName)
          Serialize an instance of InformationContentMap and save it to a file.
 boolean setPartOfSpeech(char pos)
          Set part of speech of this InformationContentMap.
 boolean setStemmerName(java.lang.String stemmerName)
          Set the class name of the stemmer of this InformationContentMap.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_ALPHABETICAL

public static final char ORDER_ALPHABETICAL
See Also:
Constant Field Values

ORDER_BY_INFO_CONTENT

public static final char ORDER_BY_INFO_CONTENT
See Also:
Constant Field Values
Constructor Detail

InformationContentMap

public InformationContentMap()
Create a new instance of InformationContentMap.

Method Detail

getPartOfSpeech

public char getPartOfSpeech()
Return part of speech of this InformationContentMap.


setPartOfSpeech

public boolean setPartOfSpeech(char pos)
Set part of speech of this InformationContentMap.

Returns:
Only if this InformationContentMap is not yet accomplished it is possible to set the part of speech. If it fails false is returned.

getStemmerName

public java.lang.String getStemmerName()
Return the class name of the stemmer of this InformationContentMap.


setStemmerName

public boolean setStemmerName(java.lang.String stemmerName)
Set the class name of the stemmer of this InformationContentMap.

Returns:
Only if this InformationContentMap is not yet accomplished it is possible to set the stemmer name. If it fails false is returned.

getStemmer

public Stemmer getStemmer()
Return a stemmer of this InformationContentMap's stemmer class name.


getShortestDistance

public double getShortestDistance()
Return shortest distance of this InformationContentMap.

Returns:
Shortest distance. 0 if this InformationContentMap is not yet accomplished.

reportIdentifications

public boolean reportIdentifications(java.lang.Integer number)
Count the number of identified items in this InformationContentMap.

Returns:
Only if this InformationContentMap is not yet accomplished it is possible to report identifications. If the report fails false is returned.

reportConcept

public boolean reportConcept(Synset concept,
                             java.lang.Integer number)
Count a concept and its frequency.

Returns:
Only if this InformationContentMap is not yet accomplished it is possible to report a concept. If the report fails false is returned.

reportConcepts

public boolean reportConcepts(java.util.ArrayList concepts,
                              java.lang.Integer number)
Count concepts and their frequencies.

Returns:
Only if this InformationContentMap is not yet accomplished it is possible to report concepts. If the report fails false is returned.

accomplish

public void accomplish()
Accomplish this InformationContentMap. Only an accomplished InformationContentMap offers informations regarding frequencies, probabilities and information content values of concepts. The accomplishment is irreversible.


getConceptsNumber

public int getConceptsNumber()
Return the number of unique concepts in this InformationContentMap.


getIdentificationsNumber

public int getIdentificationsNumber()
Return the number of identified items while creating this InformationContentMap.


getFrequency

public java.lang.Integer getFrequency(Synset concept)
Return the frequency of a specific concept.

Returns:
Frequency of the concept. If the InformationContentMap is not accomplished -1 or the concept is not contained.

getProbability

public java.lang.Double getProbability(Synset concept)
Return the probability of a specific concept.

Returns:
Probability of the concept. -1 if the InformationContentMap is not accomplished or the concept is not contained.

getHighestIC

public double getHighestIC()
Return the highest information content value of this InformationContentMap.

Returns:
Highest information content value. -1 if the InformationContentMap is not accomplished.

getLowestIC

public double getLowestIC()
Return the lowest information content value of this InformationContentMap.

Returns:
Lowest information content value. -1 if the InformationContentMap is not accomplished.

getInformationContent

public java.lang.Double getInformationContent(Synset concept)
Return the information content value of a specific concept.

Returns:
Probability of the concept. -1 if the InformationContentMap is not accomplished or the concept is not contained.

createFrequencyFile

public void createFrequencyFile(java.lang.String fileName)
                         throws java.io.IOException
Create a file with a table of concepts and their values ordered by values that is readable by humans.

Throws:
java.io.IOException

createAlphabeticalFile

public void createAlphabeticalFile(java.lang.String fileName)
                            throws java.io.IOException
Create a file with a table of concepts and their values ordered alphabetically that is readable by humans.

Throws:
java.io.IOException

load

public static InformationContentMap load(java.lang.String fileName)
Load a serialized instance of InformationContentMap.

Parameters:
fileName - Complete path and file name.

save

public boolean save(java.lang.String fileName)
Serialize an instance of InformationContentMap and save it to a file.

Parameters:
fileName - Complete path and file name.