当前位置: 首页>>代码示例>>Java>>正文


Java POS.VERB属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:cs-zyluo,项目名称:CausalNet,代码行数:18,代码来源:DepSet.java

示例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);
}
 
开发者ID:anadrome,项目名称:word-constraints,代码行数:16,代码来源:WordNetConstraint.java

示例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;
}
 
开发者ID:annefried,项目名称:sitent,代码行数:29,代码来源:WordNetUtils.java

示例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;
}
 
开发者ID:millecker,项目名称:senti-storm,代码行数:16,代码来源:POSTag.java

示例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;
	
	
}
 
开发者ID:everling,项目名称:PRECISE,代码行数:17,代码来源:Parser.java

示例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);
}
 
开发者ID:MusicCraftor,项目名称:WordNet-Explorer,代码行数:24,代码来源:WordDic.java

示例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);
}
 
开发者ID:mikelewis0,项目名称:easyccg,代码行数:21,代码来源:Lemmatizer.java

示例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;
}
 
开发者ID:pschuette22,项目名称:Zeppa-AppEngine,代码行数:26,代码来源:GeneralUtils.java

示例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;
	}
 
开发者ID:SI3P,项目名称:supWSD,代码行数:29,代码来源:WordNetInventory.java

示例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;
}
 
开发者ID:utk4rsh,项目名称:question-classifier,代码行数:7,代码来源:HeadWordExtractor.java

示例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 + "'!");
  }
}
 
开发者ID:millecker,项目名称:senti-storm,代码行数:14,代码来源:POSTag.java

示例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;
}
 
开发者ID:millecker,项目名称:senti-storm,代码行数:15,代码来源:POSTag.java

示例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;
}
 
开发者ID:kouylekov,项目名称:edits,代码行数:11,代码来源:WordnetRulesSource.java

示例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; 
	}
}
 
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:16,代码来源:SemanticDistanceEvaluator.java

示例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; 
	}
}
 
开发者ID:MDEGroup,项目名称:EMFCompare-Semantic-Extension,代码行数:13,代码来源:SemanticDistanceEvaluator.java


注:本文中的edu.mit.jwi.item.POS.VERB属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。