Package org.apache.uima.collection

Examples of org.apache.uima.collection.CollectionException


  public void getLargeCAS(CAS aCAS, File xmiFile) throws IOException, CollectionException {
      FileInputStream inputStream = new FileInputStream(xmiFile);
      try {
        XmiCasDeserializer.deserialize(inputStream, aCAS, false);
      } catch (SAXException e) {
        throw new CollectionException(e);
      } finally {
        inputStream.close();
      }
     
    }
View Full Code Here


        XmiCasDeserializer.deserialize(inputStream, cas);
      } else {
        XCASDeserializer.deserialize(inputStream, cas);
      }
    } catch (SAXException e) {
      throw new CollectionException(e);
    } finally {
      inputStream.close();
    }

    inputStream.close();
View Full Code Here

      wi.setLastBlock(mWorkList.get(mCurrentIndex).last);
      logger.log(Level.INFO, "Sending "+wi.getInputspec()+" index="+wi.getBlockindex()+" last="+wi.getLastBlock()+" length="+wi.getBytelength());
      mCurrentIndex++;
      jcas.setDocumentText(wi.getInputspec()+" index="+wi.getBlockindex()+" length="+wi.getBytelength());
    } catch (CASException e) {
      throw new CollectionException(e);
    }

    //create WorkItem info structure
  }
View Full Code Here

      wi.addToIndexes();
      logger.log(Level.INFO, "Sending "+wi.getInputspec());
      mCurrentIndex++;
      jcas.setDocumentText(wi.getInputspec());
    } catch (CASException e) {
      throw new CollectionException(e);
    }

    //create WorkItem info structure
  }
View Full Code Here

    FileInputStream inputStream = new FileInputStream(this.filesIter.next());
    try {
      XmiCasDeserializer.deserialize(new BufferedInputStream(inputStream), jCas.getCas());
    } catch (SAXException e) {
      inputStream.close();
      throw new CollectionException(e);
    }
    inputStream.close();
    this.completed += 1;
  }
View Full Code Here

    File currentFile = (File) mFiles.get(mCurrentIndex++);
    FileInputStream inputStream = new FileInputStream(currentFile);
    try {
      XmiCasDeserializer.deserialize(inputStream, aCAS, ! mFailOnUnknownType);
    } catch (SAXException e) {
      throw new CollectionException(e);
    } finally {
      inputStream.close();
    }
  }
View Full Code Here

  public void getNext(CAS aCAS) throws IOException, CollectionException {
    JCas jcas;
    try {
      jcas = aCAS.getJCas();
    } catch (CASException e) {
      throw new CollectionException(e);
    }

    // open input stream to file
    File file = (File) mFiles.get(mCurrentIndex++);
View Full Code Here

  @Override
  public void getNext(final CAS aCAS) throws IOException, CollectionException {
    try {
      getNext(aCAS.getJCas());
    } catch (CASException e) {
      throw new CollectionException(e);
    }
  }
View Full Code Here

      }
      getDocumentById(aCAS, id);
      addDocKey(aCAS, id);
    } else {
      // shouldn't get here?
      throw new CollectionException("no documents to process",
          new Object[] {});
    }
  }
View Full Code Here

                logger.error(document);
                throw e;
            }
        } catch (Exception e)
        {
            throw new CollectionException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.CollectionException

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.