| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectemolib.wsd.simlib.SimilarityAssessor
public class SimilarityAssessor
Title: Java WordNet Similarity
Description: Assesses the semantic similarity between a pair of words as described in Seco, N., Veale, T., Hayes, J. (2004) "An Intrinsic Information Content Metric for Semantic Similarity in WordNet". In Proceedings of the European Conference of Artificial Intelligence
This is the class that is responsible for the similarity calculations. Please note that Documents in the context of this class correspond to synsets. Each Document structure holds the synset offset the list of words in the synset and a list containing all hypernym offsets. For the sake of computational simplicity, in calculating the best MSCA, the list of hypernyms also contains the synset of the current document.
Copyright: Nuno Seco Copyright (c) 2004
| Constructor Summary | |
|---|---|
| SimilarityAssessor()Void constructor. | |
| SimilarityAssessor(java.lang.String wnIndexPath)The constructor. | |
| Method Summary | |
|---|---|
|  org.apache.lucene.search.Hits | getHits(java.lang.String query)Returns the list of documents that fulfill the given query. | 
|  double | getSenseSimilarity(java.lang.String word1,
                   int senseForWord1,
                   java.lang.String word2,
                   int senseForWord2)Calculates the similarity between two specific senses. | 
|  double | getSimilarity(java.lang.String word1,
              java.lang.String word2)Calculates the similarity between the two words, given as parameters, according to the referenced paper. | 
|  java.lang.String | getWordsField()Function to retrieve the WORDS field from the broker. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public SimilarityAssessor(java.lang.String wnIndexPath)
public SimilarityAssessor()
| Method Detail | 
|---|
public org.apache.lucene.search.Hits getHits(java.lang.String query)
query - String  The query to be searched
public java.lang.String getWordsField()
public double getSenseSimilarity(java.lang.String word1,
                                 int senseForWord1,
                                 java.lang.String word2,
                                 int senseForWord2)
                          throws WordNotFoundException
word1 - StringsenseForWord1 - int The sense number for the first wordword2 - StringsenseForWord2 - int The sense number for the second word
WordNotFoundException - An exception is thrown if one of the words
 is not contained in the WordNet dictionary.
public double getSimilarity(java.lang.String word1,
                            java.lang.String word2)
                     throws WordNotFoundException
word1 - Stringword2 - String
WordNotFoundException - An exception is thrown if one of the words
 is not contained in the WordNet dictionary.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||