org.eml.sir.rel
Class JcnComparator

java.lang.Object
  extended byorg.eml.sir.rel.WordRelatednessComparator
      extended byorg.eml.sir.rel.PathBasedComparator
          extended byorg.eml.sir.rel.InformationBasedComparator
              extended byorg.eml.sir.rel.JcnComparator

public class JcnComparator
extends InformationBasedComparator

Computes the distance based on the proposal by Jiang & Conrath (1997).

Author:
Hendrik Niederlich (EML-R)

Field Summary
 
Fields inherited from class org.eml.sir.rel.WordRelatednessComparator
noResultValue
 
Constructor Summary
JcnComparator()
          Create a new instance of JcnComparator.
JcnComparator(StemmingGermaNetObject gno)
          Create a new instance of JcnComparator.
 
Method Summary
 double getRelatedness(java.util.ArrayList word1, java.util.ArrayList word2, java.util.HashMap tableMap)
          Return a relatedness value ESPECIALLY FOR LC_COMPARATOR!.
 double getRelatedness(java.lang.String word1, java.lang.String word2)
          Return a distance value that reflects the minimal distance of two words.
 java.lang.String[] getRelatednessTrace(java.lang.String word1, java.lang.String word2)
          Return a trace that illustrates the relatedness computation.
 void setHowToDealWithNoLcs(int deal)
          Set how to deal with zero distance: 0 => zero root node, 1 => max dist
 
Methods inherited from class org.eml.sir.rel.InformationBasedComparator
getInformationContentMap, setInformationContentMap
 
Methods inherited from class org.eml.sir.rel.PathBasedComparator
getLCSs, getMaxDepth, getMinPathLength, getMinPathLength, getPathsToRoot
 
Methods inherited from class org.eml.sir.rel.WordRelatednessComparator
getGermaNetObject, setGermaNetObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcnComparator

public JcnComparator()
Create a new instance of JcnComparator.


JcnComparator

public JcnComparator(StemmingGermaNetObject gno)
Create a new instance of JcnComparator.

Method Detail

setHowToDealWithNoLcs

public void setHowToDealWithNoLcs(int deal)
Set how to deal with zero distance: 0 => zero root node, 1 => max dist


getRelatedness

public double getRelatedness(java.util.ArrayList word1,
                             java.util.ArrayList word2,
                             java.util.HashMap tableMap)
Description copied from class: WordRelatednessComparator
Return a relatedness value ESPECIALLY FOR LC_COMPARATOR!.

Specified by:
getRelatedness in class WordRelatednessComparator
Returns:
A positive value that indicates the relatedness of two words. If one or both word have more than one sense the value that indicates the highest similarity is returned. If no relatedness value can be computed return 0.

getRelatedness

public double getRelatedness(java.lang.String word1,
                             java.lang.String word2)
Return a distance value that reflects the minimal distance of two words.

Specified by:
getRelatedness in class WordRelatednessComparator
Returns:
A positive value that indicates the relatedness of two words.
See Also:
WordRelatednessComparator.getRelatedness(java.lang.String, java.lang.String)

getRelatednessTrace

public java.lang.String[] getRelatednessTrace(java.lang.String word1,
                                              java.lang.String word2)
Return a trace that illustrates the relatedness computation.

Specified by:
getRelatednessTrace in class WordRelatednessComparator
See Also:
WordRelatednessComparator.getRelatednessTrace(java.lang.String, java.lang.String)