private static IndexWord[] getWordArray(String word) throws JWNLException { if (dictionary == null) { throw exc; } return dictionary.lookupAllIndexWords(word).getIndexWordArray(); }
@Override public boolean containsLexeme(String lexeme) throws LexicalSemanticResourceException { if (lexeme == null) { return false; } try { //zhu case sensitivity IndexWord[] indexWords = dict.lookupAllIndexWords(lexeme).getIndexWordArray(); for (IndexWord item : indexWords){ //TODO how to do if the lookupAllIndexWords returns a stemmed form? if(isCaseSensitive){ if(item.getLemma().equals(lexeme)) { return true; } }else{ if(item.getLemma().equalsIgnoreCase(lexeme)) { return true; } } } } catch (JWNLException e) { throw new LexicalSemanticResourceException(e); } return false; }