• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FSList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.uima.jcas.cas.FSList的典型用法代码示例。如果您正苦于以下问题:Java FSList类的具体用法?Java FSList怎么用?Java FSList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FSList类属于org.apache.uima.jcas.cas包,在下文中一共展示了FSList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addAnnotationToJCas

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
private void addAnnotationToJCas(de.unisaarland.swan.entities.Annotation annotation, Map<Long, SwanAnnotation> annotsById, JCas jCas) {
    SwanAnnotation dAnnot = new SwanAnnotation(jCas);
    dAnnot.setBegin(annotation.getStart());
    dAnnot.setEnd(annotation.getEnd());
    dAnnot.setAnnotatorId(annotation.getUser().getEmail());
    dAnnot.setSpanType(annotation.getSpanType().getName());
    dAnnot.setAnnotationId(annotation.getId().toString());
    annotsById.put(annotation.getId(), dAnnot);

    Set<Label> labels = convertLabelsToExportLabelSet(annotation.getLabels());
    FSList list = createLabelList(jCas, labels);

    dAnnot.setLabels(list);

    dAnnot.addToIndexes();
}
 
开发者ID:annefried,项目名称:swan,代码行数:17,代码来源:ExportUtil.java


示例2: createLabelList

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Returns a list containing uimaLabels for all labels in a given set
 *
 * @param jCas JCas
 * @param labels Set<Label> labels
 * @return list FSList
 */
private FSList createLabelList(JCas jCas, Set<Label> labels) {
    FSList list = new EmptyFSList(jCas);
    for (Label label : labels) {
        for (String labelName : label.getLabel()) {
            SwanLabel uimaLabel
                    = new SwanLabel(jCas);
            uimaLabel.setName(labelName);
            uimaLabel.setLabelSet(label.getlabelSetName());

            NonEmptyFSList extendedList = new NonEmptyFSList(jCas);
            extendedList.setHead(uimaLabel);
            extendedList.setTail(list);
            list = extendedList;
        }
    }

    return list;
}
 
开发者ID:annefried,项目名称:swan,代码行数:26,代码来源:ExportUtil.java


示例3: isEmpty

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Checks whether an FSList is empty or not.
 * 
 * @param sList
 * @return
 */
public static boolean isEmpty(FSList fsList) {
	if (fsList instanceof EmptyFSList) {
		return true;
	} else {
		return false;
	}
}
 
开发者ID:annefried,项目名称:sitent,代码行数:14,代码来源:SitEntUimaUtils.java


示例4: getList

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Returns the FSList as a normal list.
 * 
 * @param sList
 * @return
 */
public static List<Annotation> getList(FSList fsList) {
	List<Annotation> list = new LinkedList<Annotation>();
	while (fsList instanceof NonEmptyFSList) {
		Annotation head = (Annotation) ((NonEmptyFSList) fsList).getHead();
		list.add(head);
		fsList = ((NonEmptyFSList) fsList).getTail();
	}
	return list;
}
 
开发者ID:annefried,项目名称:sitent,代码行数:16,代码来源:SitEntUimaUtils.java


示例5: getTopList

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Returns the FSList as a normal list.
 * 
 * @param sList
 * @return
 */
public static List<TOP> getTopList(FSList fsList) {
	List<TOP> list = new LinkedList<TOP>();
	while (fsList instanceof NonEmptyFSList) {
		TOP head = (TOP) ((NonEmptyFSList) fsList).getHead();
		list.add(head);
		fsList = ((NonEmptyFSList) fsList).getTail();
	}
	return list;
}
 
开发者ID:annefried,项目名称:sitent,代码行数:16,代码来源:SitEntUimaUtils.java


示例6: removeSEFeatureFromList

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Removes the SEFeature with the given featName from the FSList.
 * 
 * @param fsList
 * @param featName
 * @param jcas
 * @return
 */
public static FSList removeSEFeatureFromList(FSList fsList, String featName, JCas jcas) {
	FSList retVal = new EmptyFSList(jcas);
	for (Annotation annot : getList(fsList)) {
		SEFeature feat = (SEFeature) annot;
		if (!feat.getName().equals(featName)) {
			retVal = addToFSList(retVal, feat, jcas);
		}
	}
	return retVal;
}
 
开发者ID:annefried,项目名称:sitent,代码行数:19,代码来源:SitEntUimaUtils.java


示例7: removeFeature

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Removes all features with the given prefix from the
 * ClassificationAnnotation object.
 * 
 * @param prefix
 * @param classAnnot
 * @param jCas
 */
