blob: c47ebb6863b875805932d72a51fb68b4de8910a8 [file] [log] [blame]
Akrond99f8c82016-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;
Akronb5d34612016-01-18 19:07:56 +01008use lib 't/index';
9use TestInit;
Akrond99f8c82016-01-07 21:08:45 +010010
Akronb5d34612016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akrond99f8c82016-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');
Akronf6b20412016-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');
Akrond99f8c82016-01-07 21:08:45 +010024is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position');
25
26done_testing;
27
28__END__