blob: 026321faf628e063def69ba1c6742fb4426a146a [file] [log] [blame]
Akronca9dbb32016-01-05 20:54:34 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
6use Scalar::Util qw/weaken/;
7use Data::Dumper;
Akron5c460e42016-03-14 20:12:14 +01008use lib 't/annotation';
Akronb5d34612016-01-18 19:07:56 +01009use TestInit;
Akronca9dbb32016-01-05 20:54:34 +010010
Akronb5d34612016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akronca9dbb32016-01-05 20:54:34 +010012
13ok($tokens->add('XIP', 'Constituency'), 'Add Structure');
14
15my $data = $tokens->to_data->{data};
16like($data->{foundries}, qr!xip/constituency!, 'data');
17like($data->{layerInfos}, qr!xip/c=spans!, 'data');
18
19# The length includes the punct - but that doesn't matter
20is($data->{stream}->[0]->[1], '<>:xip/c:PREP$<b>64<i>0<i>3<i>1<b>3', 'Prep phrase');
Akrone7bc37d2016-02-26 00:21:16 +010021is($data->{stream}->[0]->[2], '<>:xip/c:PP$<b>64<i>0<i>30<i>4<b>2', 'pp phrase');
22is($data->{stream}->[0]->[4], '<>:xip/c:TOP$<b>64<i>0<i>129<i>17<b>0', 'top phrase');
23is($data->{stream}->[0]->[5], '<>:xip/c:MC$<b>64<i>0<i>129<i>17<b>1', 'mc phrase');
Akronca9dbb32016-01-05 20:54:34 +010024is($data->{stream}->[-1]->[0], '<>:xip/c:VERB$<b>64<i>124<i>128<i>18<b>4', 'Noun phrase');
25
Akrone7bc37d2016-02-26 00:21:16 +010026
Akronca9dbb32016-01-05 20:54:34 +010027done_testing;
28
29__END__
30
31
32
33