Does anyone know how I can take the synonyms of a word using JWNL (Java Wordnet Library) ordered by estimated frequency? I know this can be done somehow, because Wordnet's application can do it. (I don't know if it matters, but I am using Wordnet 2.1)
Here is my code of how I get synonyms, could anyone please tell me what I should add... (completely different ways of doing it are also welcomed!)
ArrayList<String> synonyms=new ArrayList<String>();
System.setProperty("wordnet.database.dir", filepath);
String wordForm = "make";
Synset[] synsets = database.getSynsets(wordForm,SynsetType.VERB);
if (synsets.length > 0) {
for (int i = 0; i < synsets.length; i++) {
String[] wordForms = synsets[i].getWordForms();
for (int j = 0; j < wordForms.length; j++) {
if(!synonyms.contains(wordForms[j])){
synonyms.add(wordForms[j]); }
}
}
}