1

I use Java API for wordnet searching(JAWS) for accessing wordnet from java . When i got to read a few papers about semantic similarity with java , they expect me to find the distance between two synsets (is a relationship is used in building the hierarchy). There is no specific method to find the distance between words in JAWS .

Please tell me if there exists some method in java that gives the distance between two words

Example 

apple -> fruit-> fruits and vegetables (2) 
vegetables -> fruits and vegetables (1)
distance(apple,vegetable) = 3 

Is there a built in method that performs this function ?

CTsiddharth
  • 907
  • 12
  • 21
  • Possible duplicate of [Wordnet Similarity in Java: JAWS, JWNL or Java WN::Similarity?](https://stackoverflow.com/questions/5976537/wordnet-similarity-in-java-jaws-jwnl-or-java-wnsimilarity) – fantaghirocco Mar 29 '19 at 15:08

2 Answers2

1

you can use rita wordnet for that : http://rednoise.org/rita/reference/RiWordNet/getDistance/

Chinmay
  • 338
  • 1
  • 5
  • 19
1

It seems there isn't using only JAWS, but this answer gives a solution.

Community
  • 1
  • 1
Vladtn
  • 2,506
  • 3
  • 27
  • 23
  • Thanks . But it gives the similarity between two words . I just want the distance between the two terms – CTsiddharth Mar 06 '12 at 11:20
  • 1
    Technically a similarity measure _is_ a distance measure: the smaller the similarity the larger the distance between the two words. If you mean by distance the number of edges to a common root, then you will have to count them. The similarity measure Wu & Palmer (1994) that is available in the linked API does just that: you could check its source code or just use the similarity it gives as a measure of your distance. – Vladtn Mar 06 '12 at 11:30