blob: 80b67b53ec4599b29a3d607344593c073608480c [file] [log] [blame]
Akron797e8072020-02-13 07:59:40 +01001use strict;
2use warnings;
3use File::Basename 'dirname';
4use File::Spec::Functions qw/catfile/;
Peter Harders1c5ce152020-07-22 18:02:50 +02005use Encode qw!encode_utf8 decode_utf8 encode!;
Akron797e8072020-02-13 07:59:40 +01006
7use Test::More;
8use Test::Output;
Peter Harders42e18a62020-07-21 02:43:26 +02009
10use FindBin;
11BEGIN {
12 unshift @INC, "$FindBin::Bin/../lib";
13};
Peter Harders1c5ce152020-07-22 18:02:50 +020014
Akron044bd922020-07-30 09:12:28 +020015use Test::KorAP::XML::TEI qw!korap_tempfile i5_template test_tei2korapxml!;
Peter Harders57c884e2020-07-16 01:28:52 +020016
Akron797e8072020-02-13 07:59:40 +010017my $f = dirname(__FILE__);
18my $script = catfile($f, '..', 'script', 'tei2korapxml');
19ok(-f $script, 'Script found');
20
Akrond949e182020-02-14 12:23:57 +010021stdout_like(
Akron797e8072020-02-13 07:59:40 +010022 sub { system('perl', $script, '--help') },
Akrond949e182020-02-14 12:23:57 +010023 qr!This\s*program\s*is\s*usually\s*called\s*from\s*inside\s*another\s*script\.!,
Akron797e8072020-02-13 07:59:40 +010024 'Help'
25);
26
Akron044bd922020-07-30 09:12:28 +020027
Akrond949e182020-02-14 12:23:57 +010028stdout_like(
29 sub { system('perl', $script, '--version') },
30 qr!tei2korapxml - v\d+?\.\d+?!,
31 'Version'
32);
33
Akron2a60c532020-02-13 15:52:18 +010034# Load example file
35my $file = catfile($f, 'data', 'goe_sample.i5.xml');
Peter Harders57c884e2020-07-16 01:28:52 +020036
Akronb3649472020-09-29 08:24:46 +020037subtest 'Debugging' => sub {
38
39 my $t = test_tei2korapxml(
40 tmp => 'script_out',
41 file => $file,
42 param => '-ti',
43 env => 'KORAPXMLTEI_DEBUG=1'
Akron91577922021-02-19 10:32:54 +010044 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akronb3649472020-09-29 08:24:46 +020045 ->stderr_like(qr!Debugging is activated!);
46};
47
Akron044bd922020-07-30 09:12:28 +020048subtest 'Basic processing' => sub {
Akron2a60c532020-02-13 15:52:18 +010049
Akron044bd922020-07-30 09:12:28 +020050 my $t = test_tei2korapxml(
51 tmp => 'script_out',
52 file => $file,
53 param => '-ti'
Akron91577922021-02-19 10:32:54 +010054 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akronb3649472020-09-29 08:24:46 +020055 ->stderr_unlike(qr!Debugging is activated!);
Akron2a60c532020-02-13 15:52:18 +010056
Akron68966082020-02-13 15:52:18 +010057
Akron044bd922020-07-30 09:12:28 +020058 # Uncompress GOE/header.xml from zip file
59 $t->unzip_xml('GOE/header.xml')
Akron2a60c532020-02-13 15:52:18 +010060
Akron044bd922020-07-30 09:12:28 +020061 # TODO: check wrong encoding in header-files (compare with input document)!
62 ->text_is('korpusSigle', 'GOE', 'korpusSigle')
63 ->text_is('h\.title[type=main]', 'Goethes Werke', 'h.title')
64 ->text_is('h\.author', 'Goethe, Johann Wolfgang von', 'h.author')
65 ->text_is('pubDate[type=year]', '1982', 'pubDate');
Akron2a60c532020-02-13 15:52:18 +010066
Akron044bd922020-07-30 09:12:28 +020067 # Uncompress GOE/AGA/header.xml from zip file
68 $t->unzip_xml('GOE/AGA/header.xml')
69 ->text_is('dokumentSigle', 'GOE/AGA', 'dokumentSigle')
70 ->text_is('d\.title', 'Goethe: Autobiographische Schriften II, (1817-1825, 1832)', 'd.title')
71 ->text_is('creatDate', '1820-1822', 'creatDate');
Akron2a60c532020-02-13 15:52:18 +010072
Akron044bd922020-07-30 09:12:28 +020073 # Uncompress GOE/AGA/00000/header.xml from zip file
74 $t->unzip_xml('GOE/AGA/00000/header.xml')
75 ->text_is('textSigle', 'GOE/AGA.00000', 'textSigle')
76 ->text_is('analytic > h\.title[type=main]', 'Campagne in Frankreich', 'h.title');
Akron2a60c532020-02-13 15:52:18 +010077
78# Uncompress GOE/AGA/00000/data.xml from zip file
Akron044bd922020-07-30 09:12:28 +020079 $t->unzip_xml('GOE/AGA/00000/data.xml')
80 ->attr_is('raw_text', 'docid', 'GOE_AGA.00000', 'text id')
Marc Kupietzfd0e6a92020-09-09 18:07:29 +020081 ->text_like('raw_text > text', qr!^Campagne in Frankreich 1792.*?uns allein begl.*cke\.$!, 'text content')
82 ->text_like('raw_text > text', qr!unter dem Titel "Kriegstheater"!, 'text content');
Akron2a60c532020-02-13 15:52:18 +010083
Akron417ed2f2020-09-28 12:43:17 +020084 my $content = $t->get_content_of('GOE/AGA/00000/data.xml');
85 like($content, qr!unter dem Titel "Kriegstheater"!, 'raw text content');
86
Akron044bd922020-07-30 09:12:28 +020087 $t->unzip_xml('GOE/AGA/00000/struct/structure.xml')
Akronc57625b2020-07-30 11:46:06 +020088 ->text_is('span[id=s3] *[name=type]', 'Autobiographie', 'text content')
89 ->text_is('#s3 *[name=type]', 'Autobiographie', 'text content')
90 ->attr_is('#s0','to','1266')
91 ->attr_is('#s0','l','1')
92
93 ->attr_is('#s18','from','925')
94 ->attr_is('#s18','to','1266')
95 ->attr_is('#s18','l','5')
96 ->attr_is('#s18 > fs','type', 'struct')
97 ->attr_is('#s18 > fs > f','name','name')
98 ->text_is('#s18 > fs > f','poem')
99
100 ->attr_is('#s19','from','925')
101 ->attr_is('#s19','to','1098')
102 ->attr_is('#s19','l','6')
103 ->attr_is('#s19 > fs','type','struct')
104 ->text_is('#s19 > fs > f[name=name]','lg')
105 ->text_is('#s19 > fs > f[name=attr] > fs[type=attr] >f[name=part]','u')
106
107 ->attr_is('#s37','from','1229')
108 ->attr_is('#s37','to','1266')
109 ->attr_is('#s37','l','8')
110 ->attr_is('#s37 > fs','type','struct')
111 ->text_is('#s37 > fs > f[name=name]','s')
112 ->text_is('#s37 > fs > f[name=attr] > fs[type=attr] > f[name=type]','manual')
113
114 ->attr_is('#s38','from','1266')
115 ->attr_is('#s38','to','1266')
116 ->attr_is('#s38','l','2')
117 ->attr_is('#s38 > fs','type','struct')
118 ->text_is('#s38 > fs > f[name=name]','back')
Akronf7084c42021-01-07 10:25:22 +0100119 ->element_count_is('*', 196);
Akron2a60c532020-02-13 15:52:18 +0100120
Akron044bd922020-07-30 09:12:28 +0200121 $t->file_exists_not('GOE/AGA/00000/base/tokens.xml', 'External not generated');
Akron2a60c532020-02-13 15:52:18 +0100122
Akron044bd922020-07-30 09:12:28 +0200123 # Uncompress GOE/AGA/00000/base/tokens_aggressive.xml from zip file
124 $t->unzip_xml('GOE/AGA/00000/base/tokens_aggressive.xml')
125 ->attr_is('spanList span:nth-child(1)', 'to', 8)
126 ->attr_is('spanList span#t_1', 'from', 9)
127 ->attr_is('spanList span#t_1', 'to', 11)
Akron2a60c532020-02-13 15:52:18 +0100128
Akron044bd922020-07-30 09:12:28 +0200129 ->attr_is('spanList span#t_67', 'from', 427)
130 ->attr_is('spanList span#t_67', 'to', 430)
Akron2a60c532020-02-13 15:52:18 +0100131
Akron044bd922020-07-30 09:12:28 +0200132 ->attr_is('spanList span#t_214', 'from', 1209)
133 ->attr_is('spanList span#t_214', 'to', 1212)
Akron2a60c532020-02-13 15:52:18 +0100134
Akron044bd922020-07-30 09:12:28 +0200135 ->element_count_is('spanList span', 227);
Peter Harders57c884e2020-07-16 01:28:52 +0200136
Akron044bd922020-07-30 09:12:28 +0200137 # Uncompress GOE/AGA/00000/base/tokens_conservative.xml from zip file
138 $t->unzip_xml('GOE/AGA/00000/base/tokens_conservative.xml')
139 ->attr_is('spanList span:nth-child(1)', 'to', 8)
Akron2a60c532020-02-13 15:52:18 +0100140
Akron044bd922020-07-30 09:12:28 +0200141 ->attr_is('spanList span#t_1', 'from', 9)
142 ->attr_is('spanList span#t_1', 'to', 11)
Akron797e8072020-02-13 07:59:40 +0100143
Akron044bd922020-07-30 09:12:28 +0200144 ->attr_is('spanList span#t_67', 'from', 427)
145 ->attr_is('spanList span#t_67', 'to', 430)
Akroneac374d2020-07-07 09:00:44 +0200146
Akron044bd922020-07-30 09:12:28 +0200147 ->attr_is('spanList span#t_214', 'from', 1209)
148 ->attr_is('spanList span#t_214', 'to', 1212)
Akroneac374d2020-07-07 09:00:44 +0200149
Akron044bd922020-07-30 09:12:28 +0200150 ->element_count_is('spanList span', 227);
151};
Akroneac374d2020-07-07 09:00:44 +0200152
Akroneac374d2020-07-07 09:00:44 +0200153
Akron044bd922020-07-30 09:12:28 +0200154subtest 'Tokenize with external tokenizer' => sub {
Akroneac374d2020-07-07 09:00:44 +0200155
Akron044bd922020-07-30 09:12:28 +0200156 my $cmd = catfile($f, 'cmd', 'tokenizer.pl');
Akroneac374d2020-07-07 09:00:44 +0200157
Akron044bd922020-07-30 09:12:28 +0200158 test_tei2korapxml(
159 file => $file,
160 param => "-tc='perl $cmd'",
161 tmp => 'script_out2'
162 )
Akron91577922021-02-19 10:32:54 +0100163 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron044bd922020-07-30 09:12:28 +0200164 ->file_readable('GOE/AGA/00000/base/tokens.xml')
Akroneac374d2020-07-07 09:00:44 +0200165
Akron044bd922020-07-30 09:12:28 +0200166 # Uncompress GOE/AGA/00000/base/tokens.xml from zip file
167 ->unzip_xml('GOE/AGA/00000/base/tokens.xml')
168 ->attr_is('spanList span:nth-child(1)', 'to', 8)
169 ->attr_is('spanList span#t_1', 'from', 9)
170 ->attr_is('spanList span#t_1', 'to', 11)
171 ->attr_is('spanList span#t_67', 'from', 427)
172 ->attr_is('spanList span#t_67', 'to', 430)
173 ->attr_is('spanList span#t_214', 'from', 1209)
174 ->attr_is('spanList span#t_214', 'to', 1212)
175 ->element_count_is('spanList span', 227);
176};
Akroneac374d2020-07-07 09:00:44 +0200177
Akron91705d72021-02-19 10:59:45 +0100178subtest 'Tokenize with external tokenizer and defined folder' => sub {
179
180 my $cmd = catfile($f, 'cmd', 'tokenizer.pl');
181
182 test_tei2korapxml(
183 file => $file,
184 param => "-tc='perl $cmd' --tokens-file=yadda",
185 tmp => 'script_out2'
186 )
187 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
188 ->file_exists_not('GOE/AGA/00000/base/tokens.xml')
189 ->file_readable('GOE/AGA/00000/base/yadda.xml')
190 ->unzip_xml('GOE/AGA/00000/base/yadda.xml')
191 ->attr_is('spanList span:nth-child(1)', 'to', 8)
192 ->attr_is('spanList span#t_1', 'from', 9)
193 ->attr_is('spanList span#t_1', 'to', 11)
194 ->attr_is('spanList span#t_67', 'from', 427)
195 ->attr_is('spanList span#t_67', 'to', 430)
196 ->attr_is('spanList span#t_214', 'from', 1209)
197 ->attr_is('spanList span#t_214', 'to', 1212)
198 ->element_count_is('spanList span', 227);
199};
200
Marc Kupietzeed4cb12021-02-17 19:39:32 +0100201subtest 'Check KorAP tokenizer for infinite loop bug' => sub {
202
203 my $file = catfile($f, 'data', 'korap_tokenizer_challenge.xml');
204
205 eval {
206 require KorAP::XML::TEI::Tokenizer::KorAP;
207 1;
208 } or do {
209 plan skip_all => "KorAP::XML::TEI::Tokenizer::KorAP cannot be used";
210 };
211
212 test_tei2korapxml(
213 file => $file,
214 param => "-tk -s",
215 tmp => 'script_bug_check'
216 )
Akron91577922021-02-19 10:32:54 +0100217 ->stderr_like(qr!tei2korapxml:.*? text_id=WDD19_H0039\.87242!)
Marc Kupietzeed4cb12021-02-17 19:39:32 +0100218 ->file_readable('WDD19/H0039/87242/struct/structure.xml');
219};
220
Marc Kupietz985da0c2021-02-15 19:29:50 +0100221subtest 'Sentence split with KorAP tokenizer' => sub {
222
223 eval {
224 require KorAP::XML::TEI::Tokenizer::KorAP;
225 1;
226 } or do {
227 plan skip_all => "KorAP::XML::TEI::Tokenizer::KorAP cannot be used";
228 };
229
230 test_tei2korapxml(
231 file => $file,
232 param => "-tk -s",
233 tmp => 'script_sentence_split'
234 )
Akron91577922021-02-19 10:32:54 +0100235 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Marc Kupietz985da0c2021-02-15 19:29:50 +0100236 ->file_readable('GOE/AGA/00000/struct/structure.xml')
237 ->unzip_xml('GOE/AGA/00000/struct/structure.xml')
238 ->text_is('span#s25 fs f', 's')
239 ->attr_is('span#s25', 'l', -1)
240 ->attr_is('span#s25', 'to', 54)
241 ->text_is('span#s30 fs f', 's')
242 ->attr_is('span#s30', 'l', -1)
243 ->attr_is('span#s30', 'from', 1099)
244 ->attr_is('span#s30', 'to', 1266);
245};
Akroneac374d2020-07-07 09:00:44 +0200246
Akron044bd922020-07-30 09:12:28 +0200247subtest 'Test Tokenizations' => sub {
Akroneac374d2020-07-07 09:00:44 +0200248
Akron044bd922020-07-30 09:12:28 +0200249 my $t = test_tei2korapxml(
250 file => catfile($f, 'data', 'text_with_blanks.i5.xml'),
251 tmp => 'script_out3',
252 param => '-ti'
Akron91577922021-02-19 10:32:54 +0100253 )->stderr_like(qr!tei2korapxml:.*? text_id=CORP_DOC.00001!);
Akron8b511f92020-07-09 17:28:08 +0200254
Akron044bd922020-07-30 09:12:28 +0200255 # ~ test conservative tokenization ~
256 $t->unzip_xml('CORP/DOC/00001/base/tokens_conservative.xml')
257 ->attr_is('spanList span:nth-child(1)', 'to', 6)
Akron8b511f92020-07-09 17:28:08 +0200258
Akron044bd922020-07-30 09:12:28 +0200259 ->attr_is('spanList span#t_1', 'from', 7)
260 ->attr_is('spanList span#t_1', 'to', 9)
Akron8b511f92020-07-09 17:28:08 +0200261
Akron044bd922020-07-30 09:12:28 +0200262 ->attr_is('spanList span#t_3', 'from', 12)
263 ->attr_is('spanList span#t_3', 'to', 16)
Akron8b511f92020-07-09 17:28:08 +0200264
Akron044bd922020-07-30 09:12:28 +0200265 ->attr_is('spanList span#t_9', 'from', 36)
266 ->attr_is('spanList span#t_9', 'to', 37)
Akron8b511f92020-07-09 17:28:08 +0200267
Akron044bd922020-07-30 09:12:28 +0200268 ->attr_is('spanList span#t_13', 'from', 44)
269 ->attr_is('spanList span#t_13', 'to', 45) # "
Akron8b511f92020-07-09 17:28:08 +0200270
Akron044bd922020-07-30 09:12:28 +0200271 ->attr_is('spanList span#t_14', 'from', 45) # twenty-two
272 ->attr_is('spanList span#t_14', 'to', 55)
Peter Harders42e18a62020-07-21 02:43:26 +0200273
Akron044bd922020-07-30 09:12:28 +0200274 ->attr_is('spanList span#t_15', 'from', 55) # "
275 ->attr_is('spanList span#t_15', 'to', 56)
Akron8b511f92020-07-09 17:28:08 +0200276
Akron044bd922020-07-30 09:12:28 +0200277 ->attr_is('spanList span#t_19', 'from', 66)
278 ->attr_is('spanList span#t_19', 'to', 67)
Peter Hardersb1227172020-07-21 02:12:10 +0200279
Akron044bd922020-07-30 09:12:28 +0200280 ->element_count_is('spanList span', 20);
Peter Harders71f072b2020-07-15 14:15:01 +0200281
Peter Harders71f072b2020-07-15 14:15:01 +0200282
Akron044bd922020-07-30 09:12:28 +0200283 # ~ test aggressive tokenization ~
284 $t->unzip_xml('CORP/DOC/00001/base/tokens_aggressive.xml')
285 ->attr_is('spanList span:nth-child(1)', 'to', 6)
Peter Harders71f072b2020-07-15 14:15:01 +0200286
Akron044bd922020-07-30 09:12:28 +0200287 ->attr_is('spanList span#t_1', 'from', 7)
288 ->attr_is('spanList span#t_1', 'to', 9)
Peter Harders71f072b2020-07-15 14:15:01 +0200289
Akron044bd922020-07-30 09:12:28 +0200290 ->attr_is('spanList span#t_3', 'from', 12)
291 ->attr_is('spanList span#t_3', 'to', 16)
Peter Harders71f072b2020-07-15 14:15:01 +0200292
Akron044bd922020-07-30 09:12:28 +0200293 ->attr_is('spanList span#t_9', 'from', 36)
294 ->attr_is('spanList span#t_9', 'to', 37)
Peter Harders71f072b2020-07-15 14:15:01 +0200295
Akron044bd922020-07-30 09:12:28 +0200296 ->attr_is('spanList span#t_13', 'from', 44)
297 ->attr_is('spanList span#t_13', 'to', 45) # "
Peter Harders71f072b2020-07-15 14:15:01 +0200298
Akron044bd922020-07-30 09:12:28 +0200299 ->attr_is('spanList span#t_14', 'from', 45) # twenty
300 ->attr_is('spanList span#t_14', 'to', 51)
Peter Harders71f072b2020-07-15 14:15:01 +0200301
Akron044bd922020-07-30 09:12:28 +0200302 ->attr_is('spanList span#t_15', 'from', 51) # -
303 ->attr_is('spanList span#t_15', 'to', 52)
Peter Harders71f072b2020-07-15 14:15:01 +0200304
Akron044bd922020-07-30 09:12:28 +0200305 ->attr_is('spanList span#t_16', 'from', 52) # two
306 ->attr_is('spanList span#t_16', 'to', 55)
Peter Harders71f072b2020-07-15 14:15:01 +0200307
Akron044bd922020-07-30 09:12:28 +0200308 ->attr_is('spanList span#t_17', 'from', 55) # "
309 ->attr_is('spanList span#t_17', 'to', 56)
Peter Harders71f072b2020-07-15 14:15:01 +0200310
Akron044bd922020-07-30 09:12:28 +0200311 ->attr_is('spanList span#t_21', 'from', 66)
312 ->attr_is('spanList span#t_21', 'to', 67)
Peter Harders71f072b2020-07-15 14:15:01 +0200313
Akron044bd922020-07-30 09:12:28 +0200314 ->element_count_is('spanList span', 22);
315};
Peter Harders71f072b2020-07-15 14:15:01 +0200316
317
Peter Harders42e18a62020-07-21 02:43:26 +0200318subtest 'Check Tokenization Flags' => sub {
319
320 # Get external tokenizer
321 my $f = dirname(__FILE__);
322 my $cmd = catfile($f, 'cmd', 'tokenizer.pl');
323
324 # Load example file
Akron044bd922020-07-30 09:12:28 +0200325 test_tei2korapxml(
326 file => catfile($f, 'data', 'goe_sample.i5.xml'),
327 param => "-ti -tc 'perl $cmd'",
328 tmp => 'script_tokflags'
329 )
Akron91577922021-02-19 10:32:54 +0100330 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron044bd922020-07-30 09:12:28 +0200331 ->file_exists('GOE/AGA/00000/base/tokens_aggressive.xml')
332 ->file_exists('GOE/AGA/00000/base/tokens_conservative.xml')
333 ->file_exists('GOE/AGA/00000/base/tokens.xml')
334 ;
Peter Harders42e18a62020-07-21 02:43:26 +0200335};
336
Peter Harders1c5ce152020-07-22 18:02:50 +0200337
338subtest 'Test utf-8 handling' => sub {
Peter Harders1c5ce152020-07-22 18:02:50 +0200339 # Introduce invalid utf-8 characters
340 my $text_sigle;
Akron54e363c2020-07-29 11:01:03 +0200341 {
342 no warnings;
343 # $text_sigle printed to file, without encoding: Aþƒ¿¿¿¿¿A_Bþƒ¿¿¿¿¿B.Cþƒ¿¿¿¿¿C
344 # the utf8-sequence 'þƒ¿¿¿¿¿' encodes 32 bit of data (see 0x7FFF_FFFF in perlunicode)
345 $text_sigle = "A\x{FFFF_FFFF}A_B\x{FFFF_FFFF}B.C\x{FFFF_FFFF}C"
346 }
347 # If CHECK is 0, encoding and decoding replace any malformed character
348 # with a substitution character.
Peter Harders1c5ce152020-07-22 18:02:50 +0200349 # � = substitution character
350 my $text_sigle_lax = encode_utf8($text_sigle);
351 my $text_sigle_esc = encode('UTF-8', $text_sigle);
352
353 is(length($text_sigle), 11); # A�A_B�B.C�C (char string => length(�) = 1)
354 is(length($text_sigle_lax), 29); # Aþƒ¿¿¿¿¿A_Bþƒ¿¿¿¿¿B.Cþƒ¿¿¿¿¿C (byte string)
355 is(length($text_sigle_esc), 17); # A�A_B�B.C�C (byte string => length(�) = 3)
356
Akron54e363c2020-07-29 11:01:03 +0200357
358 my $tpl;
359 {
360 no warnings;
361 $tpl = i5_template(
362 korpusSigle => "A\x{FFFF_FFFF}A",
363 dokumentSigle => "A\x{FFFF_FFFF}A_B\x{FFFF_FFFF}B",
364 text => "<p>d\x{FFFF_FFFF}d e\x{FFFF_FFFF}e f\x{FFFF_FFFF}f</p>",
365 textSigle => $text_sigle
366 );
367 };
Peter Harders1c5ce152020-07-22 18:02:50 +0200368
369 my ($fh, $tplfile) = korap_tempfile('script_out4');
370 binmode($fh);
371 print $fh encode_utf8($tpl); # => text_id=Aþƒ¿¿¿¿¿A_Bþƒ¿¿¿¿¿B.Cþƒ¿¿¿¿¿C
372 close($fh);
373
374 my (undef, $outzip) = korap_tempfile('script_out5');
375
Akron54e363c2020-07-29 11:01:03 +0200376 # because output 'textid=...' goes to STDERR (see script/tei2korapxml)
Akroneaa96232020-10-15 17:06:15 +0200377 binmode STDERR;
Peter Harders1c5ce152020-07-22 18:02:50 +0200378
379 stderr_like(
Akrona2cb2812021-10-30 10:29:08 +0200380 sub { `cat '$tplfile' | perl '$script' -ti - > '$outzip'` },
Akron91577922021-02-19 10:32:54 +0100381 qr!tei2korapxml:.*? text_id=$text_sigle_esc!, # see above: print $fh encode_utf8($tpl);
Peter Harders1c5ce152020-07-22 18:02:50 +0200382 );
383};
384
Akrone68ec0c2020-07-28 18:06:19 +0200385
Akrondd0be8f2021-02-18 19:29:41 +0100386subtest 'Check structure parsing with defined foundry and folder' => sub {
387 # Load example file
388 my $file = catfile($f, 'data', 'goe_sample.i5.xml');
389
390 my $t = test_tei2korapxml(
391 tmp => 'script_out',
392 file => $file,
393 param => '-ti --inline-structures=myfoundry#mystr'
Akron91705d72021-02-19 10:59:45 +0100394 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akrondd0be8f2021-02-18 19:29:41 +0100395 ->file_exists_not('GOE/AGA/00000/struct/structure.xml', 'Structure not generated')
396 ->unzip_xml('GOE/AGA/00000/myfoundry/mystr.xml')
397 ->text_is('span[id=s3] *[name=type]', 'Autobiographie', 'text content')
398 ->text_is('#s3 *[name=type]', 'Autobiographie', 'text content')
399 ->attr_is('#s0','to','1266')
400 ->attr_is('#s0','l','1')
401 ->attr_is('#s18','from','925')
402 ->attr_is('#s18','to','1266')
403 ->attr_is('#s18','l','5')
404 ;
405
406 $t = test_tei2korapxml(
407 tmp => 'script_out',
408 file => $file,
409 param => '-ti --inline-structures=myfoundry'
Akron91705d72021-02-19 10:59:45 +0100410 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akrondd0be8f2021-02-18 19:29:41 +0100411 ->file_exists_not('GOE/AGA/00000/struct/structure.xml', 'Structure not generated')
412 ->unzip_xml('GOE/AGA/00000/myfoundry/structure.xml')
413 ->text_is('span[id=s3] *[name=type]', 'Autobiographie', 'text content')
414 ->text_is('#s3 *[name=type]', 'Autobiographie', 'text content')
415 ->attr_is('#s0','to','1266')
416 ->attr_is('#s0','l','1')
417 ->attr_is('#s18','from','925')
418 ->attr_is('#s18','to','1266')
419 ->attr_is('#s18','l','5')
420 ;
421};
422
Akron54c3ff12021-02-25 11:33:37 +0100423subtest 'Check structure parsing with skipped tags' => sub {
424 # Load example file
425 my $file = catfile($f, 'data', 'goe_sample.i5.xml');
426
427 my $t = test_tei2korapxml(
428 tmp => 'script_out',
429 file => $file,
430 param => '-ti'
431 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
432 ->file_exists('GOE/AGA/00000/struct/structure.xml', 'Structure generated')
433 ->unzip_xml('GOE/AGA/00000/struct/structure.xml')
434 ->text_is('layer spanList span fs f', 'text')
435 ->text_is('#s5 fs f[name=name]','head')
436 ->text_is('#s6 fs f[name=name]','s')
437 ->text_is('#s7 fs f[name=name]','head')
438 ->text_is('#s8 fs f[name=name]','s')
439 ->text_is('#s9 fs f[name=name]','quote')
440 ->text_is('#s10 fs f[name=name]','s')
441 ;
442
443 $t = test_tei2korapxml(
444 tmp => 'script_out',
445 file => $file,
446 param => '-ti --skip-inline-tags=head'
447 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
448 ->file_exists('GOE/AGA/00000/struct/structure.xml', 'Structure generated')
449 ->unzip_xml('GOE/AGA/00000/struct/structure.xml')
450 ->text_is('layer spanList span fs f', 'text')
451 ->text_is('#s5 fs f[name=name]','s')
452 ->text_is('#s6 fs f[name=name]','s')
453 ->text_is('#s7 fs f[name=name]','quote')
454 ->text_is('#s8 fs f[name=name]','s')
455 ;
456
457 $t = test_tei2korapxml(
458 tmp => 'script_out',
459 file => $file,
460 param => '-ti --skip-inline-tags=head,quote'
461 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
462 ->file_exists('GOE/AGA/00000/struct/structure.xml', 'Structure generated')
463 ->unzip_xml('GOE/AGA/00000/struct/structure.xml')
464 ->text_is('layer spanList span fs f', 'text')
465 ->text_is('#s5 fs f[name=name]','s')
466 ->text_is('#s6 fs f[name=name]','s')
467 ->text_is('#s7 fs f[name=name]','s')
468 ;
469};
470
Akrondd0be8f2021-02-18 19:29:41 +0100471
Akron75d63142021-02-23 18:40:56 +0100472subtest 'Check parsing but skip inline tokens' => sub {
473 # Load example file
474 my $file = catfile($f, 'data', 'goe_sample.i5.xml');
475
476 my $t = test_tei2korapxml(
477 tmp => 'script_skip_inline_tokens_1',
478 file => $file,
479 param => '-ti --skip-inline-tokens'
480 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
481 ->file_exists('GOE/AGA/00000/data.xml', 'Data exists')
482 ->file_exists('GOE/AGA/00000/struct/structure.xml', 'Structure generated')
483 ->file_exists_not('GOE/AGA/00000/tokens/morpho.xml', 'Morpho not generated')
484 ;
485
486 $t = test_tei2korapxml(
487 tmp => 'script_skip_inline_tokens_2',
488 file => $file,
489 param => '-ti --skip-inline-tokens --inline-tokens=myfoundry#myfile'
490 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
491 ->file_exists('GOE/AGA/00000/struct/structure.xml', 'Structure generated')
492 ->file_exists_not('GOE/AGA/00000/tokens/morpho.xml', 'Morpho not generated')
493 ->file_exists_not('GOE/AGA/00000/myfoundry/myfile.xml', 'Morpho not generated')
494 ;
495};
496
497
Akrone68ec0c2020-07-28 18:06:19 +0200498subtest 'Check Inline annotations' => sub {
499
500 # Load example file
501 my $file = catfile($f, 'data', 'goe_sample_tagged.i5.xml');
502
Akron044bd922020-07-30 09:12:28 +0200503 my $t = test_tei2korapxml(
504 file => $file,
505 env => 'KORAPXMLTEI_INLINE=1',
Akronb93fabb2023-01-13 12:05:44 +0100506 tmp => 'script_tagged',
507 param => '--no-tokenizer'
Akron044bd922020-07-30 09:12:28 +0200508 )
Akron91577922021-02-19 10:32:54 +0100509 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron692d17d2021-03-05 13:21:03 +0100510 ->stderr_like(qr!KORAPXMLTEI_INLINE is deprecated!)
Akrone68ec0c2020-07-28 18:06:19 +0200511
Akron044bd922020-07-30 09:12:28 +0200512 # Check zip using xml loy
513 ->unzip_xml('GOE/AGA/00000/tokens/morpho.xml')
Akrone68ec0c2020-07-28 18:06:19 +0200514
Akron044bd922020-07-30 09:12:28 +0200515 ->attr_is('layer', 'docid', 'GOE_AGA.00000')
Akrone68ec0c2020-07-28 18:06:19 +0200516 ->attr_is('spanList span:nth-child(1)', 'id', 's0')
517 ->attr_is('spanList span:nth-child(1)', 'from', '75')
518 ->attr_is('spanList span:nth-child(1)', 'to', '81')
519 ->attr_is('spanList span:nth-child(1)', 'l', '7')
520
521 ->attr_is('span#s0 > fs', 'type', 'lex')
522 ->attr_is('span#s0 > fs', 'xmlns', 'http://www.tei-c.org/ns/1.0')
523 ->attr_is('span#s0 > fs > f > fs > f:nth-child(1)', 'name', 'pos')
524 ->text_is('span#s0 > fs > f > fs > f:nth-child(1)', 'A')
525 ->attr_is('span#s0 > fs > f > fs > f:nth-child(2)', 'name', 'msd')
526 ->text_is('span#s0 > fs > f > fs > f:nth-child(2)', '@NH')
527
528 ->attr_is('span#s25', 'from', '259')
529 ->attr_is('span#s25', 'to', '263')
530 ->attr_is('span#s25', 'l', '7')
531 ->attr_is('span#s25 > fs > f > fs > f:nth-child(1)', 'name', 'pos')
532 ->text_is('span#s25 > fs > f > fs > f:nth-child(1)', 'PRON')
533 ->attr_is('span#s25 > fs > f > fs > f:nth-child(2)', 'name', 'msd')
534 ->text_is('span#s25 > fs > f > fs > f:nth-child(2)', '@NH')
535
536 ->attr_is('span#s58', 'from', '495')
537 ->attr_is('span#s58', 'to', '500')
538 ->attr_is('span#s58', 'l', '7')
539 ->attr_is('span#s58 > fs > f > fs > f:nth-child(1)', 'name', 'pos')
540 ->text_is('span#s58 > fs > f > fs > f:nth-child(1)', 'N')
541 ->attr_is('span#s58 > fs > f > fs > f:nth-child(2)', 'name', 'msd')
542 ->text_is('span#s58 > fs > f > fs > f:nth-child(2)', '@NH')
543
544 ->attr_is('span#s119', 'from', '914')
545 ->attr_is('span#s119', 'to', '925')
546 ->attr_is('span#s119', 'l', '7')
547 ->attr_is('span#s119 > fs > f > fs > f:nth-child(1)', 'name', 'pos')
548 ->text_is('span#s119 > fs > f > fs > f:nth-child(1)', 'A')
549 ->attr_is('span#s119 > fs > f > fs > f:nth-child(2)', 'name', 'msd')
550 ->text_is('span#s119 > fs > f > fs > f:nth-child(2)', '@NH')
551 ->element_exists_not('span#s120')
552 ;
553};
554
Akron26a71522021-02-19 10:27:37 +0100555
556subtest 'Check file structure with defined folder and filenames' => sub {
557 # Load example file
558 my $file = catfile($f, 'data', 'goe_sample.i5.xml');
559 my $t = test_tei2korapxml(
560 tmp => 'script_out',
561 file => $file,
562 param => '-ti --base-foundry=root --data-file=primary --header-file=meta'
Akron91705d72021-02-19 10:59:45 +0100563 )->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron26a71522021-02-19 10:27:37 +0100564 ->file_exists_not('GOE/AGA/00000/header.xml', 'Header not there')
565 ->file_exists_not('GOE/AGA/header.xml', 'Header not there')
566 ->file_exists_not('GOE/header.xml', 'Header not there')
567 ->file_exists_not('GOE/AGA/00000/data.xml', 'Data not there')
568 ->file_exists_not('GOE/AGA/00000/base/tokens_conservative.xml', 'Tokens not there')
569 ->file_exists_not('GOE/AGA/00000/base/tokens_aggressive.xml', 'Tokens not there')
570 ->file_exists('GOE/AGA/00000/meta.xml', 'Header there')
571 ->file_exists('GOE/AGA/meta.xml', 'Header there')
572 ->file_exists('GOE/meta.xml', 'Header there')
573 ->file_exists('GOE/AGA/00000/primary.xml', 'Data there')
574 ->file_exists('GOE/AGA/00000/root/tokens_conservative.xml', 'Tokens there')
575 ->file_exists('GOE/AGA/00000/root/tokens_aggressive.xml', 'Tokens there')
576 ;
577
578 $t->unzip_xml('GOE/AGA/00000/primary.xml')
579 ->content_like(qr/\Q&quot;Kriegstheater&quot;\E/)
580 ;
581};
582
Akron1a5271a2021-02-18 13:18:15 +0100583subtest 'Check Inline annotations with defined foundry and folder' => sub {
584 # Load example file
585 my $file = catfile($f, 'data', 'goe_sample_tagged.i5.xml');
586
587 my $t = test_tei2korapxml(
588 file => $file,
Akron1a5271a2021-02-18 13:18:15 +0100589 tmp => 'script_tagged',
Akronb93fabb2023-01-13 12:05:44 +0100590 param => '--inline-tokens=myfoundry#myfile --skip-inline-token-annotations=0 --no-tokenizer'
Akron1a5271a2021-02-18 13:18:15 +0100591 )
Akron91577922021-02-19 10:32:54 +0100592 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron692d17d2021-03-05 13:21:03 +0100593 ->stderr_unlike(qr!KORAPXMLTEI_INLINE is deprecated!)
Akron1a5271a2021-02-18 13:18:15 +0100594
595 ->file_exists_not('GOE/AGA/00000/tokens/morpho.xml', 'Morpho not generated')
596
597 # Check zip using xml loy
598 ->unzip_xml('GOE/AGA/00000/myfoundry/myfile.xml')
599
600 ->attr_is('layer', 'docid', 'GOE_AGA.00000')
601 ->attr_is('spanList span:nth-child(1)', 'id', 's0')
602 ->attr_is('spanList span:nth-child(1)', 'from', '75')
603 ->attr_is('spanList span:nth-child(1)', 'to', '81')
604 ->attr_is('spanList span:nth-child(1)', 'l', '7')
605 ;
606
607 $t = test_tei2korapxml(
608 file => $file,
Akron1a5271a2021-02-18 13:18:15 +0100609 tmp => 'script_tagged',
Akronb93fabb2023-01-13 12:05:44 +0100610 param => '--inline-tokens=myfoundry --skip-inline-token-annotations=0 --no-tokenizer'
Akron1a5271a2021-02-18 13:18:15 +0100611 )
Akron91577922021-02-19 10:32:54 +0100612 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akron1a5271a2021-02-18 13:18:15 +0100613
614 ->file_exists_not('GOE/AGA/00000/tokens/morpho.xml', 'Morpho not generated')
615
616 # Check zip using xml loy
617 ->unzip_xml('GOE/AGA/00000/myfoundry/morpho.xml')
618
619 ->attr_is('layer', 'docid', 'GOE_AGA.00000')
620 ->attr_is('spanList span:nth-child(1)', 'id', 's0')
621 ->attr_is('spanList span:nth-child(1)', 'from', '75')
622 ->attr_is('spanList span:nth-child(1)', 'to', '81')
623 ->attr_is('spanList span:nth-child(1)', 'l', '7')
624 ;
625};
626
Akron09e0b2c2020-07-28 15:57:01 +0200627subtest 'Check Inline annotations with untagged file' => sub {
628
629 # Load example file
630 my $file = catfile($f, 'data', 'goe_sample.i5.xml');
631
632 my ($fh, $outzip) = korap_tempfile('script_untagged');
633
634 # Generate zip file (unportable!)
635 stderr_like(
Akronb93fabb2023-01-13 12:05:44 +0100636 sub { `cat '$file' | perl '$script' --skip-token-inline-annotations=0 --no-tokenizer - > '$outzip'` },
Akron91577922021-02-19 10:32:54 +0100637 qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!,
Akron09e0b2c2020-07-28 15:57:01 +0200638 'Processing 1'
639 );
640
641 # TODO: there should be a better way to test this
642 stderr_unlike(
Akronb93fabb2023-01-13 12:05:44 +0100643 sub { `cat '$file' | perl '$script' --skip-token-inline-annotations=0 --no-tokenizer - > '$outzip'` },
Akron09e0b2c2020-07-28 15:57:01 +0200644 qr!.*undefined value.*!,
645 'Processing 2'
646 );
647 #
648
649 ok(-e $outzip, "File $outzip exists");
650
651 my $zip = IO::Uncompress::Unzip->new(
652 $outzip,
653 Name => 'GOE/AGA/00000/tokens/morpho.xml'
654 );
655 ok((not $zip), 'missing morpho.xml');
656
657 $zip = IO::Uncompress::Unzip->new(
658 $outzip,
659 Name => 'GOE/AGA/00000/struct/structure.xml'
660 );
661 ok($zip, 'found structure.xml');
662};
Akrone68ec0c2020-07-28 18:06:19 +0200663
Akron3378dfd2020-08-01 15:01:36 +0200664
Akroneaa96232020-10-15 17:06:15 +0200665subtest 'Check input encoding' => sub {
666
667 # Load example file
668 test_tei2korapxml(
669 file => catfile($f, 'data', 'goe_sample.i5.xml'),
Akron692d17d2021-03-05 13:21:03 +0100670 tmp => 'script_utf8_enc',
Akronb93fabb2023-01-13 12:05:44 +0100671 param => '--skip-inline-token-annotations=0 --no-tokenizer',
Akroneaa96232020-10-15 17:06:15 +0200672 )
Akron91577922021-02-19 10:32:54 +0100673 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akroneaa96232020-10-15 17:06:15 +0200674 ->unzip_xml('GOE/AGA/00000/data.xml')
675 ->content_like(qr/\Q&quot;Kriegstheater&quot;\E/)
676 ->content_like(qr/\QTür&#39;\E/)
677 ;
678
679 test_tei2korapxml(
680 file => catfile($f, 'data', 'goe_sample.i5.iso.xml'),
Akronb93fabb2023-01-13 12:05:44 +0100681 param => '--skip-inline-token-annotations=0 --no-tokenizer',
Akroneaa96232020-10-15 17:06:15 +0200682 tmp => 'script_iso_enc'
683 )
Akron91577922021-02-19 10:32:54 +0100684 ->stderr_like(qr!tei2korapxml:.*? text_id=GOE_AGA\.00000!)
Akroneaa96232020-10-15 17:06:15 +0200685 ->unzip_xml('GOE/AGA/00000/data.xml')
686 ->content_like(qr/\Q&quot;Kriegstheater&quot;\E/)
687 ->content_like(qr/\QTür&#39;\E/)
688 ;
689};
690
Marc Kupietz44b1f252020-11-26 16:31:40 +0100691subtest 'Check encoding with utf-8 sigle' => sub {
692
693 # Load example file
694 my $file = catfile($f, 'data', 'wdd_sample.i5.xml');
695
696 my $t = test_tei2korapxml(
697 tmp => 'script_sigle',
698 file => $file,
699 param => "-ti"
Akron91577922021-02-19 10:32:54 +0100700 )->stderr_like(qr!tei2korapxml:.*? text_id=WDD19_ß0000\.10317!)
Marc Kupietz44b1f252020-11-26 16:31:40 +0100701 ->stderr_unlike(qr!Debugging is activated!);
702
703 $t->unzip_xml('WDD19/ß0000/10317/header.xml')
704 ->text_is('idsHeader fileDesc titleStmt textSigle', 'WDD19/ß0000.10317');
705
706 $t->unzip_xml('WDD19/ß0000/10317/data.xml')
707 ->attr_is('raw_text', 'docid', 'WDD19_ß0000.10317');
708
709 $t->unzip_xml('WDD19/ß0000/10317/struct/structure.xml')
710 ->attr_is('layer', 'docid', 'WDD19_ß0000.10317');
711
712 $t->unzip_xml('WDD19/ß0000/10317/base/tokens_conservative.xml')
713 ->attr_is('layer', 'docid', 'WDD19_ß0000.10317');
714};
715
Marc Kupietz8a954e52021-02-16 22:03:07 +0100716subtest 'Check entity replacement' => sub {
717 my $t = test_tei2korapxml(
718 file => catfile($f, 'data', 'text_with_entities.i5.xml'),
719 tmp => 'script_entity_replacement',
720 param => '-ti'
Akron91577922021-02-19 10:32:54 +0100721 )->stderr_like(qr!tei2korapxml:.*? text_id=CORP_DOC.00003!);
Marc Kupietz8a954e52021-02-16 22:03:07 +0100722
723 $t->unzip_xml('CORP/DOC/00003/data.xml')
724 ->content_like(qr!üüü Aα≈„▒░▓█╗┐┌╔═─┬╦┴╩╝┘└╚│║┼╬┤╣╠├•ˇčˆ†‡ě€ƒ…‗ıι“„▄‹‘‚—–νœŒωΩ‰φπϖř”ρ›’‘šŠσ□■▪⊂˜™▀ŸžŽ!);
725
726 $t->unzip_xml('CORP/DOC/00003/header.xml')
727 ->content_like(qr!üüü x α•α y!);
728};
729
Akron3378dfd2020-08-01 15:01:36 +0200730subtest 'Test Log' => sub {
731 test_tei2korapxml(
732 tmp => 'script_out',
733 file => $file,
Akronb93fabb2023-01-13 12:05:44 +0100734 param => '-l=warn --no-tokenizer'
Akron3378dfd2020-08-01 15:01:36 +0200735 )->stderr_is('');
736};
737
738
Akron5986da32021-10-01 12:53:55 +0200739subtest 'Broken data testing' => sub {
740 my $file = catfile($f, 'data', 'wikipedia.txt');
741
742 my $t = test_tei2korapxml(
743 tmp => 'script_ginkgo',
744 file => $file,
745 param => '-ti',
746 env => 'KORAPXMLTEI_DEBUG=1'
747 )->stderr_like(qr!No opened zip file to close!)
748 ->stderr_like(qr!Debugging is activated!);
749};
750
Akron2520a342022-03-29 18:18:05 +0200751subtest 'Required version testing' => sub {
752 test_tei2korapxml(
753 tmp => 'script_out',
754 file => $file,
755 param => '-rv=2.2.2'
756 )->stderr_like(qr!^Required version 2\.2\.2 mismatches version!);
757
758 test_tei2korapxml(
759 tmp => 'script_out',
760 file => $file,
761 param => '--required-version=2.2'
762 )->stderr_like(qr!^Required version 2\.2 mismatches version!);
763
764 test_tei2korapxml(
765 tmp => 'script_out',
766 file => $file,
Akronb93fabb2023-01-13 12:05:44 +0100767 param => '-rv=' . $KorAP::XML::TEI::Tokenizer::KorAP::VERSION . ' --no-tokenizer'
Akron2520a342022-03-29 18:18:05 +0200768 )->stderr_like(qr!GOE_AGA\.00000!);
769
770 test_tei2korapxml(
771 tmp => 'script_out',
772 file => $file,
Akronb93fabb2023-01-13 12:05:44 +0100773 param => '-rv= " ' . $KorAP::XML::TEI::Tokenizer::KorAP::VERSION . ' " --no-tokenizer'
Akron2520a342022-03-29 18:18:05 +0200774 )->stderr_like(qr!GOE_AGA\.00000!);
775};
776
Marc Kupietza671ae52022-12-22 16:28:14 +0100777subtest 'Standard TEI P5 testing' => sub {
778
779 my $t = test_tei2korapxml(
780 file => catfile($f, 'data', 'icc_german_sample.p5.xml'),
781 param => '--xmlid-to-textsigle \'ICC.German\.([^.]+\.[^.]+)\.(.+)@ICCGER/$1/$2\' -s -tk',
782 tmp => 'script_utf8_enc'
783 )->stderr_like(qr!tei2korapxml:.*? text_id=ICCGER/DeReKo-WPD17\.S00-18619!);
784
785 $t->unzip_xml('ICCGER/DeReKo-WPD17/E51-96136/data.xml')
786 ->content_like(qr/Recht auf persönliches Hab und Gut/);
787
788 $t->unzip_xml('ICCGER/CCBY-LTE/MJB-00001/header.xml')
789 ->text_is('textClass > classCode[scheme=ICC]', 'Learned_Technology', 'classCode is correctly extracted');
790
791};
Akron5986da32021-10-01 12:53:55 +0200792
Akronb93fabb2023-01-13 12:05:44 +0100793subtest 'Require tokenizer' => sub {
794
795 my $t = test_tei2korapxml(
796 file => catfile($f, 'data', 'icc_german_sample.p5.xml'),
797 tmp => 'script_utf8_enc'
798 )->stderr_like(qr!No tokenizer chosen!);
799};
800
Akron797e8072020-02-13 07:59:40 +0100801done_testing;