本文整理汇总了Java中edu.mit.jwi.item.POS.VERB属性的典型用法代码示例。如果您正苦于以下问题:Java POS.VERB属性的具体用法?Java POS.VERB怎么用?Java POS.VERB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类edu.mit.jwi.item.POS
的用法示例。
在下文中一共展示了POS.VERB属性的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: check
public boolean check(Map<Variable, String> assignment)
{
final String sourceString = source == null ? sourceLiteral : assignment.get(source);
final String targetString = target == null ? targetLiteral : assignment.get(target);
String posString = source != null ? source.type : target.type;
POS pos = posString.equals("noun") ? POS.NOUN : POS.VERB;
// if we're checking a constraint where one of the variables hasn't been
// assigned yet, it passes for now
if (sourceString == null || targetString == null)
return true;
if (hypernym)
return wordNet.isHypernym(pos, sourceString, pos, targetString);
// hyponym otherwise, which is just the reverse
return wordNet.isHypernym(pos, targetString, pos, sourceString);
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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);
}
示例7: 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);
}
示例8: 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;
}
示例9: 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;
}
示例10: getCorrectPOS
private POS getCorrectPOS(String pos) {
if (pos.startsWith("NN"))
return POS.NOUN;
else if (pos.startsWith("VB"))
return POS.VERB;
return POS.NOUN;
}
示例11: 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 + "'!");
}
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
}
示例15: 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;
}
}