예제 #1
0
 /**
  * Returns the index of the word which has the <var>lemma</var> or -1 if not found.
  *
  * @param lemma lemma to check
  * @return true if <var>lemma</var> is one of the words contained in this synset
  */
 public int indexOfWord(String lemma) {
   if (null == lemma) {
     throw new IllegalArgumentException(JWNL.resolveMessage("DICTIONARY_EXCEPTION_046"));
   }
   for (int i = 0; i < words.size(); i++) {
     if (words.get(i).getLemma().equalsIgnoreCase(lemma)) {
       return i;
     }
   }
   return -1;
 }