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

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

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

CAS.getSofaIterator介绍

[英]Get iterator for all SofaFS in the CAS.
[中]获取CAS中所有SOFAF的迭代器。

代码示例

代码示例来源:origin: apache/uima-uimaj

public static ViewInfo[] getOtherViews(CAS cas) {
 Iterator<SofaFS> sofaIt = cas.getSofaIterator();
 List<ViewInfo> r = new ArrayList<ViewInfo>();
 while (sofaIt.hasNext()) {
  SofaFS item = sofaIt.next();
  CAS oCas = cas.getView(item);
  if (oCas != cas)
   r.add(new ViewInfo(oCas));
 }
 return r.toArray(new ViewInfo[r.size()]);
}

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

/**
 * Does a complete deep copy of one CAS into another CAS. The contents of each view in the
 * source CAS will be copied to the same-named view in the destination CAS. If the view does not
 * already exist it will be created. All FeatureStructures that are indexed in a view in the
 * source CAS will become indexed in the same-named view in the destination CAS.
 *
 * @param aSrcCas
 *            the CAS to copy from
 * @param aDestCas
 *            the CAS to copy to
 * @param aCopySofa
 *            if true, the sofa data and mimeType of each view will be copied. If false they
 *            will not.
 */
public static void copyCas(CAS aSrcCas, CAS aDestCas, boolean aCopySofa)
{
  CasCopier copier = new CasCopier(aSrcCas, aDestCas);
  Iterator<SofaFS> sofaIter = aSrcCas.getSofaIterator();
  while (sofaIter.hasNext()) {
    SofaFS sofa = sofaIter.next();
    CAS view = aSrcCas.getView(sofa);
    copier.copyCasView(view, aCopySofa);
  }
}

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

boolean hasNonDefaultSofa = false;
Feature sofaIdFeature = this.typeSystem.getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
FSIterator<SofaFS> sofaIterator = this.cas.getSofaIterator();
while (sofaIterator != null && sofaIterator.hasNext()) {
  SofaFS sofa = sofaIterator.next();

代码示例来源:origin: org.apache.uima/uimaj-tools

boolean hasNonDefaultSofa = false;
Feature sofaIdFeature = this.typeSystem.getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
FSIterator<SofaFS> sofaIterator = this.cas.getSofaIterator();
while (sofaIterator != null && sofaIterator.hasNext()) {
 SofaFS sofa = sofaIterator.next();

代码示例来源:origin: apache/uima-uimaj

FSIterator sItr = cas.getSofaIterator();
while (sItr.isValid()) {
 sofa = (SofaFS) sItr.get();

代码示例来源:origin: apache/uima-uimaj

FSIterator sItr = cas.getSofaIterator();
while (sItr.isValid()) {
 sofa = (SofaFS) sItr.get();

相关文章