blob: 5a324f66689af180213adca25cf04917cd592109 [file] [log] [blame]
Akrond69836b2015-12-10 00:40:20 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
Akrondcbee642020-10-30 18:01:43 +01006use KorAP::XML::Annotation::Base::Sentences;
Akron151676d2016-03-14 20:12:14 +01007use lib 't/annotation';
Akron11ef51d2016-01-18 19:07:56 +01008use TestInit;
Akrond69836b2015-12-10 00:40:20 +01009use Scalar::Util qw/weaken/;
10use Data::Dumper;
11
Akron11ef51d2016-01-18 19:07:56 +010012ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akrond69836b2015-12-10 00:40:20 +010013
14ok($tokens->add('Base', 'Sentences'), 'Add Structure');
15
16my $data = $tokens->to_data->{data};
17
18like($data->{foundries}, qr!base/sentences!, 'data');
19is($data->{stream}->[0]->[0], '-:base/sentences$<i>1', 'Number of paragraphs');
20is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens');
Akrondec43122020-03-03 11:22:25 +010021is($data->{stream}->[0]->[2], '<>:base/s:t$<b>64<i>0<i>129<i>18<b>0', 'Text');
22is($data->{stream}->[0]->[3], '<>:base/s:s$<b>64<i>0<i>129<i>18<b>2', 'Sentence');
Akrond69836b2015-12-10 00:40:20 +010023is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position');
24
25done_testing;
26
27__END__