/** * Finds out how many senses the word with part-of-speech <var>pos</var> has. * * @param pos POS * @return number of senses the word with part-of-speech <var>pos</var> has */ public int getSenseCount(POS pos) { int result = 0; IndexWord indexWord = getIndexWord(pos); if (null != indexWord) { result = indexWord.getSenses().size(); } return result; }
/** * Finds out how many senses the word with part-of-speech <var>pos</var> has. * * @param pos POS * @return number of senses the word with part-of-speech <var>pos</var> has */ public int getSenseCount(POS pos) { int result = 0; IndexWord indexWord = getIndexWord(pos); if (null != indexWord) { result = indexWord.getSenses().size(); } return result; }
public String toString() { String str; if (size() == 0) { str = "<empty>"; } else { StringBuilder buf = new StringBuilder(); for (POS o : getValidPOSSet()) { buf.append(getIndexWord(o).toString()); } str = buf.toString(); } return ResourceBundleSet.insertParams("[IndexWordSet: {0}]", new String[]{str}); }
public String toString() { String str; if (size() == 0) { str = "<empty>"; } else { StringBuilder buf = new StringBuilder(); for (POS o : getValidPOSSet()) { buf.append(getIndexWord(o).toString()); } str = buf.toString(); } return ResourceBundleSet.insertParams("[IndexWordSet: {0}]", new String[]{str}); }
public Map<WordNetPartOfSpeech, List<Synset>> getSortedSynsetOf(String lemma) throws WordNetException { Map<WordNetPartOfSpeech, List<Synset>> ret = new LinkedHashMap<WordNetPartOfSpeech, List<Synset>>(); if (doNotProcessThisWord(lemma)) ; else { try { IndexWordSet indexWordSet = extJwnlRealDictionary.lookupAllIndexWords(lemma); if (indexWordSet!=null) { for (WordNetPartOfSpeech partOfSpeech : WordNetPartOfSpeech.values()) { POS pos = ExtJwnlUtils.getJwnlPartOfSpeec(partOfSpeech); if (indexWordSet.getIndexWord(pos)!=null) ret.put(partOfSpeech, indexWordToList(indexWordSet.getIndexWord(pos))); } } } catch(JWNLException e) { throw new WordNetException("looking for lemma <"+lemma+"> failed. See nested exception",e); } } return ret; }
public Map<WordNetPartOfSpeech, Set<Synset>> getSynsetOf(String lemma) throws WordNetException { Map<WordNetPartOfSpeech, Set<Synset>> ret = new LinkedHashMap<WordNetPartOfSpeech, Set<Synset>>(); if (doNotProcessThisWord(lemma)) ; else { try { IndexWordSet indexWordSet = extJwnlRealDictionary.lookupAllIndexWords(lemma); if (indexWordSet!=null) { for (WordNetPartOfSpeech partOfSpeech : WordNetPartOfSpeech.values()) { POS pos = ExtJwnlUtils.getJwnlPartOfSpeec(partOfSpeech); if (indexWordSet.getIndexWord(pos)!=null) ret.put(partOfSpeech, indexWordToSet(indexWordSet.getIndexWord(pos))); } } } catch(JWNLException e) { throw new WordNetException("looking for lemma <"+lemma+"> failed. See nested exception",e); } } return ret; }