Akron | 0b5cda2 | 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; |
Akron | dcbee64 | 2020-10-30 18:01:43 +0100 | [diff] [blame^] | 6 | use KorAP::XML::Annotation::OpenNLP::Sentences; |
Akron | 0b5cda2 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 7 | use Scalar::Util qw/weaken/; |
| 8 | use Data::Dumper; |
Akron | 151676d | 2016-03-14 20:12:14 +0100 | [diff] [blame] | 9 | use lib 't/annotation'; |
Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 10 | use TestInit; |
Akron | 0b5cda2 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 11 | |
Akron | 11ef51d | 2016-01-18 19:07:56 +0100 | [diff] [blame] | 12 | ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens'); |
Akron | 0b5cda2 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 13 | |
| 14 | ok($tokens->add('OpenNLP', 'Sentences'), 'Add Structure'); |
| 15 | |
| 16 | my $data = $tokens->to_data->{data}; |
| 17 | |
| 18 | like($data->{foundries}, qr!opennlp/sentences!, 'data'); |
| 19 | is($data->{stream}->[0]->[0], '-:opennlp/sentences$<i>1', 'Number of Sentences'); |
| 20 | is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens'); |
Akron | dec4312 | 2020-03-03 11:22:25 +0100 | [diff] [blame] | 21 | is($data->{stream}->[0]->[3], '<>:opennlp/s:s$<b>64<i>0<i>129<i>18<b>0', 'Sentence'); |
Akron | ee443f9 | 2016-02-25 23:56:49 +0100 | [diff] [blame] | 22 | is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position'); |
Akron | 0b5cda2 | 2015-12-11 18:49:50 +0100 | [diff] [blame] | 23 | |
| 24 | done_testing; |
| 25 | |
| 26 | __END__ |