Akron | d8e34e3 | 2015-12-11 18:49:50 +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 | 5c460e4 | 2016-03-14 20:12:14 +0100 | [diff] [blame^] | 8 | use lib 't/annotation'; |
Akron | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 9 | use TestInit; |
Akron | d8e34e3 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 10 | |
Akron | b5d3461 | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 11 | ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens'); |
Akron | d8e34e3 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 12 | |
| 13 | ok($tokens->add('OpenNLP', 'Sentences'), 'Add Structure'); |
| 14 | |
| 15 | my $data = $tokens->to_data->{data}; |
| 16 | |
| 17 | like($data->{foundries}, qr!opennlp/sentences!, 'data'); |
| 18 | is($data->{stream}->[0]->[0], '-:opennlp/sentences$<i>1', 'Number of Sentences'); |
| 19 | is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens'); |
Akron | f6b2041 | 2016-02-25 23:56:49 +0100 | [diff] [blame] | 20 | is($data->{stream}->[0]->[3], '<>:opennlp/s:s$<b>64<i>0<i>129<i>17<b>0', 'Sentence'); |
| 21 | is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position'); |
Akron | d8e34e3 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 22 | |
| 23 | done_testing; |
| 24 | |
| 25 | __END__ |