Akron | 126e33c | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
| 4 | use utf8; |
| 5 | use Test::More; |
| 6 | use Scalar::Util qw/weaken/; |
| 7 | use Data::Dumper; |
Akron | 151676d | 2016-03-14 20:12:14 +0100 | [diff] [blame^] | 8 | use lib 't/annotation'; |
Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 9 | use TestInit; |
Akron | 126e33c | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 10 | |
Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 11 | ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens'); |
Akron | 126e33c | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 12 | |
| 13 | ok($tokens->add('TreeTagger', 'Sentences'), 'Add Structure'); |
| 14 | |
| 15 | my $data = $tokens->to_data->{data}; |
| 16 | |
| 17 | #diag Dumper $data; |
| 18 | |
| 19 | like($data->{foundries}, qr!treetagger/sentences!, 'data'); |
| 20 | is($data->{stream}->[0]->[0], '-:tokens$<i>18', 'Number of tokens'); |
| 21 | is($data->{stream}->[0]->[1], '-:tt/sentences$<i>1', 'Number of paragraphs'); |
Akron | ee443f9 | 2016-02-25 23:56:49 +0100 | [diff] [blame] | 22 | is($data->{stream}->[0]->[3], '<>:tt/s:s$<b>64<i>0<i>130<i>17<b>0', 'Text'); |
| 23 | is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position'); |
Akron | 126e33c | 2016-01-07 21:08:45 +0100 | [diff] [blame] | 24 | is($data->{stream}->[-1]->[0], '_17$<i>124<i>128', 'Position'); |
| 25 | |
| 26 | done_testing; |
| 27 | |
| 28 | __END__ |