Beispiel #1
0
  private void setUIMASetting() {
    System.setProperty("defaultBrokerURL", "tcp://SuzumuraAiri:61616");
    uimaSetting.put(
        UimaAsynchronousEngine.DD2SpringXsltFilePath,
        EnvironmentVariable.UIMA_HOME + "/bin/dd2spring.xsl");
    uimaSetting.put(
        UimaAsynchronousEngine.SaxonClasspath,
        "file:" + EnvironmentVariable.UIMA_HOME + "/saxon/saxon8.jar");
    uimaSetting.put(UimaAsynchronousEngine.ServerUri, "tcp://SuzumuraAiri:61616");
    uimaSetting.put(UimaAsynchronousEngine.ENDPOINT, "RoomNumberAnnotatorQueue");
    uimaSetting.put(UimaAsynchronousEngine.GetMetaTimeout, 10 * 1000);
    uimaSetting.put(UimaAsynchronousEngine.CasPoolSize, 100);
    //	    uimaSetting.put(UimaAsynchronousEngine.Timeout, 10 * 1000);
    //	    uimaSetting.put(UimaAsynchronousEngine.CpcTimeout, 10 * 1000);
    //	    uimaSetting.put(UIMAFramework.CAS_INITIAL_HEAP_SIZE, Integer.valueOf(8192 /
    // 4).toString());

    uimaEEEngine.addStatusCallbackListener(new StatusCallbackListenerImpl());

    try {
      uimaEEEngine.deploy(
          "C:/Users/HentaiMaster/Documents/SpringWorkspace/my-uima/deploy/as/Deploy_RoomNumberAnnotator.xml",
          uimaSetting);
      uimaEEEngine.initialize(uimaSetting);
      uimaEEEngine.process();
    } catch (ResourceInitializationException e) {
      System.out.println("Resource Init Exception");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Beispiel #2
0
 public void setCollectionReader() {
   try {
     CollectionReaderDescription collectionReaderDescription =
         UIMAFramework.getXMLParser()
             .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));
     CollectionReader collectionReader =
         UIMAFramework.produceCollectionReader(collectionReaderDescription);
     uimaEEEngine.setCollectionReader(collectionReader);
   } catch (ResourceInitializationException e) {
   } catch (InvalidXMLException e) {
   } catch (IOException e) {
   }
 }