5
5
6
6
from tests .base import TestCase , assets , main
7
7
8
- from ocrd import Resolver
8
+ from ocrd import Resolver , run_processor
9
9
from ocrd_utils import initLogging , pushd_popd
10
10
from ocrd_kraken .segment import KrakenSegment
11
11
@@ -18,42 +18,45 @@ def test_run_blla(self):
18
18
resolver = Resolver ()
19
19
with pushd_popd (tempdir = True ) as tempdir :
20
20
workspace = resolver .workspace_from_url (assets .path_to ('communist_manifesto/data/mets.xml' ), dst_dir = tempdir , download = True )
21
- proc = KrakenSegment (
22
- workspace ,
21
+ run_processor (
22
+ KrakenSegment ,
23
+ workspace = workspace ,
23
24
input_file_grp = "OCR-D-IMG-BIN" ,
24
25
output_file_grp = "OCR-D-SEG-LINE-KRAKEN" ,
25
26
parameter = {'maxcolseps' : 0 , 'use_legacy' : False }
26
27
)
27
- proc .process ()
28
28
workspace .save_mets ()
29
+ # FIXME: add result assertions (find_files, parsing PAGE etc)
29
30
30
31
def test_run_blla_regionlevel (self ):
31
32
resolver = Resolver ()
32
33
with pushd_popd (tempdir = True ) as tempdir :
33
34
workspace = resolver .workspace_from_url (assets .path_to ('kant_aufklaerung_1784-page-region/data/mets.xml' ), dst_dir = tempdir , download = True )
34
- proc = KrakenSegment (
35
- workspace ,
35
+ run_processor (
36
+ KrakenSegment ,
37
+ workspace = workspace ,
36
38
input_file_grp = "OCR-D-GT-SEG-REGION" ,
37
39
output_file_grp = "OCR-D-SEG-LINE-KRAKEN" ,
38
40
page_id = "phys_0005" ,
39
41
parameter = {'maxcolseps' : 0 , 'use_legacy' : False }
40
42
)
41
- proc .process ()
42
43
workspace .save_mets ()
44
+ # FIXME: add result assertions (find_files, parsing PAGE etc)
43
45
44
46
def test_run_legacy (self ):
45
47
resolver = Resolver ()
46
48
# with pushd_popd('/tmp/kraken-test') as tempdir:
47
49
with pushd_popd (tempdir = True ) as tempdir :
48
50
workspace = resolver .workspace_from_url (assets .path_to ('communist_manifesto/data/mets.xml' ), dst_dir = tempdir , download = True )
49
- proc = KrakenSegment (
50
- workspace ,
51
+ run_processor (
52
+ KrakenSegment ,
53
+ workspace = workspace ,
51
54
input_file_grp = "OCR-D-IMG-BIN" ,
52
55
output_file_grp = "OCR-D-SEG-LINE-KRAKEN" ,
53
56
parameter = {'maxcolseps' : 0 , 'use_legacy' : True }
54
57
)
55
- proc .process ()
56
58
workspace .save_mets ()
59
+ # FIXME: add result assertions (find_files, parsing PAGE etc)
57
60
58
61
if __name__ == "__main__" :
59
62
main (__file__ )
0 commit comments