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


Java POS.ADVERB属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:16,代码来源:JwnlUtils.java

示例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;
}
 
开发者ID:apache,项目名称:opennlp-addons,代码行数:40,代码来源:JWNLLemmatizer.java

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

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

示例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;
}
 
开发者ID:Noahs-ARK,项目名称:semafor-semantic-parser,代码行数:33,代码来源:WordNetRelations.java

示例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;
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:15,代码来源:JwnlUtils.java

示例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;
}
 
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:29,代码来源:WNHelper.java


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