@Override public void process(final JCas aJCas) throws AnalysisEngineProcessException { createViewSafely(aJCas, viewName); }
/** * Reads the next file and stores its text in <b>cas</b> as the "TreebankView" SOFA. */ public void getNext(JCas jCas) throws IOException, CollectionException { File treebankFile = files.removeFirst(); getUimaContext().getLogger().log( Level.FINEST, "reading treebank file: " + treebankFile.getPath()); ViewUriUtil.setURI(jCas, treebankFile.toURI()); try { JCas treebankView = ViewCreatorAnnotator.createViewSafely( jCas, TREEBANK_VIEW); treebankView.setSofaDataString(FileUtils.file2String(treebankFile), "text/plain"); } catch (AnalysisEngineProcessException aepe) { throw new CollectionException(aepe); } }
/** * Reads the next file and stores its text in <b>cas</b> as the "TreebankView" SOFA. */ public void getNext(JCas jCas) throws IOException, CollectionException { File treebankFile = files.removeFirst(); getUimaContext().getLogger().log( Level.FINEST, "reading treebank file: " + treebankFile.getPath()); ViewUriUtil.setURI(jCas, treebankFile.toURI()); try { JCas treebankView = ViewCreatorAnnotator.createViewSafely( jCas, TREEBANK_VIEW); treebankView.setSofaDataString(FileUtils.file2String(treebankFile), "text/plain"); } catch (AnalysisEngineProcessException aepe) { throw new CollectionException(aepe); } }
newGoldView = ViewCreatorAnnotator.createViewSafely(jCas, AssertionEvaluation.GOLD_VIEW_NAME); try { newGoldView.setSofaDataString(jCas.getSofaDataString(), jCas.getSofaMimeType());
public void getNext(JCas jCas) throws IOException, CollectionException { if (!hasNext()) { throw new RuntimeException("getNext(jCas) was called but hasNext() returns false"); } // get a JCas object JCas view; try { view = ViewCreatorAnnotator.createViewSafely(jCas, this.viewName); } catch (AnalysisEngineProcessException e) { throw new CollectionException(e); } // set the document's text String text = FileUtils.file2String(currentFile, this.encoding); view.setSofaDataString(text, "text/plain"); // set language if it was specified if (this.language != null) { view.setDocumentLanguage(this.language); } // set the document URI ViewUriUtil.setURI(jCas, currentFile.toURI()); completed++; currentFile = null; }
public void getNext(JCas jCas) throws IOException, CollectionException { hasNext(); JCas view; try { view = ViewCreatorAnnotator.createViewSafely(jCas, this.viewName); } catch (AnalysisEngineProcessException e) { throw new CollectionException(e); } lineHandler.handleLine(view, rootFile, file, line); // set language if it was specified if (this.language != null) { view.setDocumentLanguage(this.language); } completed++; line = null; }
public void getNext(JCas jCas) throws IOException, CollectionException { hasNext(); JCas view; try { view = ViewCreatorAnnotator.createViewSafely(jCas, this.viewName); } catch (AnalysisEngineProcessException e) { throw new CollectionException(e); } lineHandler.handleLine(view, rootFile, file, line); // set language if it was specified if (this.language != null) { view.setDocumentLanguage(this.language); } completed++; line = null; }
newGoldView = ViewCreatorAnnotator.createViewSafely(jCas, AssertionEvaluation.GOLD_VIEW_NAME); try { newGoldView.setSofaDataString(jCas.getSofaDataString(), jCas.getSofaMimeType());
public void getNext(JCas jCas) throws IOException, CollectionException { if (!hasNext()) { throw new RuntimeException("getNext(jCas) was called but hasNext() returns false"); } // get a JCas object JCas view; try { view = ViewCreatorAnnotator.createViewSafely(jCas, this.viewName); } catch (AnalysisEngineProcessException e) { throw new CollectionException(e); } // set the document's text String text = FileUtils.file2String(currentFile, this.encoding); view.setSofaDataString(text, "text/plain"); // set language if it was specified if (this.language != null) { view.setDocumentLanguage(this.language); } // set the document URI ViewUriUtil.setURI(jCas, currentFile.toURI()); completed++; currentFile = null; }