public static void removeFeature(String prefix,
		ClassificationAnnotation classAnnot, JCas jCas) {
	FSList fsList = classAnnot.getFeatures();
	FSList retVal = new EmptyFSList(jCas);
	for (Annotation annot : SitEntUimaUtils.getList(fsList)) {
		SEFeature feat = (SEFeature) annot;
		if (!feat.getName().matches(prefix)) {
			retVal = SitEntUimaUtils.addToFSList(retVal, feat, jCas);
		}
	}
	classAnnot.setFeatures(retVal);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:21,代码来源:FeaturesUtil.java


示例8: addToFSList

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Helper method to add an item to a stupid FS list. UIMA's FSList seems to
 * be a classic linked-list implementation
 */
public static NonEmptyFSList addToFSList(JCas aJCas, FSList list, TOP item) {
	NonEmptyFSList result = new NonEmptyFSList(aJCas);
	result.setHead(item);
	result.setTail(list);
	return result;
}
 
开发者ID:brmson,项目名称:blanqa,代码行数:11,代码来源:JCasManipulator.java


示例9: loadConcepts

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/**
 * Convert UIMA data model
 * 
 * @param questionView
 * @return keyterms
 */
private static List<String> loadConcepts(JCas questionView, String type) {
	List<String> reversedResult = new ArrayList<String>();
	Iterator<?> it = questionView.getJFSIndexRepository().getAllIndexedFS(
			AbstractQuery.type);

	if (it.hasNext()) {
		AbstractQuery query = (AbstractQuery) it.next();
		FSList concepts = query.getConcepts();

		// According to a UIMA forum, there isn't any simpler way to iterate
		// FSList.
		while (concepts instanceof NonEmptyFSList) {
			QueryConcept head = (QueryConcept) ((NonEmptyFSList) concepts)
					.getHead();
			if (type.equals(head.getOperator().getName())) {
				reversedResult.add(head.getText());
			}
			concepts = ((NonEmptyFSList) concepts).getTail();
		}
	}
	List<String> result = new ArrayList<String>(reversedResult.size());
	for (int i = 0; i < reversedResult.size(); i++) {
		result.add(reversedResult.get(reversedResult.size() - (i + 1)));
	}
	return result;
}
 
开发者ID:brmson,项目名称:blanqa,代码行数:33,代码来源:KeytermJCasManipulator.java


示例10: getLabels

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for Labels - gets labels assigned to the link.
 * @generated
 * @return value of the feature 
 */
public FSList getLabels() {
  if (SwanLink_Type.featOkTst && ((SwanLink_Type)jcasType).casFeat_Labels == null)
    jcasType.jcas.throwFeatMissing("Labels", "de.unisaarland.swan.export.model.uima.SwanLink");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SwanLink_Type)jcasType).casFeatCode_Labels)));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanLink.java


示例11: setLabels

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** setter for Labels - sets labels assigned to the link. 
 * @generated
 * @param v value to set into the feature 
 */
public void setLabels(FSList v) {
  if (SwanLink_Type.featOkTst && ((SwanLink_Type)jcasType).casFeat_Labels == null)
    jcasType.jcas.throwFeatMissing("Labels", "de.unisaarland.swan.export.model.uima.SwanLink");
  jcasType.ll_cas.ll_setRefValue(addr, ((SwanLink_Type)jcasType).casFeatCode_Labels, jcasType.ll_cas.ll_getFSRef(v));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanLink.java


示例12: getLabels

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for Labels - gets Set of labels assigned to this annotation by the annotator.
 * @generated
 * @return value of the feature 
 */
public FSList getLabels() {
  if (SwanAnnotation_Type.featOkTst && ((SwanAnnotation_Type)jcasType).casFeat_Labels == null)
    jcasType.jcas.throwFeatMissing("Labels", "de.unisaarland.swan.export.model.uima.SwanAnnotation");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SwanAnnotation_Type)jcasType).casFeatCode_Labels)));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanAnnotation.java


示例13: setLabels

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** setter for Labels - sets Set of labels assigned to this annotation by the annotator. 
 * @generated
 * @param v value to set into the feature 
 */
