Examples of TypePriorities_impl


Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

  }
 
 
  public void testDeltaCasNoChanges() throws Exception {
      try {
        CAS cas1 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
                indexes);
        CAS cas2 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
                indexes);

        //serialize complete 
        XmiSerializationSharedData sharedData = new XmiSerializationSharedData();
        String xml = serialize(cas1, sharedData);
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

    }
    }
 
  public void testDeltaCasDisallowPreexistingFSViewMod() throws Exception {
    try {
      CAS cas1 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
              indexes);
      CAS cas2 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
              indexes);
      cas1.setDocumentText("This is a test document in the initial view");
      AnnotationFS anAnnot1 = cas1.createAnnotation(cas1.getAnnotationType(), 0, 4);
      cas1.getIndexRepository().addFS(anAnnot1);
      AnnotationFS anAnnot2 = cas1.createAnnotation(cas1.getAnnotationType(), 5, 10);
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

    }
  }
 
  public void testDeltaCasAllowPreexistingFS() throws Exception {
   try {
      CAS cas1 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
              indexes);
      CAS cas2 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
              indexes);
      CAS cas3 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
              indexes);
     
      Type personType = cas1.getTypeSystem().getType(
          "org.apache.uima.testTypeSystem.Person");
      Feature componentIdFeat = personType.getFeatureByBaseName("componentId");
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

    }
  }
 
  public void testDeltaCasListFS() throws Exception {
     try {
        CAS cas1 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
                indexes);
        CAS cas2 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
                indexes);
        CAS cas3 = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(),
                indexes);
       
        Type entityType = cas1.getTypeSystem().getType("org.apache.uima.testTypeSystem.Entity");
        Feature classesFeat = entityType.getFeatureByBaseName("classes");
        Feature linksFeat = entityType.getFeatureByBaseName("links");
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

 
 
  public void testOutOfTypeSystemData() throws Exception {
    // deserialize a simple XMI into a CAS with no TypeSystem   
    CAS cas = CasCreationUtils.createCas(new TypeSystemDescription_impl(),
            new TypePriorities_impl(), new FsIndexDescription[0]);
    File xmiFile = JUnitExtension.getFile("ExampleCas/simpleCas.xmi");
    String xmiStr = FileUtils.file2String(xmiFile, "UTF-8");
   
    XmiSerializationSharedData sharedData = new XmiSerializationSharedData();
    deserialize(xmiStr, cas, sharedData, true, -1);
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

    //serialize to XMI
    String xmiStr = serialize(originalCas, null);
   
    //deserialize into a CAS with no type system
    CAS casWithNoTs = CasCreationUtils.createCas(new TypeSystemDescription_impl(),
            new TypePriorities_impl(), new FsIndexDescription[0]);
    XmiSerializationSharedData sharedData = new XmiSerializationSharedData();
    deserialize(xmiStr, casWithNoTs, sharedData, true, -1);
       
    // now reserialize including OutOfTypeSystem data
    String xmiStr2 = serialize(casWithNoTs, sharedData);
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });
      desc.getAnalysisEngineMetaData().setTypeSystem(typeSystem);

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Type1");
      priorityList.addType("Type2");
      desc.getAnalysisEngineMetaData().setTypePriorities(typePriorities);

      FsIndexDescription index1 = new FsIndexDescription_impl();
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
      priorityList.addType("EnumType");

      FsIndexDescription index = new FsIndexDescription_impl();
      index.setLabel("testIndex");
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

            .getFsIndexes();
 

  public void testCasToInlineXml() throws Exception {
    // Jira https://issues.apache.org/jira/browse/UIMA-2406
    CAS srcCas = CasCreationUtils.createCas(typeSystem, new TypePriorities_impl(), indexes);
   
    JCas jcas = srcCas.getJCas();
   
    jcas.setDocumentText("1 2 3 4 5 6 7 8 9");
    OfShorts f = new OfShorts(jcas);
View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.TypePriorities_impl

      index.setLabel("MyIndex");
      index.setTypeName("test.Foo");
      index.setKind(FsIndexDescription.KIND_BAG);
      indexes.addFsIndex(index);

      TypePriorities priorities = new TypePriorities_impl();
      TypePriorityList priList = new TypePriorityList_impl();
      priList.addType("test.Foo");
      priList.addType("test.Sub");
      priList.addType("test.Super");
      priorities.addPriorityList(priList);

      // create a CAS containing all these definitions
      ArrayList descList = new ArrayList();
      descList.add(tsd1);
      descList.add(tsd2);
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.