Package org.apache.uima.cas

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


      Feature shortFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("shortFeature");
      cas.getDocumentAnnotation().setShortValue(shortFeat, (short) 12);
      path = "/shortFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Short.valueOf((short) 12), featurePath.getShortValue(cas
            .getDocumentAnnotation()));
      assertEquals("12", featurePath.getValueAsString(cas
View Full Code Here


      Feature floatFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("floatFeature");
      cas.getDocumentAnnotation().setFloatValue(floatFeat, 1.12f);
      path = "/floatFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Float.valueOf(1.12f), featurePath.getFloatValue(cas
            .getDocumentAnnotation()));
      assertEquals("1.12", featurePath.getValueAsString(cas
View Full Code Here

      Feature doubleFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("doubleFeature");
      cas.getDocumentAnnotation().setDoubleValue(doubleFeat, 100.5);
      path = "/doubleFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Double.valueOf(100.5), featurePath.getDoubleValue(cas
            .getDocumentAnnotation()));
      assertEquals("100.5", featurePath.getValueAsString(cas
View Full Code Here

      Feature longFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("longFeature");
      cas.getDocumentAnnotation().setLongValue(longFeat, 2000);
      path = "/longFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Long.valueOf(2000), featurePath.getLongValue(cas
            .getDocumentAnnotation()));
      assertEquals("2000", featurePath.getValueAsString(cas
View Full Code Here

      Feature intFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("intFeature");
      cas.getDocumentAnnotation().setIntValue(intFeat, 5);
      path = "/intFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Integer.valueOf(5), featurePath.getIntValue(cas
            .getDocumentAnnotation()));
      assertEquals("5", featurePath.getValueAsString(cas
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

      Feature byteFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("byteFeature");
      cas.getDocumentAnnotation().setByteValue(byteFeat, (byte) 127);
      path = "/byteFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(Byte.valueOf((byte) 127), featurePath.getByteValue(cas
            .getDocumentAnnotation()));
      assertEquals("127", featurePath.getValueAsString(cas
View Full Code Here

      cas.setDocumentText("Sample Text");

      // test feature path not set
      String path = "/refFeature2";
      FeaturePath 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(null, featurePath.getFSValue(null));

      // test feature path not set
      path = "/refFeature/refFeature";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(null, featurePath.getTypClass(cas.getDocumentAnnotation()));
      assertEquals(null, featurePath.getType(cas.getDocumentAnnotation()));
      assertEquals(null, featurePath.getValueAsString(cas
View Full Code Here

      cas.getDocumentAnnotation().setStringValue(stringFeat, "MyExample");
      cas.getDocumentAnnotation().setFeatureValue(refFeat,
            cas.getDocumentAnnotation());
      path = "/refFeature/refFeature/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

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.