org.eml.sir.rel.disc
Class GUIRelatednessRanker

java.lang.Object
  extended byorg.eml.sir.rel.disc.GUIRelatednessRanker

public class GUIRelatednessRanker
extends java.lang.Object

Execute a search using semantic relatedness between the words.


Field Summary
 LinComparator wrc
           
 WordRelatednessMap wrm
           
 
Constructor Summary
GUIRelatednessRanker()
          Creates an instance of GUIRelatednessRanker.
 
Method Summary
 int getEquation()
          Return the type number of the equation used to compute the discourse relatedness.
 double getThreshold()
          Word relatedness values that are smaller than the threshold will not be used to compute the discourse relatednesses.
 void guiWordRelatednessMap(java.util.ArrayList profileList)
          This method is used when the user input is not a profile but a random text.
 void initNounDisc(java.lang.String corpusPath)
          Creates and serializes an instance of NounDisc from files from a given corpus.
 void initWordRelatednessMap(java.lang.String profilesPath)
          Creates an instance of WordRelatednessMap loading
 boolean isUsingStopWords()
           
 boolean loadNounCorpus(java.lang.String filePath)
          Load an already computed and serialized instance of a corpus.
 boolean loadWordRelatednessMap(java.lang.String filePath)
          Load an already computed and serialized instance of a WordRelatednessMap.
 GUIRelatednessResult rank(java.util.ArrayList profileList)
          Create a ranked result instance of GUIRelatednessResult.
 boolean saveNounCorpus(java.lang.String filePath)
          Saerializes and saves an already computed instance of a corpus.
 boolean saveWordRelatednessMap(java.lang.String filePath)
          Serialize and save an already computed instance of a WordRelatednessMap.
 void setEquation(int equationNumber)
          Set the type number of the equation used to compute the discourse relatedness.
 void setThreshold(double threshold)
          Word relatedness values that are smaller than the threshold will not be used to compute the discourse relatednesses.
 void setUseStopWords(boolean useStopWords)
          Sets wether to use stop words or not.
 java.lang.String toString()
          Return a String that contains importnat infomration about this instance of RelatednessRanker.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wrm

public WordRelatednessMap wrm

wrc

public LinComparator wrc
Constructor Detail

GUIRelatednessRanker

public GUIRelatednessRanker()
Creates an instance of GUIRelatednessRanker.

Method Detail

isUsingStopWords

public boolean isUsingStopWords()
Returns:
Return wether stop words are used.

setUseStopWords

public void setUseStopWords(boolean useStopWords)
Sets wether to use stop words or not.

Parameters:
useStopWords - determines if the stop words are used

getThreshold

public double getThreshold()
Word relatedness values that are smaller than the threshold will not be used to compute the discourse relatednesses.

Returns:
Returns the threshold.

setThreshold

public void setThreshold(double threshold)
Word relatedness values that are smaller than the threshold will not be used to compute the discourse relatednesses.

Parameters:
threshold - The threshold to set.

getEquation

public int getEquation()
Return the type number of the equation used to compute the discourse relatedness.

Returns:
Returns the equation type.

setEquation

public void setEquation(int equationNumber)
Set the type number of the equation used to compute the discourse relatedness.

Parameters:
equationNumber - The equation to set.

initNounDisc

public void initNounDisc(java.lang.String corpusPath)
Creates and serializes an instance of NounDisc from files from a given corpus. All nouns from these files are extracted and put in a NounDisc.

Parameters:
corpusPath - the path to the corpus directory

saveNounCorpus

public boolean saveNounCorpus(java.lang.String filePath)
Saerializes and saves an already computed instance of a corpus.

Parameters:
filePath - the file where the instance is saved
Returns:
true if the procedure was successful; false otherwise

loadNounCorpus

public boolean loadNounCorpus(java.lang.String filePath)
Load an already computed and serialized instance of a corpus.

Parameters:
filePath - the file which contains the serialized instance
Returns:
true if the procedure was successful; false otherwise

initWordRelatednessMap

public void initWordRelatednessMap(java.lang.String profilesPath)
Creates an instance of WordRelatednessMap loading


loadWordRelatednessMap

public boolean loadWordRelatednessMap(java.lang.String filePath)
Load an already computed and serialized instance of a WordRelatednessMap.

Parameters:
filePath - the file which contains the serialized instance
Returns:
true if the procedure was successful; false otherwise

saveWordRelatednessMap

public boolean saveWordRelatednessMap(java.lang.String filePath)
Serialize and save an already computed instance of a WordRelatednessMap.

Parameters:
filePath - the file where the instance is saved
Returns:
true if the procedure was successful; false otherwise

guiWordRelatednessMap

public void guiWordRelatednessMap(java.util.ArrayList profileList)
This method is used when the user input is not a profile but a random text. In this case the WordRelatednessMap is computed online which slows down the operation of the interface tremendously.

Parameters:
profileList - the nouns from the user input which will be used for the computing of the WordRelatednessMap

rank

public GUIRelatednessResult rank(java.util.ArrayList profileList)
Create a ranked result instance of GUIRelatednessResult.

Parameters:
profileList - the nouns from the user input
Returns:
an istance of GUIRelatednessResult with ranking and explanations

toString

public java.lang.String toString()
Return a String that contains importnat infomration about this instance of RelatednessRanker.

Returns:
the information