本文整理了Java中org.apache.uima.jcas.tcas.Annotation.setStringValue()
方法的一些代码示例,展示了Annotation.setStringValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.setStringValue()
方法的具体详情如下:
包路径:org.apache.uima.jcas.tcas.Annotation
类名称:Annotation
方法名:setStringValue
暂无
代码示例来源:origin: fr.univ-nantes.julestar/uima-tree-tagger-wrapper
private void update(CAS cas, Annotation annotation, Feature feature, String value) {
annotation.setStringValue(feature,value);
}
代码示例来源:origin: org.apache.uima/uimafit-core
token.setStringValue(posFeature, posTags[tokenIndex]);
token.setStringValue(stemFeature, stems[tokenIndex]);
代码示例来源:origin: ch.epfl.bbp.nlp/bluima_mongodb
public static void readFieldFromDb(String fieldKey, String range,
Annotation a, Feature f, BasicDBObject dbO, JCas jCas) {
if (dbO.containsField(fieldKey)) {
if (range.equals("String")) {
a.setStringValue(f, dbO.getString(fieldKey));
} else if (range.equals("StringArray")) {
BasicDBList vals = (BasicDBList) dbO.get(fieldKey);
StringArray sa = new StringArray(jCas, vals.size());
for (int i = 0; i < vals.size(); i++) {
sa.set(i, vals.get(i).toString());
}
a.setFeatureValue(f, sa);
} else if (range.equals("Integer")) {
a.setIntValue(f, dbO.getInt(fieldKey));
} else if (range.equals("Float")) {
a.setFloatValue(f, (float) dbO.getDouble(fieldKey));
} else if (range.equals("Boolean")) {
a.setBooleanValue(f, dbO.getBoolean(fieldKey));
} else {
LOG.warn("range not supported " + range);
}
}
}
}
代码示例来源:origin: de.unistuttgart.ims/cleartk-util
String rangeName = f.getRange().getName();
if (rangeName.equals("uima.cas.String")) {
newAnnotation.setStringValue(f, a.getStringValue(f));
} else if (rangeName.equals("uima.cas.Integer")) {
newAnnotation.setIntValue(f, a.getIntValue(f));
代码示例来源:origin: fr.univ-nantes.julestar/uima-tokens-regex
while (it.hasNext()) {
Annotation word = (Annotation) it.next();
word.setStringValue(
feat,
this.resource.getMatchingLabelString(word));
内容来源于网络,如有侵权,请联系作者删除!