org.apache.uima.cas.CAS.getJCas()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(183)

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

CAS.getJCas介绍

[英]Get the JCas for this CAS.
[中]获取此CAS的JCA。

代码示例

代码示例来源:origin: org.apache.uima/ruta-core

public JCas getJCas() {
 try {
  return cas.getJCas();
 } catch (CASException e) {
  // e.printStackTrace();
 }
 return null;
}

代码示例来源:origin: org.apache.uima/uimafit-core

/**
 * Create a new JCas for the given type system description. No auto-detection type priorities, or
 * indexes is performed.
 * 
 * @param typeSystemDescription
 *          a type system description to initialize the JCas
 * @return a new JCas
 * @throws UIMAException
 *           if the JCas could not be initialized
 */
public static JCas createJCas(TypeSystemDescription typeSystemDescription) throws UIMAException {
 return CasCreationUtils.createCas(typeSystemDescription, null, null).getJCas();
}

代码示例来源:origin: org.apache.uima/textmarker-core

public JCas getJCas() {
 try {
  return cas.getJCas();
 } catch (CASException e) {
  e.printStackTrace();
 }
 return null;
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public DynamicTypeGenerator(TypeSystemDescription typeSystemDescription) {
  try {
    JCas jCas = CasCreationUtils.createCas(typeSystemDescription, null, null).getJCas();
    this.typeSystemDescription = typeSystemDescription;
    customTypes = new HashSet<>();
  } catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
  }
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public DynamicTypeGenerator(ArrayList<TypeSystemDescription> typeSystemDescriptions) {
  try {
    TypeSystemDescription mergedTypeSystem = CasCreationUtils.mergeTypeSystems(typeSystemDescriptions);
    this.typeSystemDescription = mergedTypeSystem;
    JCas jCas = CasCreationUtils.createCas(mergedTypeSystem, null, null).getJCas();
    customTypes = new HashSet<>();
  } catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
  }
}

代码示例来源:origin: de.unistuttgart.ims/uimautil

@Override
public Object getValue(TOP a) {
  try {
    JCas jcas = a.getCAS().getJCas();
    return JCasUtil.select(jcas, Token.class).size();
  } catch (CASException e) {
    e.printStackTrace();
    return 0;
  }
}

代码示例来源:origin: HeidelTime/heideltime

public void getNext(CAS aCAS) throws IOException, CollectionException {
  JCas jcas;
  
  try {
    jcas = aCAS.getJCas();
  } catch (CASException e) {
    throw new CollectionException(e);
  }
  fillJCas(jcas);
  
  // give an indicator that a file has been processed
  System.err.print(".");
}

代码示例来源:origin: org.apache.uima/uimafit-core

public final void getNext(final CAS cas) throws IOException, CollectionException {
 try {
  getNext(cas.getJCas());
 } catch (CASException e) {
  throw new CollectionException(e);
 }
}

代码示例来源:origin: HeidelTime/heideltime

/**
 * process
 */
public void processCas(CAS aCAS) throws ResourceProcessException {
  JCas jcas;
  try {
    jcas = aCAS.getJCas();
  } catch (CASException e) {
    throw new ResourceProcessException(e);
  }
  printTimexAnnotations(jcas);
}

代码示例来源:origin: HeidelTime/heideltime

@Override
  public JCas createJCas() throws CASException,
      ResourceInitializationException {
    return CasCreationUtils.createCas(casManager.getCasDefinition(), null).getJCas();
  }
}

代码示例来源:origin: org.apache.ctakes/ctakes-ytex-uima

@Override
public void getNext(final CAS aCAS) throws IOException, CollectionException {
  try {
    getNext(aCAS.getJCas());
  } catch (CASException e) {
    throw new CollectionException(e);
  }
}

代码示例来源:origin: apache/ctakes

@Override
public void getNext(final CAS aCAS) throws IOException, CollectionException {
  try {
    getNext(aCAS.getJCas());
  } catch (CASException e) {
    throw new CollectionException(e);
  }
}

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

@Override
public final void getNext(CAS cas) throws IOException, CollectionException
{
  try {
    getNext(cas.getJCas());
  }
  catch (CASException e) {
    throw new CollectionException(e);
  }
}

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

@Override
public final void getNext(CAS cas) throws IOException, CollectionException
{
  try {
    getNext(cas.getJCas());
  }
  catch (CASException e) {
    throw new CollectionException(e);
  }
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public JCas initJCas() {
  JCas jCas = null;
  try {
    jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas();
  } catch (CASException e) {
    e.printStackTrace();
  } catch (ResourceInitializationException e) {
    e.printStackTrace();
  }
  return jCas;
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public JCas initJCas() {
  JCas jCas = null;
  try {
    jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas();
  } catch (CASException e) {
    e.printStackTrace();
  } catch (ResourceInitializationException e) {
    e.printStackTrace();
  }
  return jCas;
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public JCas initJCas() {
  JCas jCas = null;
  try {
    jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas();
  } catch (CASException e) {
    e.printStackTrace();
  } catch (ResourceInitializationException e) {
    e.printStackTrace();
  }
  return jCas;
}

代码示例来源:origin: oaqa/baseqa

public static Token getHeadTokenOfAnnotation(Annotation annotation) {
 try {
  return getHeadTokenInRange(annotation.getCAS().getJCas(), annotation.getBegin(),
      annotation.getEnd());
 } catch (CASException e) {
  return null;
 }
}

代码示例来源:origin: uk.gov.dstl.baleen/baleen-uima

private void addMergeToHistory(Annotation keep, Annotation removed) {
 if (keep instanceof Recordable && removed instanceof Base) {
  Recordable r = (Recordable) keep;
  Base b = (Base) removed;
  try {
   addToHistory(
     keep.getCAS().getJCas(), HistoryEvents.createMerged(r, referrer, b.getInternalId()));
  } catch (CASException e) {
   monitor.error("Unable to add merge to history", e);
  }
 }
}

代码示例来源:origin: webanno/webanno

@Override
public JCas readInitialCas(TrainingDocument aDocument)
  throws CASException, ResourceInitializationException, IOException
{
  JCas jcas = CasCreationUtils.createCas((TypeSystemDescription) null, null, null).getJCas();
  CasPersistenceUtils.readSerializedCas(jcas, getCasFile(aDocument));
  automationCasStorageService.analyzeAndRepair(aDocument, jcas.getCas());
  return jcas;
}

相关文章