Search in sources :

Example 1 with TextCorpus

use of eu.clarin.weblicht.wlfxb.tc.api.TextCorpus in project webanno by webanno.

the class TcfReader method getNext.

@Override
public void getNext(JCas aJCas) throws IOException, CollectionException {
    Resource res = nextFile();
    initCas(aJCas, res);
    InputStream is = null;
    try {
        is = new BufferedInputStream(res.getInputStream());
        WLData wLData = WLDObjector.read(is);
        TextCorpus aCorpusData = wLData.getTextCorpus();
        convertToCas(aJCas, aCorpusData);
    } catch (WLFormatException e) {
        throw new CollectionException(e);
    } finally {
        closeQuietly(is);
    }
}
Also used : BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) InputStream(java.io.InputStream) CollectionException(org.apache.uima.collection.CollectionException) TextCorpus(eu.clarin.weblicht.wlfxb.tc.api.TextCorpus) WLData(eu.clarin.weblicht.wlfxb.xb.WLData) WLFormatException(eu.clarin.weblicht.wlfxb.io.WLFormatException)

Aggregations

WLFormatException (eu.clarin.weblicht.wlfxb.io.WLFormatException)1 TextCorpus (eu.clarin.weblicht.wlfxb.tc.api.TextCorpus)1 WLData (eu.clarin.weblicht.wlfxb.xb.WLData)1 BufferedInputStream (java.io.BufferedInputStream)1 InputStream (java.io.InputStream)1 CollectionException (org.apache.uima.collection.CollectionException)1