本文整理汇总了Java中net.didion.jwnl.data.POS.ADVERB属性的典型用法代码示例。如果您正苦于以下问题:Java POS.ADVERB属性的具体用法?Java POS.ADVERB怎么用?Java POS.ADVERB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.didion.jwnl.data.POS
的用法示例。
在下文中一共展示了POS.ADVERB属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJwnlPartOfSpeec
static POS getJwnlPartOfSpeec(WordNetPartOfSpeech partOfSpeech)
{
switch(partOfSpeech)
{
case ADJECTIVE:
return POS.ADJECTIVE;
case ADVERB:
return POS.ADVERB;
case NOUN:
return POS.NOUN;
case VERB:
return POS.VERB;
default:
return null;
}
}
示例2: lemmatize
/**
* It takes a word and a POS tag and obtains a word's lemma from WordNet.
*
* @param word
* @param postag
* @return lemma
*/
public String lemmatize(String word, String postag) {
String constantTag = "NNP";
IndexWord baseForm;
String lemma = null;
try {
POS pos;
if (postag.startsWith("N") || postag.startsWith("n")) {
pos = POS.NOUN;
} else if (postag.startsWith("V") || postag.startsWith("v")) {
pos = POS.VERB;
} else if (postag.startsWith("J") || postag.startsWith("a")) {
pos = POS.ADJECTIVE;
} else if (postag.startsWith("RB") || postag.startsWith("r")) {
pos = POS.ADVERB;
} else {
pos = POS.ADVERB;
}
baseForm = morphy.lookupBaseForm(pos, word);
if (baseForm != null) {
lemma = baseForm.getLemma().toString();
}
else if (baseForm == null && postag.startsWith(String.valueOf(constantTag))) {
lemma = word;
}
else {
lemma= word.toLowerCase();
}
} catch (JWNLException e) {
e.printStackTrace();
return null;
}
return lemma;
}
示例3: getPOS
private POS getPOS(String pos) {
POS POSTag;
POSMap.TAG tag;
tag = POSMap.getInstance().getPOS(pos);
switch (tag) {
case n:
POSTag = POS.NOUN;
break;
case v:
POSTag = POS.VERB;
break;
case a:
POSTag = POS.ADJECTIVE;
break;
case r:
POSTag = POS.ADVERB;
break;
default:
POSTag = POS.NOUN;
break;
}
return POSTag;
}
示例4: getPOS
private POS getPOS(POSMap.TAG tag) {
POS POSTag;
switch (tag) {
case n:
POSTag = POS.NOUN;
break;
case v:
POSTag = POS.VERB;
break;
case a:
POSTag = POS.ADJECTIVE;
break;
case r:
POSTag = POS.ADVERB;
break;
default:
POSTag = POS.NOUN;
break;
}
return POSTag;
}
示例5: getLemmaForWord
public String getLemmaForWord(String word, String pos)
{
if(wordLemmaMap.containsKey(word+"_"+pos))
return wordLemmaMap.get(word+"_"+pos);
POS wnPOS=null;
if(pos.startsWith("V"))
{
wnPOS = POS.VERB;
}
else if(pos.startsWith("J"))
{
wnPOS = POS.ADJECTIVE;
}
else if(pos.startsWith("R"))
{
wnPOS = POS.ADVERB;
}
else
wnPOS = POS.NOUN;
if(word.equals("'ve"))
word="have";
else if(word.equals("n't"))
word="not";
else if(word.equals("'s")&&pos.startsWith("V"))
word="is";
else if(word.equals("'ll"))
word="will";
else if(word.equals("'re"))
word="are";
String lemma=getLemma(word, wnPOS);
wordLemmaMap.put(word+"_"+pos, lemma);
return lemma;
}
示例6: getWordNetPartOfSpeech
static WordNetPartOfSpeech getWordNetPartOfSpeech(POS pos)
{
if (null==pos)
return null;
if (POS.ADJECTIVE == pos)
return WordNetPartOfSpeech.ADJECTIVE;
else if (POS.ADVERB == pos)
return WordNetPartOfSpeech.ADVERB;
else if (POS.NOUN == pos)
return WordNetPartOfSpeech.NOUN;
else if (POS.VERB == pos)
return WordNetPartOfSpeech.VERB;
return null;
}
示例7: int2POS
/** converts GATE pos to JWNL pos */
public static POS int2POS(int pos) {
POS result = null;
switch(pos) {
case WordNet.POS_ADJECTIVE:
result = POS.ADJECTIVE;
break;
case WordNet.POS_ADVERB:
result = POS.ADVERB;
break;
case WordNet.POS_NOUN:
result = POS.NOUN;
break;
case WordNet.POS_VERB:
result = POS.VERB;
break;
default:
throw new IllegalArgumentException();
}
return result;
}