NKJPWypluwkaFileReader.java
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package ipipan.clarin.tei.impl.io.read;
import ipipan.clarin.tei.api.entities.AnnotationLayer;
import ipipan.clarin.tei.api.entities.TEICorpusText;
import ipipan.clarin.tei.api.entities.TEIParagraph;
import ipipan.clarin.tei.api.exceptions.TEIException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.stream.XMLStreamException;
/**
*
* @author mlenart
*/
class NKJPWypluwkaFileReader {
private final InWrapper in;
private BodyReader bodyReader;
NKJPWypluwkaFileReader(InWrapper in, AnnotationLayer layer)
throws TEIException, XMLStreamException {
this.in = in;
while (!in.isStart("body"))
in.next();
this.bodyReader = BodyReader.create(in, layer);
}
void readNextParagraph(TEIParagraph par) throws TEIException,
XMLStreamException {
bodyReader.readNextParagraph(par);
}
public void readBody(TEICorpusText text) throws TEIException {
bodyReader.readBody(text);
}
void close() {
try {
in.close();
} catch (XMLStreamException ex) {
Logger.getLogger(NKJPWypluwkaFileReader.class.getName()).log(
Level.SEVERE, null, ex);
}
}
}