Package org.apache.uima.cas

Examples of org.apache.uima.cas.FeaturePath.initialize()


      assertTrue(featurePath.size() == 2);
      assertTrue(featurePath.getFeature(1) == stringFeat);

      // test path always valid after addFeature()
      featurePath = new FeaturePathImpl();
      featurePath.initialize("/refFeature2");
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      featurePath.addFeature(stringFeat);

      // test path possible valid after addFeature()
      featurePath = new FeaturePathImpl();
View Full Code Here


      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      featurePath.addFeature(stringFeat);

      // test path possible valid after addFeature()
      featurePath = new FeaturePathImpl();
      featurePath.initialize("/refFeature2");
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      featurePath.addFeature(refFeat);
      featurePath.addFeature(stringFeat);

   }
View Full Code Here

      cas.getDocumentAnnotation().setStringValue(stringFeat, "MyExample");
      cas.getDocumentAnnotation().setFeatureValue(refFeat,
            cas.getDocumentAnnotation());

      FeaturePath featurePath = new FeaturePathImpl();
      featurePath.initialize("/refFeature2");
      featurePath.addFeature(stringFeat);

      assertEquals("MyExample", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
      assertEquals("/refFeature2/stringFeature", featurePath.getFeaturePath());
View Full Code Here

      stringArrayFS.set(2, "Test2");
      cas.getDocumentAnnotation().setFeatureValue(stringArrayFeat,
            stringArrayFS);
      String path = "/stringArray";
      FeaturePath featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(stringArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("Test0,Test1,Test2,null", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      shortArrayFS.set(1, (short) 2);
      shortArrayFS.set(2, (short) 54);
      cas.getDocumentAnnotation().setFeatureValue(shortArrayFeat, shortArrayFS);
      path = "/shortArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(shortArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("0,2,54", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      floatArrayFS.set(1, 0f);
      floatArrayFS.set(2, 3434.34f);
      cas.getDocumentAnnotation().setFeatureValue(floatArrayFeat, floatArrayFS);
      path = "/floatArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(floatArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("1.4,0.0,3434.34", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      doubleArrayFS.set(2, 3434.34);
      cas.getDocumentAnnotation().setFeatureValue(doubleArrayFeat,
            doubleArrayFS);
      path = "/doubleArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(doubleArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("1.4,0.0,3434.34", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      longArrayFS.set(1, 0);
      longArrayFS.set(2, 343434);
      cas.getDocumentAnnotation().setFeatureValue(longArrayFeat, longArrayFS);
      path = "/longArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(longArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("14,0,343434", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      intArrayFS.set(1, 0);
      intArrayFS.set(2, 343);
      cas.getDocumentAnnotation().setFeatureValue(intArrayFeat, intArrayFS);
      path = "/intArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(intArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("14,0,343", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      booleanArrayFS.set(2, true);
      cas.getDocumentAnnotation().setFeatureValue(booleanArrayFeat,
            booleanArrayFS);
      path = "/booleanArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(booleanArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("true,false,true", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.