本文整理了Java中org.apache.uima.cas.ArrayFS.size()
方法的一些代码示例,展示了ArrayFS.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayFS.size()
方法的具体详情如下:
包路径:org.apache.uima.cas.ArrayFS
类名称:ArrayFS
方法名:size
[英]Return the size of the array.
[中]返回数组的大小。
代码示例来源:origin: org.apache.uima/uimafit-core
public static ArrayFS fillArrayFS(ArrayFS aArrayFs, FeatureStructure[] aArray) {
aArrayFs.copyFromArray(aArray, 0, 0, aArrayFs.size());
return aArrayFs;
}
代码示例来源:origin: CLLKazan/UIMA-Ext
public static boolean contain(ArrayFS arr, FeatureStructure targetFS) {
if (arr == null) {
return false;
}
for (int i = 0; i < arr.size(); i++) {
if (Objects.equal(arr.get(i), targetFS)) {
return true;
}
}
return false;
}
代码示例来源: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: org.apache.uima/uimafit-core
/**
* Fetch all annotations of the given type or its sub-types from the given FS array.
*
* @param aArray
* the FS array
* @param aType
* the CAS type.
* @return a new collection of all feature structures of the given type.
*/
public static Collection<FeatureStructure> create(ArrayFS aArray, Type aType) {
TypeSystem ts = aArray.getCAS().getTypeSystem();
List<FeatureStructure> data = new ArrayList<FeatureStructure>(aArray.size());
for (int i = 0; i < aArray.size(); i++) {
FeatureStructure value = aArray.get(i);
if (value != null && (aType == null || ts.subsumes(aType, value.getType()))) {
data.add(value);
}
}
return asList(data.toArray(new FeatureStructure[data.size()]));
}
代码示例来源:origin: webanno/webanno
public static void setLinkFeatureValue(FeatureStructure aFS, Feature aFeature,
List<FeatureStructure> linkFSes)
{
// Create a new array if size differs otherwise re-use existing one
ArrayFS array = (ArrayFS) WebAnnoCasUtil.getFeatureFS(aFS, aFeature.getShortName());
if (array == null || (array.size() != linkFSes.size())) {
array = aFS.getCAS().createArrayFS(linkFSes.size());
}
// Fill in links
array.copyFromArray(linkFSes.toArray(new FeatureStructure[linkFSes.size()]), 0, 0,
linkFSes.size());
aFS.setFeatureValue(aFeature, array);
}
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-annotation
public static void setLinkFeatureValue(FeatureStructure aFS, Feature aFeature,
List<FeatureStructure> linkFSes)
{
// Create a new array if size differs otherwise re-use existing one
ArrayFS array = (ArrayFS) WebAnnoCasUtil.getFeatureFS(aFS, aFeature.getShortName());
if (array == null || (array.size() != linkFSes.size())) {
array = aFS.getCAS().createArrayFS(linkFSes.size());
}
// Fill in links
array.copyFromArray(linkFSes.toArray(new FeatureStructure[linkFSes.size()]), 0, 0,
linkFSes.size());
aFS.setFeatureValue(aFeature, array);
}
代码示例来源:origin: edu.utah.bmi.nlp/nlp-core
for (int i = 0; i < arrayFS.size(); i++) {
代码示例来源:origin: org.apache.uima/uimaj-tools
for (int i = 0; i < arrayFS.size(); i++) {
代码示例来源:origin: apache/uima-uimaj
public String toString() {
Object v = getValue();
if (v instanceof StringArrayFS)
v = "StringArrayFS[" + ((StringArrayFS) v).size() + "]";
else if (v instanceof FloatArrayFS)
v = "FloatArrayFS[" + ((FloatArrayFS) v).size() + "]";
else if (v instanceof IntArrayFS)
v = "IntArrayFS[" + ((IntArrayFS) v).size() + "]";
else if (v instanceof ArrayFS)
v = "ArrayFS[" + ((ArrayFS) v).size() + "]";
return getName() + ": " + v;
}
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
/**
* Array size.
*
* @param value the value
* @return the int
*/
private int arraySize(FeatureStructure value) {
if (!value.getType().isArray()) {
throw new IllegalArgumentException();
}
int size;
if (value instanceof ArrayFS) {
ArrayFS array = (ArrayFS) value;
size = array.size();
} else if (value instanceof CommonArrayFS) {
CommonArrayFS array = (CommonArrayFS) value;
size = array.size();
} else if (value instanceof StringArrayFS) {
StringArrayFS array = (StringArrayFS) value;
size = array.size();
} else {
throw new CasEditorError("Unkown array type!");
}
return size;
}
代码示例来源:origin: org.apache.uima/textmarker-ep-caseditor
ArrayFS array = (ArrayFS) featureValue;
if (array != null) {
String text = "Array" + "[" + array.size() + "]";
FeatureTreeNode arrayNode = new FeatureTreeNode(this, f, text);
parent.addChild(arrayNode);
int size = array.size();
代码示例来源:origin: org.apache.uima/ruta-ep-caseditor
ArrayFS array = (ArrayFS) featureValue;
if (array != null) {
String text = "Array" + "[" + array.size() + "]";
PrimitiveFeatureTreeNode arrayNode = new PrimitiveFeatureTreeNode(this, f, text);
parent.addChild(arrayNode);
int size = array.size();
for (int i = 0; i < size; i++) {
FeatureStructure fs = array.get(i);
代码示例来源:origin: webanno/webanno
for (int i = 0; i < links.size(); i++) {
FeatureStructure link = links.get(i);
DiffAdapter adapter = getAdapter(aFS.getType().getName());
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.core/de.tudarmstadt.ukp.dkpro.core.stanfordnlp-gpl
int len = arrayFs.size();
ArrayFS destFS = mDestCas.createArrayFS(len);
for (int i = 0; i < len; i++) {
内容来源于网络,如有侵权,请联系作者删除!