本文整理汇总了Java中edu.mit.jwi.item.POS.ADVERB属性的典型用法代码示例。如果您正苦于以下问题:Java POS.ADVERB属性的具体用法?Java POS.ADVERB怎么用?Java POS.ADVERB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类edu.mit.jwi.item.POS
的用法示例。
在下文中一共展示了POS.ADVERB属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJWIStylePos
public static POS getJWIStylePos(String postag){
if (verb_postag.contains(postag)){
return POS.VERB;
}
else if (real_noun_postag.contains(postag)){
return POS.NOUN;
}
else if (adj_postag.contains(postag)){
return POS.ADJECTIVE;
}
else if (adv_postag.contains(postag)){
return POS.ADVERB;
}
else {
return POS.NOUN;
}
}
示例2: getPOSFromPenn
/**
* JWI POS tag from Penn tag. (by Nils Reiter)
*
* @param postag
* @return
*/
public static POS getPOSFromPenn(String postag) {
POS pos = null;
switch (postag.charAt(0)) {
case 'J':
case 'j':
pos = POS.ADJECTIVE;
break;
case 'N':
case 'n':
pos = POS.NOUN;
break;
case 'V':
case 'v':
pos = POS.VERB;
break;
case 'R':
case 'r':
if (postag.charAt(1) == 'B' || postag.charAt(1) == 'b')
pos = POS.ADVERB;
break;
}
return pos;
}
示例3: convertArk
public static POS convertArk(String arkTag) {
if (arkTag.equals("N") || arkTag.equals("O") || arkTag.equals("^")
|| arkTag.equals("S") || arkTag.equals("Z")) {
return POS.NOUN;
}
if (arkTag.equals("V")) {
return POS.VERB;
}
if (arkTag.equals("A")) {
return POS.ADJECTIVE;
}
if (arkTag.equals("R")) {
return POS.ADVERB;
}
return null;
}
示例4: getWordnetPOS
public static POS getWordnetPOS(CoreLabel word){
String stanfordPOS = word.getString(PartOfSpeechAnnotation.class);
if(stanfordPOS.startsWith("N"))
return POS.NOUN;
if(stanfordPOS.startsWith("J"))
return POS.ADJECTIVE;
if(stanfordPOS.startsWith("V"))
return POS.VERB;
if(stanfordPOS.startsWith("R"))
return POS.ADVERB;
return null;
}
示例5: getMeaning
public String getMeaning(int nType, int order){
POS pos;
switch(nType){
case nNOUN:
pos = POS.NOUN;
break;
case nVERB:
pos = POS.VERB;
break;
case nADJ:
pos = POS.ADJECTIVE;
break;
case nADV:
pos = POS.ADVERB;
break;
default:
pos = POS.NOUN;
break;
}
String gloss = dict.getSynset(
dict.getIndexWord(wordName, pos).getWordIDs().get(order).getSynsetID()).getGloss();
int partitionIndex = gloss.indexOf('\"');
return gloss.substring(0, (partitionIndex < 0) ? gloss.length() : partitionIndex);
}
示例6: getSynsetType
private static POS getSynsetType(String pos) {
if (!synsetTypeForPOS.containsKey(pos)) {
POS result = null;
if (pos.startsWith("NN")) {
result = POS.NOUN;
} else if (pos.startsWith("VB")) {
result = POS.VERB;
} else if (pos.startsWith("RB")) {
result = POS.ADVERB;
} else if (pos.startsWith("JJ")) {
result = POS.ADJECTIVE;
}
if (result != null) {
synsetTypeForPOS.put(pos, result);
}
}
return synsetTypeForPOS.get(pos);
}
示例7: getTagfromTag
/**
* converts string to {@link POS}
* @param tag
* @return
*/
public static POS getTagfromTag(String tag)
{
if(tag.toLowerCase().startsWith("n"))
return POS.NOUN;
else
if(tag.toLowerCase().startsWith("v"))
return POS.VERB;
else
if(tag.toLowerCase().startsWith("r") || tag.toLowerCase().startsWith("adv"))
return POS.ADVERB;
else
if(tag.toLowerCase().startsWith("j")
|| tag.toLowerCase().startsWith("adj")
|| tag.toLowerCase().startsWith("a"))
return POS.ADJECTIVE;
return null;
}
示例8: getPOS
private POS getPOS(TAG pos) {
POS ps = null;
switch (pos) {
case n:
ps = POS.NOUN;
break;
case v:
ps = POS.VERB;
break;
case a:
ps = POS.ADJECTIVE;
break;
case r:
ps = POS.ADVERB;
break;
default:
ps = POS.NOUN;
break;
}
return ps;
}
示例9: parseString
public static POS parseString(String tag) {
switch (tag.charAt(0)) {
case 'n':
return POS.NOUN;
case 'v':
return POS.VERB;
case 'a':
return POS.ADJECTIVE;
case 'r':
return POS.ADVERB;
default:
throw new IllegalStateException("Unknown POS tag '" + tag + "'!");
}
}
示例10: convertPTB
public static POS convertPTB(String pennTag) {
if (pennTag.startsWith("NN")) { // includes proper nouns
return POS.NOUN;
}
if (pennTag.startsWith("VB")) {
return POS.VERB;
}
if (pennTag.startsWith("JJ")) {
return POS.ADJECTIVE;
}
if (pennTag.startsWith("RB")) {
return POS.ADVERB;
}
return null;
}
示例11: toPOS
public POS toPOS(String pos) {
if (pos.equals("noun"))
return POS.NOUN;
if (pos.equals("verb"))
return POS.VERB;
if (pos.equals("adj"))
return POS.ADJECTIVE;
if (pos.equals("adv"))
return POS.ADVERB;
return null;
}
示例12: retrieveWordnetPOS
/**
* Retrieve Wordnet POS
**/
private POS retrieveWordnetPOS(String pos){
if (pos.toUpperCase().startsWith("VB") || pos.toUpperCase().equals("MD")) {
return POS.VERB;
} else if (pos.toUpperCase().startsWith("NN")) {
return POS.NOUN;
} else if(pos.toUpperCase().startsWith("RB") || pos.toUpperCase().equals("WRB")){
return POS.ADVERB;
} else if(pos.toUpperCase().startsWith("JJ")){
return POS.ADJECTIVE;
} else {
return null;
}
}
示例13: retrieveWordnetPOS
private POS retrieveWordnetPOS(String pos){
if(pos.toUpperCase().startsWith("VB") || pos.toUpperCase().equals("MD")){
return POS.VERB;
} else if(pos.toUpperCase().startsWith("NN")){
return POS.NOUN;
} else if(pos.toUpperCase().startsWith("RB") || pos.toUpperCase().equals("WRB")){
return POS.ADVERB;
} else if(pos.toUpperCase().startsWith("JJ")){
return POS.ADJECTIVE;
} else {
return null;
}
}
示例14: getCoreNLPPOS
/** translate CoreNLP POS string to Wordnet POS */
public static POS getCoreNLPPOS(String pos) {
if (pos.startsWith("N"))
return POS.NOUN;
else if (pos.startsWith("V"))
return POS.VERB;
else if (pos.equals("JJ"))
return POS.ADJECTIVE;
else if (pos.equals("RB"))
return POS.ADVERB;
return null;
}
示例15: posFromString
private POS posFromString(String posStr) {
POS pos;
if (posStr.startsWith("n")) {
pos = POS.NOUN;
} else if (posStr.startsWith("v")) {
pos = POS.VERB;
} else if (posStr.startsWith("j")) {
pos = POS.ADJECTIVE;
} else if (posStr.startsWith("a")) {
pos = POS.ADVERB;
} else {
pos = null;
}
return pos;
}