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


Java FSArray.toArray方法代码示例

本文整理汇总了Java中org.apache.uima.jcas.cas.FSArray.toArray方法的典型用法代码示例。如果您正苦于以下问题:Java FSArray.toArray方法的具体用法?Java FSArray.toArray怎么用?Java FSArray.toArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.uima.jcas.cas.FSArray的用法示例。


在下文中一共展示了FSArray.toArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMultipleSlotMentionsByName

import org.apache.uima.jcas.cas.FSArray; //导入方法依赖的package包/类
public static List<CCPSlotMention> getMultipleSlotMentionsByName(CCPClassMention ccpClassMention,
		String slotMentionName) {
	List<CCPSlotMention> returnSlotMentions = new ArrayList<CCPSlotMention>();
	FSArray slotMentionsArray = ccpClassMention.getSlotMentions();
	if (slotMentionsArray != null) {
		FeatureStructure[] slotMentions = slotMentionsArray.toArray();
		for (FeatureStructure fs : slotMentions) {
			CCPSlotMention ccpSlotMention = (CCPSlotMention) fs;
			if (ccpSlotMention.getMentionName().equals(slotMentionName)) {
				returnSlotMentions.add(ccpSlotMention);
			}
		}
		return returnSlotMentions;
	} else {
		return null;
	}
}
 
开发者ID:UCDenver-ccp,项目名称:ccp-nlp,代码行数:18,代码来源:UIMA_Util.java

示例2: asString

import org.apache.uima.jcas.cas.FSArray; //导入方法依赖的package包/类
/**
 * Convert an SFArray to a string.
 *
 * @param <S>
 *            the generic type
 * @param array
 *            the array
 * @param clazz
 *            the clazz
 * @param toString
 *            the to string
 * @param separator
 *            the separator
 * @return the string
 */
// NOTE This is checked by the filter
@SuppressWarnings("unchecked")
protected <S> String asString(FSArray array, Class<S> clazz, Function<S, String> toString, String separator) {
	if (array == null) {
		return "";
	}

	final FeatureStructure[] fses = array.toArray();

	if (fses == null) {
		return "";
	}

	return Arrays.stream(fses)
			.filter(Objects::nonNull)
			.filter(fs -> clazz.isAssignableFrom(fs.getClass()))
			.map(fs -> toString.apply((S) fs))
			.collect(Collectors.joining(separator));
}
 
开发者ID:dstl,项目名称:baleen,代码行数:35,代码来源:AbstractPrintConsumer.java

示例3: getCUIs

import org.apache.uima.jcas.cas.FSArray; //导入方法依赖的package包/类
/**
 * @param identifiedAnnotation
 *            -
 * @return list of all cuis
 */
static private Collection<String> getCUIs(
    final IdentifiedAnnotation identifiedAnnotation) {
  final FSArray fsArray = identifiedAnnotation.getOntologyConceptArr();
  if (fsArray == null) {
    return Collections.emptySet();
  }
  final FeatureStructure[] featureStructures = fsArray.toArray();
  final Collection<String> cuis = new ArrayList<>(
      featureStructures.length);
  for (FeatureStructure featureStructure : featureStructures) {
    if (featureStructure instanceof UmlsConcept) {
      final UmlsConcept umlsConcept = (UmlsConcept) featureStructure;
      final String cui = umlsConcept.getCui();
      final String tui = umlsConcept.getTui();
      if (tui != null && !tui.isEmpty()) {
        cuis.add(cui + "_" + tui);
      } else {
        cuis.add(cui);
      }
    }
  }
  return cuis;
}
 
开发者ID:giuseppetotaro,项目名称:ctakes-clinical-pipeline,代码行数:29,代码来源:CTAKESClinicalPipelineFactory.java


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