RiTa
index
Name getDistance()
Class RiWordnet
Description Returns the min distance between any two senses for the 2 words in the wordnet tree (result normalized to 0-1) with specified pos, or 1.0 if either is not found.

The algorithm procedes as follows:

  1. locate node cp, the common parent of the two lemmas, if one exists, by checking each sense of each lemma; if one is not found, return 1.0
  2. calculate minDistToCommonParent, the shortest path from either lemma to cp
  3. calculate distFromCommonParentToRoot, the length of the path from cp to the root of ontology
  4. calculate and return the normalizedDistToCommonParent as:
    (minDistToCommonParent / (distFromCommonParentToRoot + minDistToCommonParent))
    Syntax
    getDistance(lemma1, lemma2, pos);
    
    Returns float
    Usage Web & Application
    Related