Examples of createFS()


Examples of org.apache.uima.cas.CAS.createFS()

      assertTrue(tcas2 == tcas3);
      assertNotNull(cas1.getTypeSystem().getType("NamedEntity"));
      assertNotNull(tcas3.getTypeSystem().getType("NamedEntity"));

      FeatureStructure fs = tcas3.createFS(tcas3.getTypeSystem().getType("NamedEntity"));
      tcas3.getIndexRepository().addFS(fs);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
  }
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

      CAS inputCas1 = ae.newCAS();
      Type sdiType = inputCas1.getTypeSystem().getType(
              "org.apache.uima.examples.SourceDocumentInformation");
      Feature uriFeat = sdiType.getFeatureByBaseName("uri");
      inputCas1.setDocumentText("This is");
      FeatureStructure sdiFS = inputCas1.createFS(sdiType);
      sdiFS.setStringValue(uriFeat, "cas1");
      inputCas1.getIndexRepository().addFS(sdiFS);
      CAS inputCas2 = ae.newCAS();
      inputCas2.setDocumentText(" one.\nThis is");
      FeatureStructure sdiFS2 = inputCas2.createFS(sdiType);
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

      FeatureStructure sdiFS = inputCas1.createFS(sdiType);
      sdiFS.setStringValue(uriFeat, "cas1");
      inputCas1.getIndexRepository().addFS(sdiFS);
      CAS inputCas2 = ae.newCAS();
      inputCas2.setDocumentText(" one.\nThis is");
      FeatureStructure sdiFS2 = inputCas2.createFS(sdiType);
      sdiFS2.setStringValue(uriFeat, "cas2");
      inputCas2.getIndexRepository().addFS(sdiFS2);
      CAS inputCas3 = ae.newCAS();
      inputCas3.setDocumentText(" two.\n");
      FeatureStructure sdiFS3 = inputCas3.createFS(sdiType);
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

      FeatureStructure sdiFS2 = inputCas2.createFS(sdiType);
      sdiFS2.setStringValue(uriFeat, "cas2");
      inputCas2.getIndexRepository().addFS(sdiFS2);
      CAS inputCas3 = ae.newCAS();
      inputCas3.setDocumentText(" two.\n");
      FeatureStructure sdiFS3 = inputCas3.createFS(sdiType);
      sdiFS3.setStringValue(uriFeat, "cas3");
      inputCas3.getIndexRepository().addFS(sdiFS3);

      // input first CAS. Should be no segments yet.
      CasIterator iter = ae.processAndOutputNewCASes(inputCas1);
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

  public void testCas() {
    CAS cas = this.jcas.getCas();
    TypeSystem ts = cas.getTypeSystem();
    Type annotType = ts.getType(annotationTypeName);
    FeatureStructure fs = cas.createFS(annotType);
    Feature stringSetFeat = ts.getFeatureByFullName(annotationTypeName
  + TypeSystem.FEATURE_SEPARATOR + stringSetFeatureName);
    fs.setStringValue(stringSetFeat, definedValue1);
    fs.setStringValue(stringSetFeat, definedValue2);
    fs.setStringValue(stringSetFeat, definedValue3);
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

    Type relArgsType = newCas2.getTypeSystem().getType(
            "org.apache.uima.testTypeSystem.BinaryRelationArgs");
    Feature domainFeat = relArgsType.getFeatureByBaseName("domainValue");
    Feature rangeFeat = relArgsType.getFeatureByBaseName("rangeValue");
    AnnotationFS ownerAnnot = newCas2.createAnnotation(ownerType, 0, 70);
    FeatureStructure relArgs = newCas2.createFS(relArgsType);
    relArgs.setFeatureValue(domainFeat, person);
    relArgs.setFeatureValue(rangeFeat, org);
    ownerAnnot.setFeatureValue(argsFeat, relArgs);
    ownerAnnot.setStringValue(componentIdFeat, "XCasDeserializerTest");
    newCas2.addFsToIndexes(ownerAnnot);
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

    try {
      CAS localCas = jcas.getCas();
      Type subTok = localCas.getTypeSystem().getType("SubToken");
      Annotation a1 = new Annotation(jcas);
      a1.addToIndexes();
      FeatureStructure f1 = localCas.createFS(subTok);
      localCas.getIndexRepository().addFS(f1);

      JFSIndexRepository ir = jcas.getJFSIndexRepository();
      FSIndex index = ir.getAnnotationIndex();
      FSIterator it = index.iterator();
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

  public void testFSListNotPromoted() throws Exception {
    try {
      CAS localCas = jcas.getCas();
      TypeSystem ts = localCas.getTypeSystem();
      Type fsl = ts.getType("uima.cas.NonEmptyFSList");
      FeatureStructure fs = localCas.createFS(fsl);
      assertTrue(fs instanceof NonEmptyFSList);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
  }
View Full Code Here

Examples of org.apache.uima.cas.CAS.createFS()

    cas.addFsToIndexes(testAnnot);
    Type nonEmptyFsListType = cas.getTypeSystem().getType(CAS.TYPE_NAME_NON_EMPTY_FS_LIST);
    Type emptyFsListType = cas.getTypeSystem().getType(CAS.TYPE_NAME_EMPTY_FS_LIST);
    Feature headFeat = nonEmptyFsListType.getFeatureByBaseName("head");
    Feature tailFeat = nonEmptyFsListType.getFeatureByBaseName("tail");
    FeatureStructure emptyNode = cas.createFS(emptyFsListType);
    FeatureStructure secondNode = cas.createFS(nonEmptyFsListType);
    secondNode.setFeatureValue(headFeat, orgAnnot2);
    secondNode.setFeatureValue(tailFeat, emptyNode);
    FeatureStructure firstNode = cas.createFS(nonEmptyFsListType);
    firstNode.setFeatureValue(headFeat, orgAnnot1);
View Full Code Here

Examples of org.apache.uima.cas.impl.CASImpl.createFS()

    CASImpl cas = this.fSTreeModel.getCas();
    if (this.nodeClass != STD_FS || this.addr == 0) {
      return false;
    }
    if (cas.getTypeSystem().subsumes(cas.getAnnotationType(), getType())) {
      if (cas == ((AnnotationFS) cas.createFS((int) this.addr)).getView()) {
        return true;
      }
    }
    return false;
  }
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.