本文整理了Java中net.didion.jwnl.dictionary.Dictionary.lookupAllIndexWords()
方法的一些代码示例,展示了Dictionary.lookupAllIndexWords()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dictionary.lookupAllIndexWords()
方法的具体详情如下:
包路径:net.didion.jwnl.dictionary.Dictionary
类名称:Dictionary
方法名:lookupAllIndexWords
[英]Return a set of IndexWord
s, with each element in the set corresponding to a part-of-speech of word.
[中]返回一组IndexWord
s,其中每个元素对应于word的一个词性。
代码示例来源:origin: Noahs-ARK/semafor
public void getAllIndexWords(String word){
allIndexWords.clear();
IndexWord[] iWordArr = null;
IndexWord iWord = null;
try {
IndexWordSet iWordSet = wDict.lookupAllIndexWords(word);
if(iWordSet != null){
iWordArr = iWordSet.getIndexWordArray();
for(int i=0;i<iWordArr.length;i++){
iWord = iWordArr[i];
//System.out.println("indexWord:"+iWord.getLemma());
allIndexWords.add(iWord);
}
}
} catch (Exception e) {
//System.out.println("getSynonym ERROR: " + word);
}
}
代码示例来源:origin: CogComp/cogcomp-nlp
public synchronized POS[] getPOS(String s) throws JWNLException {
// Look up all IndexWords (an IndexWord can only be one POS)
IndexWordSet set = wordnet.lookupAllIndexWords(s);
// Turn it into an array of IndexWords
IndexWord[] words = set.getIndexWordArray();
// Make the array of POS
POS[] pos = new POS[words.length];
for (int i = 0; i < words.length; i++) {
pos[i] = words[i].getPOS();
}
return pos;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-edison
public synchronized POS[] getPOS(String s) throws JWNLException {
// Look up all IndexWords (an IndexWord can only be one POS)
IndexWordSet set = wordnet.lookupAllIndexWords(s);
// Turn it into an array of IndexWords
IndexWord[] words = set.getIndexWordArray();
// Make the array of POS
POS[] pos = new POS[words.length];
for (int i = 0; i < words.length; i++) {
pos[i] = words[i].getPOS();
}
return pos;
}
代码示例来源:origin: hltfbk/Excitement-Open-Platform
public Map<WordNetPartOfSpeech, List<Synset>> getSortedSynsetOf(String lemma) throws WordNetException
{
Map<WordNetPartOfSpeech, List<Synset>> ret = new HashMap<WordNetPartOfSpeech, List<Synset>>();
if (doNotProcessThisWord(lemma)) ;
else
{
try
{
net.didion.jwnl.data.IndexWordSet indexWordSet = jwnlRealDictionary.lookupAllIndexWords(lemma);
if (indexWordSet!=null)
{
for (WordNetPartOfSpeech partOfSpeech : WordNetPartOfSpeech.values())
{
net.didion.jwnl.data.POS pos = JwnlUtils.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;
}
代码示例来源:origin: hltfbk/Excitement-Open-Platform
net.didion.jwnl.data.IndexWordSet indexWordSet = jwnlRealDictionary.lookupAllIndexWords(lemma);
if (indexWordSet!=null)
内容来源于网络,如有侵权,请联系作者删除!