/** * Returns true if <var>lemma</var> is one of the words contained in this synset. * * @param lemma lemma to check * @return true if <var>lemma</var> is one of the words contained in this synset */ public boolean containsWord(String lemma) { checkLemmaIsNotNull(lemma); for (Word word : words) { if (word.getLemma().equalsIgnoreCase(lemma)) { return true; } } return false; }
/** * Returns true if <var>lemma</var> is one of the words contained in this synset. * * @param lemma lemma to check * @return true if <var>lemma</var> is one of the words contained in this synset */ public boolean containsWord(String lemma) { checkLemmaIsNotNull(lemma); for (Word word : words) { if (word.getLemma().equalsIgnoreCase(lemma)) { return true; } } return false; }
/** * 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) { checkLemmaIsNotNull(lemma); for (int i = 0; i < words.size(); i++) { if (words.get(i).getLemma().equalsIgnoreCase(lemma)) { return i; } } return -1; }
/** * 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) { checkLemmaIsNotNull(lemma); for (int i = 0; i < words.size(); i++) { if (words.get(i).getLemma().equalsIgnoreCase(lemma)) { return i; } } return -1; }