Package org.apache.uima.cas

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


      byteArrayFS.set(1, (byte) 47);
      byteArrayFS.set(2, (byte) 11);
      cas.getDocumentAnnotation().setFeatureValue(byteArrayFeat, byteArrayFS);
      path = "/byteArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(byteArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertEquals("23,47,11", featurePath.getValueAsString(cas
            .getDocumentAnnotation()));
View Full Code Here


      fsArrayFS.set(1, cas.getDocumentAnnotation());
      fsArrayFS.toStringArray();
      cas.getDocumentAnnotation().setFeatureValue(fsArrayFeat, fsArrayFS);
      path = "/fsArray";
      featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals(fsArrayFS, featurePath.getFSValue(cas
            .getDocumentAnnotation()));
      assertTrue(featurePath.getValueAsString(cas.getDocumentAnnotation())
            .indexOf("11") > 0);
View Full Code Here

      Feature stringFeat = cas.getDocumentAnnotation().getType()
            .getFeatureByBaseName("stringFeature");
      cas.getDocumentAnnotation().setStringValue(stringFeat, "TestString");
      String path = "/stringFeature";
      FeaturePath featurePath = new FeaturePathImpl();
      featurePath.initialize(path);
      assertEquals(path, featurePath.getFeaturePath());
      featurePath.typeInit(cas.getDocumentAnnotation().getType());
      assertEquals("TestString", featurePath.getStringValue(cas
            .getDocumentAnnotation()));
      assertEquals("TestString", featurePath.getValueAsString(cas
View Full Code Here

      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

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.