gov.llnl.ontology.wordnet.sim
Class LeacockChodorowSimilarity
java.lang.Object
gov.llnl.ontology.wordnet.sim.LeacockChodorowSimilarity
- All Implemented Interfaces:
- SynsetSimilarity
- Direct Known Subclasses:
- LeacockChodorowScaledSimilarity
public class LeacockChodorowSimilarity
- extends Object
- implements SynsetSimilarity
Implements the Leacock Chodorow Similarity measure. This measure scores
Synset
similarity based on the shortest path connecting the two and
the maximum depth of the taxonomy for the particular part of speech. The
score is given as -log(p/2d) where p is the shortest path length and d is the
maximum taxonomy depth. If synset1
and synset2
have
different PartsOfSpeech
, -1 is returned.
- Author:
- Keith Stevens
Method Summary |
double |
similarity(Synset synset1,
Synset synset2)
Returns the similarity between synset1 and synset2 based
on how they are connected in the word net hierarchy. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LeacockChodorowSimilarity
public LeacockChodorowSimilarity(OntologyReader reader)
- Creates an instance of
LeacockChodorowSimilarity
.
similarity
public double similarity(Synset synset1,
Synset synset2)
- Returns the similarity between
synset1
and synset2
based
on how they are connected in the word net hierarchy.
- Specified by:
similarity
in interface SynsetSimilarity
Copyright © 2010-2011. All Rights Reserved.