本文整理汇总了Java中org.apache.uima.cas.text.AnnotationFS.setBooleanValue方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationFS.setBooleanValue方法的具体用法?Java AnnotationFS.setBooleanValue怎么用?Java AnnotationFS.setBooleanValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.uima.cas.text.AnnotationFS
的用法示例。
在下文中一共展示了AnnotationFS.setBooleanValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: controlWordEncountered
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
@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);
}
示例2: mapAttributes
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
private void mapAttributes(Map<String, Feature> attr2FeatMap,
HasAttributes attrHolder, AnnotationFS uAnno) {
for (String attrName : attr2FeatMap.keySet()) {
Feature uFeat = attr2FeatMap.get(attrName);
Object attrValue = attrHolder.getAttributesMap().get(attrName);
if (attrValue == null) {
continue;
} else if (attrValue instanceof Boolean) {
uAnno.setBooleanValue(uFeat, (Boolean) attrValue);
} else if (attrValue instanceof String) {
uAnno.setStringValue(uFeat, (String) attrValue);
} else {
throw new IllegalStateException();
}
}
}
示例3: fillAnnotation
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
@Override
protected void fillAnnotation(T token, AnnotationFS annotationFS) {
annotationFS.setStringValue(textFeature, token.getText());
annotationFS.setBooleanValue(hasSpaceAfterFeature, token.getHasSpaceAfter());
}