blob: 04c5892c5ae38a09af84b8d758c465c2295b4a5c [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;
Akron11ef51d2016-01-18 19:07:56 +01008use lib 't/index';
9use 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');
22is($data->{stream}->[0]->[2], '<>:tt/s:s$<b>64<i>0<i>130<i>17<b>0', 'Text');
23is($data->{stream}->[0]->[3], '_0$<i>0<i>3', 'Position');
24is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
25
26done_testing;
27
28__END__