blob: 8096e5b0113bc2b7ecfd7e90202a97ef0413be98 [file] [log] [blame]
Akrond69836b2015-12-10 00:40:20 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
Akron151676d2016-03-14 20:12:14 +01006use lib 't/annotation';
Akron11ef51d2016-01-18 19:07:56 +01007use TestInit;
Akrond69836b2015-12-10 00:40:20 +01008use Scalar::Util qw/weaken/;
9use Data::Dumper;
10
Akron11ef51d2016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akrond69836b2015-12-10 00:40:20 +010012
13ok($tokens->add('Base', 'Sentences'), 'Add Structure');
14
15my $data = $tokens->to_data->{data};
16
17like($data->{foundries}, qr!base/sentences!, 'data');
18is($data->{stream}->[0]->[0], '-:base/sentences$<i>1', 'Number of paragraphs');
19is($data->{stream}->[0]->[1], '-:tokens$<i>18', 'Number of tokens');
Akrondec43122020-03-03 11:22:25 +010020is($data->{stream}->[0]->[2], '<>:base/s:t$<b>64<i>0<i>129<i>18<b>0', 'Text');
21is($data->{stream}->[0]->[3], '<>:base/s:s$<b>64<i>0<i>129<i>18<b>2', 'Sentence');
Akrond69836b2015-12-10 00:40:20 +010022is($data->{stream}->[0]->[4], '_0$<i>0<i>3', 'Position');
23
24done_testing;
25
26__END__