org.apache.uima.jcas.tcas.Annotation.setStringValue()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.apache.uima.jcas.tcas.Annotation.setStringValue()方法的一些代码示例,展示了Annotation.setStringValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.setStringValue()方法的具体详情如下:
包路径:org.apache.uima.jcas.tcas.Annotation
类名称:Annotation
方法名:setStringValue

Annotation.setStringValue介绍

暂无

代码示例

代码示例来源:origin: fr.univ-nantes.julestar/uima-tree-tagger-wrapper

private void update(CAS cas, Annotation annotation, Feature feature, String value) {
  annotation.setStringValue(feature,value);
}

代码示例来源:origin: org.apache.uima/uimafit-core

token.setStringValue(posFeature, posTags[tokenIndex]);
token.setStringValue(stemFeature, stems[tokenIndex]);

代码示例来源:origin: ch.epfl.bbp.nlp/bluima_mongodb

public static void readFieldFromDb(String fieldKey, String range,
      Annotation a, Feature f, BasicDBObject dbO, JCas jCas) {

    if (dbO.containsField(fieldKey)) {

      if (range.equals("String")) {
        a.setStringValue(f, dbO.getString(fieldKey));
      } else if (range.equals("StringArray")) {
        BasicDBList vals = (BasicDBList) dbO.get(fieldKey);
        StringArray sa = new StringArray(jCas, vals.size());
        for (int i = 0; i < vals.size(); i++) {
          sa.set(i, vals.get(i).toString());
        }
        a.setFeatureValue(f, sa);
      } else if (range.equals("Integer")) {
        a.setIntValue(f, dbO.getInt(fieldKey));
      } else if (range.equals("Float")) {
        a.setFloatValue(f, (float) dbO.getDouble(fieldKey));
      } else if (range.equals("Boolean")) {
        a.setBooleanValue(f, dbO.getBoolean(fieldKey));
      } else {
        LOG.warn("range not supported " + range);
      }
    }
  }
}

代码示例来源:origin: de.unistuttgart.ims/cleartk-util

String rangeName = f.getRange().getName();
if (rangeName.equals("uima.cas.String")) {
  newAnnotation.setStringValue(f, a.getStringValue(f));
} else if (rangeName.equals("uima.cas.Integer")) {
  newAnnotation.setIntValue(f, a.getIntValue(f));

代码示例来源:origin: fr.univ-nantes.julestar/uima-tokens-regex

while (it.hasNext()) {
  Annotation word = (Annotation) it.next();
  word.setStringValue(
      feat, 
      this.resource.getMatchingLabelString(word));

相关文章