IndexWord word = null;
POS[] posTags = new POS[] { POS.NOUN, POS.ADJECTIVE, POS.VERB, POS.ADVERB };
IndexWordSet wordSet = dictionary.lookupAllIndexWords(s);
if (wordSet != null)
for (int i = 0; i < posTags.length && (word == null); i++)
word = wordSet.getIndexWord(posTags[i]);
if ((word == null) && (stemmer != null)) {
IndexWordSet stemmedWordSet = dictionary.lookupAllIndexWords(stemmer.getBase(s));
if (stemmedWordSet != null)
for (int i = 0; i < posTags.length && (word == null); i++)
word = stemmedWordSet.getIndexWord(posTags[i]);
}
return word;
}