blob: 1ac2781bafa8c48721116ea59d608dba670b59e4 [file] [log] [blame]
Akron126e33c2016-01-07 21:08:45 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
Akrondcbee642020-10-30 18:01:43 +01006use KorAP::XML::Annotation::TreeTagger::Sentences;
Akron126e33c2016-01-07 21:08:45 +01007use Scalar::Util qw/weaken/;
8use Data::Dumper;
Akron151676d2016-03-14 20:12:14 +01009use lib 't/annotation';
Akron11ef51d2016-01-18 19:07:56 +010010use TestInit;
Akron126e33c2016-01-07 21:08:45 +010011
Akron11ef51d2016-01-18 19:07:56 +010012ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron126e33c2016-01-07 21:08:45 +010013
14ok($tokens->add('TreeTagger', 'Sentences'), 'Add Structure');
15
16my $data = $tokens->to_data->{data};
17
18#diag Dumper $data;
19
20like($data->{foundries}, qr!treetagger/sentences!, 'data');
21is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens');
22is($data->{stream}->[0]->[1], '-:tt/sentences$<i>1', 'Number of paragraphs');
Akrondec43122020-03-03 11:22:25 +010023is($data->{stream}->[0]->[3], '<>:tt/s:s$<b>64<i>0<i>130<i>18<b>0', 'Text');
Akronee443f92016-02-25 23:56:49 +010024is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position');
Akron126e33c2016-01-07 21:08:45 +010025is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
26
27done_testing;
28
29__END__