Package org.apache.uima.cas_data.impl

Examples of org.apache.uima.cas_data.impl.FeatureStructureImpl


          featureStructureType = StringUtils.replaceAll(featureStructureType,
                  org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM,
                  org.apache.uima.collection.impl.cpm.Constants.LONG_DASH_TERM);
        }

        FeatureStructure vfs = new FeatureStructureImpl();
        vfs.setType(featureStructureType);

        FrameLeaf leafFrame = kvp.getValueAsLeaf();

        PrimitiveValue pv = new PrimitiveValueImpl(leafFrame.toString());
        vfs.setFeatureValue(featureStructureType, pv);
        dataCas.addFeatureStructure(vfs);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw e;
View Full Code Here


            UIMAFramework.getLogger(this.getClass()).log(Level.INFO, " dumping CasData-\n");
            dumpFeatures(aCasList[instanceCount]);
          }

          if (dataFrame != null) {
            FeatureStructure vfs = new FeatureStructureImpl();
            vfs.setType(org.apache.uima.collection.impl.cpm.Constants.STAT_FEATURE);

            String frame2CasTime = dataFrame.fgetString(Constants.FRAME_TO_CAS_TIME);
            if (frame2CasTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(frame2CasTime);
              vfs.setFeatureValue(Constants.FRAME_TO_CAS_TIME, pv);
            }
            String annotationTime = dataFrame.fgetString(Constants.ANNOTATION_TIME);
            if (annotationTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(annotationTime);
              vfs.setFeatureValue(Constants.ANNOTATION_TIME, pv);
            }
            String cas2FrameTime = dataFrame.fgetString(Constants.CAS_TO_FRAME_TIME);
            if (cas2FrameTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(cas2FrameTime);
              vfs.setFeatureValue(Constants.CAS_TO_FRAME_TIME, pv);
            }
            aCasList[instanceCount].addFeatureStructure(vfs);
          }
          instanceCount++;
        } catch (Exception e) {
View Full Code Here

   * @param featureName
   * @param featureValue
   */
  public static void addFeatureStructure(CasData dataCas, String featureType, String featureName,
          String featureValue) {
    FeatureStructure vfs = new FeatureStructureImpl();
    vfs.setType(featureType);
    PrimitiveValue pv = new VinciPrimitiveValue(featureValue);
    vfs.setFeatureValue(featureName, pv);
    dataCas.addFeatureStructure(vfs);
  }
View Full Code Here

    String featureValue = null;
    while (it.hasNext()) {
      Object object = it.next();

      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

          featureStructureType = StringUtils.replaceAll(featureStructureType,
                  org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM,
                  org.apache.uima.collection.impl.cpm.Constants.LONG_DASH_TERM);
        }

        FeatureStructure vfs = new FeatureStructureImpl();
        vfs.setType(featureStructureType);

        FrameLeaf leafFrame = kvp.getValueAsLeaf();

        PrimitiveValue pv = new PrimitiveValueImpl(leafFrame.toString());
        vfs.setFeatureValue(featureStructureType, pv);
        dataCas.addFeatureStructure(vfs);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw e;
View Full Code Here

            UIMAFramework.getLogger(this.getClass()).log(Level.INFO, " dumping CasData-\n");
            dumpFeatures(aCasList[instanceCount]);
          }

          if (dataFrame != null) {
            FeatureStructure vfs = new FeatureStructureImpl();
            vfs.setType(org.apache.uima.collection.impl.cpm.Constants.STAT_FEATURE);

            String frame2CasTime = dataFrame.fgetString(Constants.FRAME_TO_CAS_TIME);
            if (frame2CasTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(frame2CasTime);
              vfs.setFeatureValue(Constants.FRAME_TO_CAS_TIME, pv);
            }
            String annotationTime = dataFrame.fgetString(Constants.ANNOTATION_TIME);
            if (annotationTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(annotationTime);
              vfs.setFeatureValue(Constants.ANNOTATION_TIME, pv);
            }
            String cas2FrameTime = dataFrame.fgetString(Constants.CAS_TO_FRAME_TIME);
            if (cas2FrameTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(cas2FrameTime);
              vfs.setFeatureValue(Constants.CAS_TO_FRAME_TIME, pv);
            }
            aCasList[instanceCount].addFeatureStructure(vfs);
          }
          instanceCount++;
        } catch (Exception e) {
View Full Code Here

   * @param featureName
   * @param featureValue
   */
  public static void addFeatureStructure(CasData dataCas, String featureType, String featureName,
          String featureValue) {
    FeatureStructure vfs = new FeatureStructureImpl();
    vfs.setType(featureType);
    PrimitiveValue pv = new VinciPrimitiveValue(featureValue);
    vfs.setFeatureValue(featureName, pv);
    dataCas.addFeatureStructure(vfs);
  }
View Full Code Here

    String featureValue = null;
    while (it.hasNext()) {
      Object object = it.next();

      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

          featureStructureType = StringUtils.replaceAll(featureStructureType,
                  org.apache.uima.collection.impl.cpm.Constants.SHORT_DASH_TERM,
                  org.apache.uima.collection.impl.cpm.Constants.LONG_DASH_TERM);
        }

        FeatureStructure vfs = new FeatureStructureImpl();
        vfs.setType(featureStructureType);

        FrameLeaf leafFrame = kvp.getValueAsLeaf();

        PrimitiveValue pv = new PrimitiveValueImpl(leafFrame.toString());
        vfs.setFeatureValue(featureStructureType, pv);
        dataCas.addFeatureStructure(vfs);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw e;
View Full Code Here

            UIMAFramework.getLogger(this.getClass()).log(Level.INFO, " dumping CasData-\n");
            dumpFeatures(aCasList[instanceCount]);
          }

          if (dataFrame != null) {
            FeatureStructure vfs = new FeatureStructureImpl();
            vfs.setType(org.apache.uima.collection.impl.cpm.Constants.STAT_FEATURE);

            String frame2CasTime = dataFrame.fgetString(Constants.FRAME_TO_CAS_TIME);
            if (frame2CasTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(frame2CasTime);
              vfs.setFeatureValue(Constants.FRAME_TO_CAS_TIME, pv);
            }
            String annotationTime = dataFrame.fgetString(Constants.ANNOTATION_TIME);
            if (annotationTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(annotationTime);
              vfs.setFeatureValue(Constants.ANNOTATION_TIME, pv);
            }
            String cas2FrameTime = dataFrame.fgetString(Constants.CAS_TO_FRAME_TIME);
            if (cas2FrameTime != null) {
              PrimitiveValue pv = new PrimitiveValueImpl(cas2FrameTime);
              vfs.setFeatureValue(Constants.CAS_TO_FRAME_TIME, pv);
            }
            aCasList[instanceCount].addFeatureStructure(vfs);
          }
          instanceCount++;
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.uima.cas_data.impl.FeatureStructureImpl

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.