本文整理汇总了Java中org.apache.uima.cas.text.AnnotationFS.getIntValue方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationFS.getIntValue方法的具体用法?Java AnnotationFS.getIntValue怎么用?Java AnnotationFS.getIntValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.uima.cas.text.AnnotationFS
的用法示例。
在下文中一共展示了AnnotationFS.getIntValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotationToLabel
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
@Override
public WordIndex annotationToLabel(AnnotationFS annotationFS) {
StringIdentifier stringIdentifier = new StringIdentifier(
annotationFS.getIntValue(indexFeature)
);
return new WordIndex(annotationFS.getBegin(), annotationFS.getEnd(), stringIdentifier);
}
示例2: makeNote
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
@Override
public String makeNote(AnnotationFS uAnno) {
int latitude = uAnno.getIntValue(latFeat);
int longitude = uAnno.getIntValue(longFeat);
if (latitude == 0 || longitude == 0) {
return null;
}
return String.format("%s:%s", latitude, longitude);
}
示例3: getValue
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
protected Object getValue(AnnotationFS annotation) {
switch(feature.getRange().getName()) {
case UIMA_CAS_INTEGER:
return annotation.getIntValue(feature);
case UIMA_CAS_STRING:
return annotation.getStringValue(feature);
case UIMA_CAS_FLOAT:
return annotation.getFloatValue(feature);
case UIMA_CAS_BOOLEAN:
return annotation.getBooleanValue(feature);
default:
return annotation.getStringValue(feature);
}
}
示例4: fromView
import org.apache.uima.cas.text.AnnotationFS; //导入方法依赖的package包/类
/**
* Indexes all the symbols from an original document.
*
* @param originalDocumentView jCas original document view.
* @return The newly created symbol indexed document.
*/
public static SymbolIndexedDocument fromView(CAS originalDocumentView) {
Type viewIndexType = originalDocumentView.getTypeSystem()
.getType("edu.umn.biomedicus.rtfuima.type.ViewIndex");
Feature destinationNameFeature = viewIndexType
.getFeatureByBaseName("destinationName");
Feature destinationIndexFeature = viewIndexType
.getFeatureByBaseName("destinationIndex");
AnnotationIndex<AnnotationFS> viewIndexAI = originalDocumentView
.getAnnotationIndex(viewIndexType);
List<SymbolLocation> symbolLocations = new ArrayList<>();
Map<String, Map<Integer, Integer>> destinationMap = new HashMap<>();
int index = 0;
int lastEnd = 0;
for (AnnotationFS annotation : viewIndexAI) {
int begin = annotation.getBegin();
int end = annotation.getEnd();
String destinationName
= annotation.getStringValue(destinationNameFeature);
SymbolLocation symbolLocation = new SymbolLocation(
destinationName,
begin - lastEnd,
end - begin,
index++
);
symbolLocations.add(symbolLocation);
int destinationIndex
= annotation.getIntValue(destinationIndexFeature);
destinationMap.compute(destinationName,
(String key, @Nullable Map<Integer, Integer> value) -> {
if (value == null) {
value = new HashMap<>();
}
value.put(destinationIndex, symbolLocations.size() - 1);
return value;
});
lastEnd = end;
}
return new SymbolIndexedDocument(symbolLocations, destinationMap,
originalDocumentView.getDocumentText());
}