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