本文整理了Java中org.apache.uima.jcas.tcas.Annotation.getFeatureValueAsString()
方法的一些代码示例,展示了Annotation.getFeatureValueAsString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.getFeatureValueAsString()
方法的具体详情如下:
包路径:org.apache.uima.jcas.tcas.Annotation
类名称:Annotation
方法名:getFeatureValueAsString
暂无
代码示例来源:origin: ClearTK/cleartk
protected String getOutcomeSuffix(CHUNK_TYPE chunk, Feature feature) {
return feature == null ? "" : "-" + chunk.getFeatureValueAsString(feature);
}
代码示例来源:origin: ClearTK/cleartk
public static void removeInconsistentAttributes(Element element, Annotation annotation, JCas jCas) {
for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) {
String newValue = element.getAttributeValue(names.timemlName);
String className = annotation.getClass().getName();
String uimaName = String.format("%s:%s", className, names.uimaName);
Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName);
String oldValue = annotation.getFeatureValueAsString(feature);
if (oldValue != null && !oldValue.equals(newValue)) {
annotation.setFeatureValueFromString(feature, null);
}
}
}
代码示例来源:origin: org.cleartk/cleartk-corpus
public static void removeInconsistentAttributes(Element element, Annotation annotation, JCas jCas) {
for (NamePair names : timemlAttributeLists.get(element.getName().toUpperCase())) {
String newValue = element.getAttributeValue(names.timemlName);
String className = annotation.getClass().getName();
String uimaName = String.format("%s:%s", className, names.uimaName);
Feature feature = jCas.getTypeSystem().getFeatureByFullName(uimaName);
String oldValue = annotation.getFeatureValueAsString(feature);
if (oldValue != null && !oldValue.equals(newValue)) {
annotation.setFeatureValueFromString(feature, null);
}
}
}
代码示例来源:origin: de.unistuttgart.ims/uimautil
public String getMarkdownString(JCas jcas) {
Feature feat = jcas.getTypeSystem().getType(type).getFeatureByBaseName(featureName);
SortedSet<Insertion> insertions = new TreeSet<Insertion>();
for (Annotation a : JCasUtil.select(jcas, clazz)) {
insertions.add(new Insertion(beginMark, a.getBegin()));
insertions.add(new Insertion(endMark + "~" + a.getFeatureValueAsString(feat) + "~", a.getEnd()));
}
StringBuilder exportString = new StringBuilder(jcas.getDocumentText());
for (Insertion ins : insertions) {
exportString.insert(ins.position, ins.content);
}
if (doubleNewline)
return exportString.toString().replaceAll("\n", "\n\n");
else
return exportString.toString().replaceAll("\n", " \n");
}
代码示例来源:origin: edu.utah.bmi.nlp/nlp-core
if (currentValue == null)
continue;
String mergedValue = mergedAnno.getFeatureValueAsString(feature);
if (!featureValuesPriorities.containsKey(feature)) {
logger.info("featureValuesPriorities doesn't have feature: " + feature);
代码示例来源:origin: de.unistuttgart.ims/uimautil
if (feature.getDomain().equals(type)) {
if (feature.getRange().getName().equals("uima.cas.String")) {
if (anno == null || anno.getFeatureValueAsString(feature) == null) {
p.print(null);
} else
p.print(anno.getFeatureValueAsString(feature));
} else if (feature.getRange().getName().equals("uima.cas.Integer")) {
p.print(anno.getIntValue(feature));
内容来源于网络,如有侵权,请联系作者删除!