本文整理汇总了Java中org.apache.uima.jcas.cas.EmptyFSList类的典型用法代码示例。如果您正苦于以下问题:Java EmptyFSList类的具体用法?Java EmptyFSList怎么用?Java EmptyFSList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmptyFSList类属于org.apache.uima.jcas.cas包,在下文中一共展示了EmptyFSList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLabelList
import org.apache.uima.jcas.cas.EmptyFSList; //导入依赖的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;
}
示例2: isEmpty
import org.apache.uima.jcas.cas.EmptyFSList; //导入依赖的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;
}
}
示例3: removeSEFeatureFromList
import org.apache.uima.jcas.cas.EmptyFSList; //导入依赖的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;
}
示例4: removeFeature
import org.apache.uima.jcas.cas.EmptyFSList; //导入依赖的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);
}