public JCas getJCas() { try { return cas.getJCas(); } catch (CASException e) { // e.printStackTrace(); } return null; }
/** * Create a new JCas for the given type system description. No auto-detection type priorities, or * indexes is performed. * * @param typeSystemDescription * a type system description to initialize the JCas * @return a new JCas * @throws UIMAException * if the JCas could not be initialized */ public static JCas createJCas(TypeSystemDescription typeSystemDescription) throws UIMAException { return CasCreationUtils.createCas(typeSystemDescription, null, null).getJCas(); }
public JCas getJCas() { try { return cas.getJCas(); } catch (CASException e) { e.printStackTrace(); } return null; }
public DynamicTypeGenerator(TypeSystemDescription typeSystemDescription) { try { JCas jCas = CasCreationUtils.createCas(typeSystemDescription, null, null).getJCas(); this.typeSystemDescription = typeSystemDescription; customTypes = new HashSet<>(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
public DynamicTypeGenerator(ArrayList<TypeSystemDescription> typeSystemDescriptions) { try { TypeSystemDescription mergedTypeSystem = CasCreationUtils.mergeTypeSystems(typeSystemDescriptions); this.typeSystemDescription = mergedTypeSystem; JCas jCas = CasCreationUtils.createCas(mergedTypeSystem, null, null).getJCas(); customTypes = new HashSet<>(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
@Override public Object getValue(TOP a) { try { JCas jcas = a.getCAS().getJCas(); return JCasUtil.select(jcas, Token.class).size(); } catch (CASException e) { e.printStackTrace(); return 0; } }
public void getNext(CAS aCAS) throws IOException, CollectionException { JCas jcas; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new CollectionException(e); } fillJCas(jcas); // give an indicator that a file has been processed System.err.print("."); }
public final void getNext(final CAS cas) throws IOException, CollectionException { try { getNext(cas.getJCas()); } catch (CASException e) { throw new CollectionException(e); } }
/** * process */ public void processCas(CAS aCAS) throws ResourceProcessException { JCas jcas; try { jcas = aCAS.getJCas(); } catch (CASException e) { throw new ResourceProcessException(e); } printTimexAnnotations(jcas); }
@Override public JCas createJCas() throws CASException, ResourceInitializationException { return CasCreationUtils.createCas(casManager.getCasDefinition(), null).getJCas(); } }
@Override public void getNext(final CAS aCAS) throws IOException, CollectionException { try { getNext(aCAS.getJCas()); } catch (CASException e) { throw new CollectionException(e); } }
@Override public void getNext(final CAS aCAS) throws IOException, CollectionException { try { getNext(aCAS.getJCas()); } catch (CASException e) { throw new CollectionException(e); } }
@Override public final void getNext(CAS cas) throws IOException, CollectionException { try { getNext(cas.getJCas()); } catch (CASException e) { throw new CollectionException(e); } }
@Override public final void getNext(CAS cas) throws IOException, CollectionException { try { getNext(cas.getJCas()); } catch (CASException e) { throw new CollectionException(e); } }
public JCas initJCas() { JCas jCas = null; try { jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas(); } catch (CASException e) { e.printStackTrace(); } catch (ResourceInitializationException e) { e.printStackTrace(); } return jCas; }
public JCas initJCas() { JCas jCas = null; try { jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas(); } catch (CASException e) { e.printStackTrace(); } catch (ResourceInitializationException e) { e.printStackTrace(); } return jCas; }
public JCas initJCas() { JCas jCas = null; try { jCas = CasCreationUtils.createCas(dynamicTypeGenerator.getTypeSystemDescription(), null, null).getJCas(); } catch (CASException e) { e.printStackTrace(); } catch (ResourceInitializationException e) { e.printStackTrace(); } return jCas; }
public static Token getHeadTokenOfAnnotation(Annotation annotation) { try { return getHeadTokenInRange(annotation.getCAS().getJCas(), annotation.getBegin(), annotation.getEnd()); } catch (CASException e) { return null; } }
private void addMergeToHistory(Annotation keep, Annotation removed) { if (keep instanceof Recordable && removed instanceof Base) { Recordable r = (Recordable) keep; Base b = (Base) removed; try { addToHistory( keep.getCAS().getJCas(), HistoryEvents.createMerged(r, referrer, b.getInternalId())); } catch (CASException e) { monitor.error("Unable to add merge to history", e); } } }
@Override public JCas readInitialCas(TrainingDocument aDocument) throws CASException, ResourceInitializationException, IOException { JCas jcas = CasCreationUtils.createCas((TypeSystemDescription) null, null, null).getJCas(); CasPersistenceUtils.readSerializedCas(jcas, getCasFile(aDocument)); automationCasStorageService.analyzeAndRepair(aDocument, jcas.getCas()); return jcas; }