Examples of typeInit()


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

      // test typeName()
      path = "/refFeature:typeName()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("uima.tcas.DocumentAnnotation", featurePath
            .getValueAsString(cas.getDocumentAnnotation()));

      // test typeName()
      path = "/refFeature/refFeature/refFeature/refFeature/refFeature/refFeature/refFeature:typeName()";
View Full Code Here

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

      // test typeName()
      path = "/refFeature/refFeature/refFeature/refFeature/refFeature/refFeature/refFeature:typeName()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("uima.tcas.DocumentAnnotation", featurePath
            .getValueAsString(cas.getDocumentAnnotation()));

      // test typeName() on root
      path = ":typeName()";
View Full Code Here

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

      // test typeName() on root
      path = ":typeName()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("uima.tcas.DocumentAnnotation", featurePath
            .getValueAsString(cas.getDocumentAnnotation()));

      // test coveredText() on root
      path = "/:coveredText()";
View Full Code Here

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

      // test coveredText() on root
      path = "/:coveredText()";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(cas.getDocumentText(), featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
      assertEquals(cas.getDocumentText(), featurePath.ll_getValueAsString(cas.getLowLevelCAS().ll_getFSRef(
            cas.getDocumentAnnotation()), cas.getLowLevelCAS()));
      assertEquals(cas.getDocumentAnnotation().getType(), featurePath.getType(cas.getDocumentAnnotation()));
View Full Code Here

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

      // test fsId() on root
      path = "/: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

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

      // test featurePath function not supported
      featurePath = new FeaturePathImpl();
      try {
         featurePath.initialize("/stringFeature:coveredText()");
         featurePath.typeInit(cas.getDocumentAnnotation().getType());
         featurePath.getValueAsString(cas.getDocumentAnnotation());
      } catch (CASRuntimeException ex) {
         assertTrue(ex.getMessage().indexOf("uima.cas.String") > -1);
      }
View Full Code Here

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

      // test featurePath function not supported
      featurePath = new FeaturePathImpl();
      try {
         featurePath.initialize("/byteFeature:coveredText()");
         featurePath.typeInit(cas.getDocumentAnnotation().getType());
         featurePath.getValueAsString(cas.getDocumentAnnotation());
      } catch (CASRuntimeException ex) {
         assertTrue(ex.getMessage().indexOf("uima.cas.Byte") > -1);
      }
View Full Code Here

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

      // test array featurePath
      featurePath = new FeaturePathImpl();
      try {
         featurePath.initialize("/refFeature/fsArray/refFeature");
         featurePath.typeInit(cas.getDocumentAnnotation().getType());
         featurePath.getValueAsString(cas.getDocumentAnnotation());
      } catch (CASException ex) {
         assertTrue(ex.getMessage().indexOf("uima.tcas.DocumentAnnotation") > -1);
      }
View Full Code Here

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

      // and the case that type used for typeInit() has and featurePath that is
      // not always valid
      featurePath = new FeaturePathImpl();
      try {
         featurePath.initialize("/refFeature/stringFeature");
         featurePath.typeInit(cas.getDocumentAnnotation().getType());

         Type testAnnotType = cas.getTypeSystem().getType(
               "uima.tt.TestAnnotation");
         AnnotationFS fs = cas.createAnnotation(testAnnotType, 0, 1);
         cas.addFsToIndexes(fs);
View Full Code Here

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

      // and the case that type used for typeInit() has and featurePath that is
      // always valid
      featurePath = new FeaturePathImpl();
      try {
         featurePath.initialize("/stringFeature");
         featurePath.typeInit(cas.getDocumentAnnotation().getType());

         Type testAnnotType = cas.getTypeSystem().getType(
               "uima.tt.TestAnnotation");
         AnnotationFS fs = cas.createAnnotation(testAnnotType, 0, 1);
         cas.addFsToIndexes(fs);
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.