blob: 9efdb5a42fca3cd33c5b7f404911a44641a82b2d [file] [log] [blame]
Akron5f511d22016-01-05 20:54:34 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
Akrondcbee642020-10-30 18:01:43 +01006use KorAP::XML::Annotation::XIP::Sentences;
Akron5f511d22016-01-05 20:54:34 +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;
Akron5f511d22016-01-05 20:54:34 +010011
Akron11ef51d2016-01-18 19:07:56 +010012ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron5f511d22016-01-05 20:54:34 +010013
14ok($tokens->add('XIP', 'Sentences'), 'Add Structure');
15
16my $data = $tokens->to_data->{data};
17
18like($data->{foundries}, qr!xip/sentences!, 'data');
19
Akron5f511d22016-01-05 20:54:34 +010020is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens');
Akron2d83a5a2016-02-26 00:21:16 +010021is($data->{stream}->[0]->[1], '-:xip/sentences$<i>1', 'Number of paragraphs');
Akrondec43122020-03-03 11:22:25 +010022is($data->{stream}->[0]->[3], '<>:xip/s:s$<b>64<i>0<i>129<i>18<b>0', 'Text');
Akron2d83a5a2016-02-26 00:21:16 +010023is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position');
Akron5f511d22016-01-05 20:54:34 +010024is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
25
26done_testing;
27__END__