public void setLabels(FSList v) {
  if (SwanAnnotation_Type.featOkTst && ((SwanAnnotation_Type)jcasType).casFeat_Labels == null)
    jcasType.jcas.throwFeatMissing("Labels", "de.unisaarland.swan.export.model.uima.SwanAnnotation");
  jcasType.ll_cas.ll_setRefValue(addr, ((SwanAnnotation_Type)jcasType).casFeatCode_Labels, jcasType.ll_cas.ll_getFSRef(v));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanAnnotation.java


示例14: getLinks

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for Links - gets Links starting at this SwanAnnotation.
 * @generated
 * @return value of the feature 
 */
public FSList getLinks() {
  if (SwanAnnotation_Type.featOkTst && ((SwanAnnotation_Type)jcasType).casFeat_Links == null)
    jcasType.jcas.throwFeatMissing("Links", "de.unisaarland.swan.export.model.uima.SwanAnnotation");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SwanAnnotation_Type)jcasType).casFeatCode_Links)));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanAnnotation.java


示例15: setLinks

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** setter for Links - sets Links starting at this SwanAnnotation. 
 * @generated
 * @param v value to set into the feature 
 */
public void setLinks(FSList v) {
  if (SwanAnnotation_Type.featOkTst && ((SwanAnnotation_Type)jcasType).casFeat_Links == null)
    jcasType.jcas.throwFeatMissing("Links", "de.unisaarland.swan.export.model.uima.SwanAnnotation");
  jcasType.ll_cas.ll_setRefValue(addr, ((SwanAnnotation_Type)jcasType).casFeatCode_Links, jcasType.ll_cas.ll_getFSRef(v));}
 
开发者ID:annefried,项目名称:swan,代码行数:9,代码来源:SwanAnnotation.java


示例16: getFeatures

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for features - gets 
 * @generated
 * @return value of the feature 
 */
public FSList getFeatures() {
  if (ClassificationAnnotation_Type.featOkTst && ((ClassificationAnnotation_Type)jcasType).casFeat_features == null)
    jcasType.jcas.throwFeatMissing("features", "sitent.types.ClassificationAnnotation");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((ClassificationAnnotation_Type)jcasType).casFeatCode_features)));}
 
开发者ID:annefried,项目名称:sitent,代码行数:9,代码来源:ClassificationAnnotation.java


示例17: setFeatures

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** setter for features - sets  
 * @generated
 * @param v value to set into the feature 
 */
public void setFeatures(FSList v) {
  if (ClassificationAnnotation_Type.featOkTst && ((ClassificationAnnotation_Type)jcasType).casFeat_features == null)
    jcasType.jcas.throwFeatMissing("features", "sitent.types.ClassificationAnnotation");
  jcasType.ll_cas.ll_setRefValue(addr, ((ClassificationAnnotation_Type)jcasType).casFeatCode_features, jcasType.ll_cas.ll_getFSRef(v));}
 
开发者ID:annefried,项目名称:sitent,代码行数:9,代码来源:ClassificationAnnotation.java


示例18: getSituationAnnotations

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for situationAnnotations - gets List of situation annotations linked to this segment.
 * @generated
 * @return value of the feature 
 */
public FSList getSituationAnnotations() {
  if (Segment_Type.featOkTst && ((Segment_Type)jcasType).casFeat_situationAnnotations == null)
    jcasType.jcas.throwFeatMissing("situationAnnotations", "sitent.types.Segment");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Segment_Type)jcasType).casFeatCode_situationAnnotations)));}
 
开发者ID:annefried,项目名称:sitent,代码行数:9,代码来源:Segment.java


示例19: setSituationAnnotations

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** setter for situationAnnotations - sets List of situation annotations linked to this segment. 
 * @generated
 * @param v value to set into the feature 
 */
public void setSituationAnnotations(FSList v) {
  if (Segment_Type.featOkTst && ((Segment_Type)jcasType).casFeat_situationAnnotations == null)
    jcasType.jcas.throwFeatMissing("situationAnnotations", "sitent.types.Segment");
  jcasType.ll_cas.ll_setRefValue(addr, ((Segment_Type)jcasType).casFeatCode_situationAnnotations, jcasType.ll_cas.ll_getFSRef(v));}
 
开发者ID:annefried,项目名称:sitent,代码行数:9,代码来源:Segment.java


示例20: getTokens

import org.apache.uima.jcas.cas.FSList; //导入依赖的package包/类
/** getter for tokens - gets The list of tokens for this "segment", for the situation entity segmentation method based on dependency parses.
 * @generated
 * @return value of the feature 
 */
public FSList getTokens() {
  if (Segment_Type.featOkTst && ((Segment_Type)jcasType).casFeat_tokens == null)
    jcasType.jcas.throwFeatMissing("tokens", "sitent.types.Segment");
  return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Segment_Type)jcasType).casFeatCode_tokens)));}
 
开发者ID:annefried,项目名称:sitent,代码行数:9,代码来源:Segment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NativeErrorCode类代码示例发布时间:2022-05-23
下一篇:
Java BasicDynaBean类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap