Package org.apache.uima.cas_data

Examples of org.apache.uima.cas_data.FeatureValue


    Iterator it = aCAS.getFeatureStructures();
    while (it.hasNext()) {
      Object object = it.next();
      if (object instanceof FeatureStructure) {
        FeatureStructure fs = (FeatureStructure) object;
        FeatureValue fValue = fs.getFeatureValue(featureName);
        if (fValue != null) {
          return true;
        }
      }
    }
View Full Code Here


                  new Object[] { Thread.currentThread().getName(), fs.getType() });

        }
        String[] names = fs.getFeatureNames();
        for (int i = 0; names != null && i < names.length; i++) {
          FeatureValue fValue = fs.getFeatureValue(names[i]);
          if (fValue != null) {
            if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
              UIMAFramework.getLogger(DATACasUtils.class)
                      .logrb(
                              Level.FINEST,
                              DATACasUtils.class.getName(),
                              "process",
                              CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                              "UIMA_CPM_show_cas_fs_value__FINEST",
                              new Object[] { Thread.currentThread().getName(), names[i],
                                  fValue.toString() });
            }
          }
        }
      }
    }
View Full Code Here

            }

          }

          if ("uima.cpm.DocumentText".equals(featureName) || "UTF8:UTF8Content".equals(featureName)) {
            FeatureValue fValue = fs.getFeatureValue("value");
            if (fValue == null) {
              return null;
            }
            return fValue.toString();
          } else if ("Detag:DetagContent".equals(featureName)) {
            FeatureValue fValue = fs.getFeatureValue("Doc:SpannedText");
            if (fValue == null) {
              return null;
            }
            return fValue.toString();

          }
          FeatureValue fValue = fs.getFeatureValue(featureName);
          if (fValue != null) {
            featureValue = fValue.toString();
            break;
          }
        }
      }
    }
View Full Code Here

        FeatureStructure fs = (FeatureStructure) object;
        if (featureStructureName.equals(fs.getType())) {
          String[] names = fs.getFeatureNames();
          for (int i = 0; names != null && i < names.length; i++) {
            if (names[i].equals(featureName)) {
              FeatureValue fValue = fs.getFeatureValue(featureName);
              if (fValue != null) {
                featureValue = fValue.toString();
                v.add(featureValue);
              }
            }
          }
View Full Code Here

      if (object instanceof FeatureStructureImpl) {
        FeatureStructureImpl fs = (FeatureStructureImpl) object;

        if (fs.getType().equals(aFeatureStructure)) {
          FeatureValue fValue = fs.getFeatureValue(featureName);
          if (fValue != null) {
            featureValue = fValue.toString();
            break;
          }
        }
      }
    }
View Full Code Here

          fs.setType(cf.getNewFeatureName());
          if (cf.attributeListSize() > 0) {
            String[] featureNameList = fs.getFeatureNames();
            for (int i = 0; featureNameList != null && i < featureNameList.length; i++) {
              if (cf.getOldAttributeValue(featureNameList[i]) != null) {
                FeatureValue fv = fs.getFeatureValue(featureNameList[i]);
                // fs.removeFeature(featureNameList[i]);
                fs.setFeatureValue(cf.getNewAttributeValue(featureNameList[i]), fv);
              }
            }
          }
View Full Code Here

    }
    Iterator it = aCAS.getFeatureStructures();
    String featureValue = null;
    while (it.hasNext()) {
      FeatureStructure fs = (FeatureStructure) it.next();
      FeatureValue fValue = fs.getFeatureValue(featureName);
      if (fValue != null) {
        featureValue = fValue.toString();
        break;
      }
    }
    return featureValue;
  }
View Full Code Here

      Type type = typeSystem.getType(typeName);
      Assert.assertNotNull(type);
      if (typeSystem.subsumes(annotType, type)) {
        // annotation type - check for presence of begin/end
        FeatureValue beginVal = fs.getFeatureValue("begin");
        Assert.assertTrue(beginVal instanceof PrimitiveValue);
        Assert.assertTrue(((PrimitiveValue) beginVal).toInt() >= 0);
        FeatureValue endVal = fs.getFeatureValue("end");
        Assert.assertTrue(endVal instanceof PrimitiveValue);
        Assert.assertTrue(((PrimitiveValue) endVal).toInt() >= 0);

        // all annotations should be indexed (not a general requirement, but good
        // for these test CASes)
View Full Code Here

    Iterator<FeatureStructure> it = aCAS.getFeatureStructures();
    while (it.hasNext()) {
      Object object = it.next();
      if (object instanceof FeatureStructure) {
        FeatureStructure fs = (FeatureStructure) object;
        FeatureValue fValue = fs.getFeatureValue(featureName);
        if (fValue != null) {
          return true;
        }
      }
    }
View Full Code Here

        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(), "dumpFeatures",
                LOG_RESOURCE_BUNDLE, "UIMA_cas_feature_structure_type__FINE", fs.getType());

        String[] names = fs.getFeatureNames();
        for (int i = 0; names != null && i < names.length; i++) {
          FeatureValue fValue = fs.getFeatureValue(names[i]);
          if (fValue != null) {
            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
                    "dumpFeatures", LOG_RESOURCE_BUNDLE, "UIMA_cas_feature_name__FINE",
                    new Object[] { names[i], fValue.toString() });
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.cas_data.FeatureValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.