/** * Resets the CAS (Common Analysis System), emptying it of all content. * * @param jcas JCas object */ public static void resetCAS(JCas jcas) { if (jcas != null) { jcas.reset(); } }
/** * Serializes a CAS in the given format. * * @param jcas * CAS (Common Analysis System) to be serialized. * @param type * type of cTAKES (UIMA) serializer used to write CAS. * @param prettyPrint * {@code true} to do pretty printing of output. * @param stream * {@link OutputStream} object used to print out information * extracted by using cTAKES. * @throws SAXException * if there was a SAX exception. * @throws IOException * if any I/O error occurs. */ public static void serialize(JCas jcas, CTAKESSerializer type, boolean prettyPrint, OutputStream stream) throws SAXException, IOException { if (type == CTAKESSerializer.XCAS) { XCASSerializer.serialize(jcas.getCas(), stream, prettyPrint); } else if (type == CTAKESSerializer.XMI) { XmiCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(), stream, prettyPrint, new XmiSerializationSharedData()); } else { XmlCasSerializer.serialize(jcas.getCas(), jcas.getTypeSystem(), stream); } }
@Override public void getNext(JCas sJCas) throws IOException { isDone = true; sJCas.setDocumentLanguage(language); sJCas.setDocumentText(documentText); }
public HtmlVisitor(JCas jcas, boolean onlyContent) { super(); this.jcas = jcas; this.cas = jcas.getCas(); this.onlyContent = onlyContent; }
/** * Gets the JCas document text. * * @return the document text */ public String getDocumentText() { return jCas.getDocumentText(); }
jcas.setDocumentText(metaText.toString() + sb.toString()); ae.process(jcas);
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); return indexes.getAnnotationIndex( Sentence.type ).iterator(); }
/** * @param jcas ye olde jay-cas * @return the Metadata for the given jcas or null if one is not found */ static private Metadata getMetadata( final JCas jcas ) { // TODO I really dislike this index-everything-to-java1 paradigm final FSIterator<TOP> itr = jcas.getJFSIndexRepository().getAllIndexedFS( Metadata.type ); if ( itr == null || !itr.hasNext() ) { return null; } return (Metadata)itr.next(); }
public String getLanguage(JCas aJCas) { if (language != null) { return language; } else { return aJCas.getDocumentLanguage(); } }
/** * Return the document annotation. * * @param jCas * @return the document annotation */ public static DocumentAnnotation getDocumentAnnotation(JCas jCas) { return (DocumentAnnotation) jCas.getDocumentAnnotationFs(); }
/** * Removes all debug annotations from the index. * * @param jcas - the current document */ public static void removeDebugInformation(JCas jcas) { jcas.removeAllIncludingSubtypes(DebugBlockApply.type); jcas.removeAllIncludingSubtypes(DebugRuleApply.type); jcas.removeAllIncludingSubtypes(DebugRuleMatch.type); }
@Override protected void apply(String text, JCas jCas) { jCas.setDocumentLanguage("en"); jCas.setDocumentText(text); }
public HtmlVisitor(JCas jcas, boolean onlyContent) { super(); this.jcas = jcas; this.cas = jcas.getCas(); this.onlyContent = onlyContent; }
/** * Gets the JCas document text. * * @return the document text */ public String getDocumentText() { return jCas.getDocumentText(); }
private FSIterator<Annotation> getAllAnnotations(JCas jcas, int type) { JFSIndexRepository indexes = jcas.getJFSIndexRepository(); FSIterator<Annotation> annotationsIter = indexes.getAnnotationIndex(type).iterator(); // while (segmentItr.hasNext()) { // } return annotationsIter; }
/** * Resets the CAS (Common Analysis System), emptying it of all content. * * @param jcas JCas object */ public static void resetCAS(JCas jcas) { if (jcas != null) { jcas.reset(); } }
public String getLanguage(JCas aJCas) { if (language != null) { return language; } else { return aJCas.getDocumentLanguage(); } }
@Override public void removeAllIncludingSubtypes(int type) { delegate.removeAllIncludingSubtypes(type); } }
@Override public void getNext(JCas sJCas) throws IOException { isDone = true; sJCas.setDocumentLanguage(language); sJCas.setDocumentText(documentText); }
/** * Resets the CAS (Common Analysis System), emptying it of all content. * * @param jcas JCas object */ public static void resetCAS(JCas jcas) { if (jcas != null) { jcas.reset(); } }