本文整理了Java中org.apache.uima.cas.ArrayFS.set()
方法的一些代码示例,展示了ArrayFS.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayFS.set()
方法的具体详情如下:
包路径:org.apache.uima.cas.ArrayFS
类名称:ArrayFS
方法名:set
[英]Set the i-th value.
[中]设置第i个值。
代码示例来源:origin: org.apache.uima/uimafit-core
public static <T extends ArrayFS> T fillArrayFS(T aArrayFs,
Iterable<? extends FeatureStructure> aCollection) {
int i = 0;
for (FeatureStructure fs : aCollection) {
aArrayFs.set(i, fs);
i++;
}
return aArrayFs;
}
代码示例来源:origin: nlpie/biomedicus
/**
* Copies one array of fs references to another.
*
* @param from the array to copy from
* @param to the array to copy to
*/
private void copyFsArray(FeatureStructure from, FeatureStructure to) {
ArrayFS sourceFses = (ArrayFS) from;
ArrayFS targetFses = (ArrayFS) to;
for (int index = 0; index < sourceFses.size(); index++) {
FeatureStructure arrayMember = sourceFses.get(index);
FeatureStructure toFs = featureStructureEncounteredCallback.apply(arrayMember);
targetFses.set(index, toFs);
}
}
代码示例来源:origin: CLLKazan/UIMA-Ext
public static FeatureStructure toCompatibleCollection(CAS cas, Feature targetFeat,
Collection<? extends FeatureStructure> srcCol) {
if (srcCol == null) {
return null;
}
// TODO handle lists
if (targetFeat.getRange().isArray()) {
ArrayFS result = cas.createArrayFS(srcCol.size());
int i = 0;
for (FeatureStructure elemFS : srcCol) {
result.set(i, elemFS);
i++;
}
return result;
} else {
throw new UnsupportedOperationException();
}
}
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
@Override
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
Object element = selection.getFirstElement();
if (element instanceof FeatureValue) {
FeatureValue featureValue = (FeatureValue) element;
if (!featureValue.getFeature().getRange().isPrimitive()) {
featureValue.getFeatureStructure().setFeatureValue(featureValue.getFeature(), null);
document.update(featureValue.getFeatureStructure());
}
} else if (element instanceof ArrayValue) {
ArrayValue arrayValue = (ArrayValue) element;
ArrayFS array = (ArrayFS) arrayValue.getFeatureStructure();
array.set(arrayValue.slot(), null);
document.update(array);
}
}
代码示例来源:origin: webanno/webanno
FSUtil.setFeature(linkFS, feat1.getLinkTypeRoleFeatureName(), "role");
FSUtil.setFeature(linkFS, feat1.getLinkTypeTargetFeatureName(), targetFS);
array.set(0, linkFS);
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
array.set(value.slot(), (FeatureStructure) event.data);
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
array.set(value.slot(), fs);
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.stanfordnlp-gpl
if (srcElem != null) {
FeatureStructure copyElem = copyFs(arrayFs.get(i));
destFS.set(i, copyElem);
内容来源于网络,如有侵权,请联系作者删除!