当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationFS.getIntValue方法代码示例

本文整理汇总了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);
}
 
开发者ID:nlpie,项目名称:biomedicus,代码行数:8,代码来源:BiomedicusTsLabelsPlugin.java

示例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);
}
 
开发者ID:textocat,项目名称:textokit-core,代码行数:10,代码来源:CityNoteMapper.java

示例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);
	}
}
 
开发者ID:nantesnlp,项目名称:uima-tokens-regex,代码行数:15,代码来源:FeatureMatcher.java

示例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());
}
 
开发者ID:nlpie,项目名称:biomedicus,代码行数:58,代码来源:SymbolIndexedDocument.java


注:本文中的org.apache.uima.cas.text.AnnotationFS.getIntValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。