本文整理了Java中org.apache.uima.cas.text.AnnotationFS.setBooleanValue()
方法的一些代码示例,展示了AnnotationFS.setBooleanValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnnotationFS.setBooleanValue()
方法的具体详情如下:
包路径:org.apache.uima.cas.text.AnnotationFS
类名称:AnnotationFS
方法名:setBooleanValue
暂无
代码示例来源:origin: org.apache.uima/ruta-core
private void setFeatureValue(AnnotationFS annotationFS, Feature feature, Object o) {
if (feature != null && o != null) {
Type range = feature.getRange();
String rangeName = range.getName();
if (rangeName.equals(CAS.TYPE_NAME_STRING) && o instanceof String) {
annotationFS.setStringValue(feature, (String) o);
} else if (rangeName.equals(CAS.TYPE_NAME_INTEGER) && o instanceof Number) {
annotationFS.setIntValue(feature, ((Number) o).intValue());
} else if (rangeName.equals(CAS.TYPE_NAME_DOUBLE) && o instanceof Number) {
annotationFS.setDoubleValue(feature, ((Number) o).doubleValue());
} else if (rangeName.equals(CAS.TYPE_NAME_FLOAT) && o instanceof Number) {
annotationFS.setFloatValue(feature, ((Number) o).floatValue());
} else if (rangeName.equals(CAS.TYPE_NAME_BYTE) && o instanceof Number) {
annotationFS.setByteValue(feature, ((Number) o).byteValue());
} else if (rangeName.equals(CAS.TYPE_NAME_SHORT) && o instanceof Number) {
annotationFS.setShortValue(feature, ((Number) o).shortValue());
} else if (rangeName.equals(CAS.TYPE_NAME_LONG) && o instanceof Number) {
annotationFS.setLongValue(feature, ((Number) o).longValue());
} else if (rangeName.equals(CAS.TYPE_NAME_BOOLEAN) && o instanceof Boolean) {
annotationFS.setBooleanValue(feature, (Boolean) o);
} else if (rangeName.equals(CAS.TYPE_NAME_STRING) & o instanceof Type) {
annotationFS.setStringValue(feature, ((Type) o).getName());
}
} else {
throw new IllegalArgumentException("Not able to assign feature value: " + o + " -> "
+ feature);
}
}
代码示例来源:origin: nlpie/biomedicus
@Override
public void controlWordEncountered(KeywordAction keywordAction) {
AnnotationFS annotation;
int currentTextIndex = sofaBuilder.length();
String controlWord = keywordAction.getControlWord();
Type type;
if (annotationTypeForControlWord.containsKey(controlWord)) {
type = annotationTypeForControlWord.get(controlWord);
} else {
return;
}
annotation = destinationView.createAnnotation(type, currentTextIndex,
currentTextIndex);
Feature paramFeature = type.getFeatureByBaseName("param");
if (keywordAction.hasParameter()) {
annotation.setIntValue(paramFeature, keywordAction.getParameter());
}
Feature indexFeature = type.getFeatureByBaseName("index");
annotation.setIntValue(indexFeature, keywordAction.getBegin());
Feature knownFeature = type.getFeatureByBaseName("known");
annotation.setBooleanValue(knownFeature, true);
destinationView.addFsToIndexes(annotation);
}
代码示例来源:origin: org.apache.uima/ruta-core
afs.setBooleanValue(feature,
((IBooleanExpression) argExpr).getBooleanValue(context, stream));
} else if (argExpr instanceof ITypeExpression) {
代码示例来源:origin: org.apache.uima/textmarker-core
annotationFS.setBooleanValue(featureByBaseName, v);
} else if (typeExpr != null) {
Type t = typeExpr.getType(element.getParent());
内容来源于网络,如有侵权,请联系作者删除!