Package org.apache.uima.cas

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


            .getFeatureByBaseName("refFeature2");
      cas.getDocumentAnnotation().setFeatureValue(ref2Feat,
            cas.getDocumentAnnotation());
      path = "/refFeature2/refFeature2/stringFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(TypeClass.TYPE_CLASS_STRING, featurePath.getTypClass(cas
            .getDocumentAnnotation()));
      assertEquals(stringFeat.getRange(), featurePath.getType(cas
View Full Code Here


            .getDocumentAnnotation()));

      // test reference feature
      path = "/refFeature2/refFeature2";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(TypeClass.TYPE_CLASS_FS, featurePath.getTypClass(cas
            .getDocumentAnnotation()));
      assertEquals(cas.getDocumentAnnotation().getType(), featurePath
View Full Code Here

      assertEquals(cas.getDocumentAnnotation().getType(), featurePath
            .getType(cas.getDocumentAnnotation()));

      // test empty featurePath
      featurePath = new FeaturePathImpl();
      featurePath.initialize("");
      assertEquals("", featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(cas.getDocumentAnnotation().toString(), featurePath
            .getValueAsString(cas.getDocumentAnnotation()));
View Full Code Here

      assertEquals(cas.getDocumentAnnotation().toString(), featurePath
            .getValueAsString(cas.getDocumentAnnotation()));

      // test "/" featurePath
      featurePath = new FeaturePathImpl();
      featurePath.initialize("/");
      assertEquals("/", featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(cas.getDocumentAnnotation().toString(), featurePath
            .getValueAsString(cas.getDocumentAnnotation()));
View Full Code Here

      assertEquals(cas.getDocumentAnnotation().toString(), featurePath
            .getValueAsString(cas.getDocumentAnnotation()));

      // check init() with super type and call getValue() with subtype
      featurePath = new FeaturePathImpl();
      featurePath.initialize("/stringFeature");
      Type testAnnotType = cas.getTypeSystem()
            .getType("uima.tt.TestAnnotation");
      featurePath.typeInit(testAnnotType);

      Type testAnnotSubType = cas.getTypeSystem().getType(
View Full Code Here

            cas.getDocumentAnnotation());

      // test fsId()
      String path = "/refFeature:fsId()";
      FeaturePath featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("8", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

            .getDocumentAnnotation()));

      // test fsId()
      path = "/refFeature/refFeature/refFeature/refFeature:fsId()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("8", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

            .getDocumentAnnotation()));

      // test coveredText()
      path = "/refFeature:coveredText()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("Sample Text", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

            .getDocumentAnnotation()));

      // test coveredText()
      path = "/refFeature/refFeature/refFeature/refFeature/refFeature/refFeature:coveredText()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("Sample Text", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here

      Feature boolFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("booleanFeature");
      cas.getDocumentAnnotation().setBooleanValue(boolFeat, true);
      path = "/booleanFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Boolean.valueOf(true), featurePath.getBooleanValue(cas
            .getDocumentAnnotation()));
      assertEquals("true", featurePath.getValueAsString(cas
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.