de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS.getType()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS.getType()方法的一些代码示例,展示了POS.getType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POS.getType()方法的具体详情如下:
包路径:de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS
类名称:POS
方法名:getType

POS.getType介绍

暂无

代码示例

代码示例来源:origin: dkpro/dkpro-core

public static void assignCoarseValue(POS pos)
  {
    if (pos == null) {
      return;
    }

    String shortName = pos.getType().getShortName();
    if (!StringUtils.equals(pos.getType().getName(), POS.class.getName())) {

      if (!shortName.startsWith(POS_TYPE_PREFIX)) {
        throw new IllegalArgumentException("The type " + shortName
            + "of the given POS annotation does not fulfill the convention of starting with prefix '"
            + POS_TYPE_PREFIX + "'");
      }
      pos.setCoarseValue(shortName.substring(POS_TYPE_PREFIX.length()).intern());
    }
  }
}

代码示例来源:origin: hltfbk/Excitement-Open-Platform

private static Boolean containsOnlyNonContentPOSes(Token[] tokenArr) throws AlignmentComponentException
{
  logger.debug("checking non content POSes only or not: "); 
  String logline=""; 
  Boolean nonContentPOSesOnly = true; 
  for(Token t : tokenArr)
  {
    POS p = t.getPos(); 
    if (p == null)
    {
      throw new AlignmentComponentException("Unable to Process this CAS: There is one (or more) token without POS annotation. The process requires POS and Lemma annotated.");
    }
    String s = p.getType().toString(); 	
    String typeString = s.substring(s.lastIndexOf(".") + 1); 
    logline += t.getCoveredText() + "/" + typeString + ", "; 
    if (!(isNonContentPos.containsKey(typeString)) )
    {
      nonContentPOSesOnly = false; 
      // break; // no need to continue. 
    }
  }
  logger.debug(logline + " => " + nonContentPOSesOnly.toString()); 
  return nonContentPOSesOnly; 
}

代码示例来源:origin: hltfbk/Excitement-Open-Platform

/**
 * This utility checks if the token is one of non-content token type. 
 * (e.g. "PUNC", "PP", "O", "CONJ", "ART"). Actual definition of non content POSes
 * are borrowed from a static definition set in IdenticalLemmaPhraseLinker. 
 * 
 * @param t The token to be checked. 
 * @return
 */
private boolean isNonContentToken(Token t) throws ScoringComponentException 
{
  
  POS p = t.getPos(); 
  if (p == null)
  {
    throw new ScoringComponentException("The module requires POS annotated for the Tokens, to check non-content words"); 
  }
  String s = p.getType().toString(); 	
  String typeString = s.substring(s.lastIndexOf(".") + 1); 
  //String logline = t.getCoveredText() + "/" + typeString + ", ";
  Boolean result = IdenticalLemmaPhraseLinker.isNonContentPos.containsKey(typeString); 
  logger.debug(t.getCoveredText() + "/" + typeString + ": isNonContentToken: " + result); 
  return result; 
}

代码示例来源:origin: hltfbk/Excitement-Open-Platform

String s = p.getType().toString(); 	
String typeString = s.substring(s.lastIndexOf(".") + 1); 	
lemPos += "/" + typeString;

代码示例来源:origin: hltfbk/Excitement-Open-Platform

source.get(i-1).getPos().getType().getName().equals(target.get(j-1).getPos().getType().getName()) && 
getRulesFromResource(getTokenBaseForm(source.get(i-1)), new ByCanonicalPartOfSpeech(source.get(i-1).getPos().getType().getShortName()),
    getTokenBaseForm(target.get(j-1)), new ByCanonicalPartOfSpeech(target.get(j-1).getPos().getType().getShortName())))

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.testing-asl

actualMapped.add(posAnnotation.getType().getShortName());

代码示例来源:origin: dkpro/dkpro-core

actualMapped.add(posAnnotation.getType().getShortName());

代码示例来源:origin: hltfbk/Excitement-Open-Platform

String s = p.getType().toString(); 	
String typeString = s.substring(s.lastIndexOf(".") + 1); 	
lemPos += "/" + typeString; 
String s = p.getType().toString(); 	
String typeString = s.substring(s.lastIndexOf(".") + 1); 	
lemPos += "/" + typeString;

代码示例来源:origin: hltfbk/Excitement-Open-Platform

int posCount = countAnnotation(aJCas, pos.getType());

代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

if ((token.getPos().getType().getShortName().equals("V") ||
    token.getPos().getType().getShortName().matches("N.*") ||
    token.getPos().getType().getShortName().equals("ADJ"))  &&
    !auxiliariesAndModals.contains(token.getLemma().getValue())) {
    mfs = getMostFrequentSense(uby.getLexicalEntries(token.getLemma().getValue(), null, null));
String syntacticBehaviour = getSyntacticBehaviour(token.getPos().getType().getShortName(),uby.getLexicalEntries(token.getLemma().getValue(),
    EPartOfSpeech.verb, null));
List<SemanticField> semanticFieldAnnotations = JCasUtil.selectCovering(jcas,
        + token.getPos().getType().getShortName() + "\n"
        + "\t syntax: " +syntacticBehaviour + "\n"
    writeTokenAndSemanticField(token.getCoveredText() + "\t"
        + token.getLemma().getValue() + "\t"
        + token.getPos().getType().getShortName() + "\n"
        );

代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.uima-asl

if (corePosToUbyPos(token.getPos().getType().getShortName()).length == 0) {
  return "UNKNOWN"; 
  return "UNKNOWN"; 
} else { // there is at least one UBY lexicon that contains the lemma
  for (EPartOfSpeech pos : corePosToUbyPos(token.getPos().getType().getShortName())) {

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.tokit-asl

if (pos != null && !pos.getType().equals(type)) {

相关文章