Package org.apache.uima.cas

Examples of org.apache.uima.cas.SofaID


      String absoluteRoot = (String) mSofaMappings.get(nameToMap);
      if (absoluteRoot == null)
        absoluteRoot = nameToMap;
      absoluteSofaName = absoluteRoot + rest;
    }
    SofaID sofaid = new SofaID_impl();
    sofaid.setSofaID(absoluteSofaName);
    return sofaid;
  }
View Full Code Here


    Iterator<Map.Entry<String, String>> iter = sofamap.iterator();
    SofaID[] sofaArr = new SofaID_impl[sofamap.size()];
    int i = 0;
    while (iter.hasNext()) {
      Map.Entry<String, String> elem = iter.next();
      SofaID sofaid = new SofaID_impl();
      sofaid.setComponentSofaName((String) elem.getKey());
      sofaid.setSofaID((String) elem.getValue());
      sofaArr[i] = sofaid;
      i++;
    }
    return sofaArr;
 
View Full Code Here

      CAS newCas = CasCreationUtils.createCas(typeSystem, null, null);
      File xcasFile = JUnitExtension.getFile("ExampleCas/multiSofaCas.xml");
      XCASDeserializer.deserialize(new FileInputStream(xcasFile), newCas);
      JCas newJCas = newCas.getJCas();
     
      SofaID sofaId = new SofaID_impl("EnglishDocument");
      JCas view = newJCas.getView(newJCas.getSofa(sofaId));
    }
    catch (Exception e) {
      JUnitExtension.handleException(e);     
    }     
View Full Code Here

      CAS newCas = CasCreationUtils.createCas(typeSystem, null, null);
      File xcasFile = JUnitExtension.getFile("ExampleCas/multiSofaCas.xml");
      XCASDeserializer.deserialize(new FileInputStream(xcasFile), newCas);
      JCas newJCas = newCas.getJCas();
     
      SofaID sofaId = new SofaID_impl("EnglishDocument");
      JCas view = newJCas.getView(newJCas.getSofa(sofaId));
    }
    catch (Exception e) {
      JUnitExtension.handleException(e);     
    }     
View Full Code Here

   *      org.apache.uima.cas.CAS)
   */
  public void initializeCas(Object aObject, CAS aCAS) throws CollectionException, IOException {
    // Assert.assertFalse(aCAS instanceof CAS);
    // Create the English document Sofa
    SofaID realSofaName = getUimaContext().mapToSofaID("InputText");
    // System.out.println("CASINITIALIZER: real sofa name for InputText " +
    // realSofaName.getSofaID());
    SofaFS ls = aCAS.createSofa(realSofaName, "text");
    ls.setLocalSofaData("this beer is good");
  }
View Full Code Here

    String text = "this beer is good";
    try {
      this.getCasInitializer().initializeCas(text, aCAS);
    } catch (NullPointerException e) {
      // Create the Source text Sofa
      SofaID sofaid = getUimaContext().mapToSofaID("InputText");
      // System.out.println("COLLECTIONREADER: real sofa name for InputText " + sofaid.getSofaID());

      SofaFS ls = aCAS.createSofa(sofaid, "text");
      ls.setLocalSofaData(text);
    }
View Full Code Here

  public void process(CAS aCas, ResultSpecification aResultSpec) throws AnnotatorProcessException {
    CAS engTcas, germTcas;

    // get English text Sofa and open CAS view
    SofaID realSofaName = getContext().mapToSofaID("EnglishDocument");
    // System.out.println("TRANSANNOTATOR: real sofa name for English document " +
    // realSofaName.getSofaID());

    engTcas = aCas.getView(aCas.getSofa(realSofaName));
    // if (engTcas == null)
View Full Code Here

    // engTcas = aCas.getView(aCas.getSofa(realSofaName));
    engTcas = aCas;
    // if (engTcas == null )
    // System.out.println(realSofaName + " sofa not found in CAS");

    SofaID realSofaName = getContext().mapToSofaID("GermanDocument");
    // System.out.println("TRANSANNOTATOR: real sofa name of GermanDocument " +
    // realSofaName.getSofaID());
    // Create the output German text Sofa and open CAS view
    germTcas = aCas.getView(aCas.createSofa(realSofaName, "text"));
View Full Code Here

      String absoluteRoot = (String) mSofaMappings.get(nameToMap);
      if (absoluteRoot == null)
        absoluteRoot = nameToMap;
      absoluteSofaName = absoluteRoot + rest;
    }
    SofaID sofaid = new SofaID_impl();
    sofaid.setSofaID(absoluteSofaName);
    return sofaid;
  }
View Full Code Here

    Iterator<Map.Entry<String, String>> iter = sofamap.iterator();
    SofaID[] sofaArr = new SofaID_impl[sofamap.size()];
    int i = 0;
    while (iter.hasNext()) {
      Map.Entry<String, String> elem = iter.next();
      SofaID sofaid = new SofaID_impl();
      sofaid.setComponentSofaName((String) elem.getKey());
      sofaid.setSofaID((String) elem.getValue());
      sofaArr[i] = sofaid;
      i++;
    }
    return sofaArr;
 
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.SofaID

Copyright © 2018 www.massapicom. 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.