blob: 17e6c7eabd2fcd5dfdd37e299861825ab692879d [file] [log] [blame]
Akron5f511d22016-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;
Akron11ef51d2016-01-18 19:07:56 +01008use lib 't/index';
9use TestInit;
Akron5f511d22016-01-05 20:54:34 +010010
Akron11ef51d2016-01-18 19:07:56 +010011ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron5f511d22016-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');
Akronee443f92016-02-25 23:56:49 +010021is($data->{stream}->[0]->[4], '<>:xip/c:PP$<b>64<i>0<i>30<i>4<b>2', 'pp phrase');
22done_testing;
23__END__
24is($data->{stream}->[0]->[6], '<>:xip/c:TOP$<b>64<i>0<i>129<i>17<b>0', 'top phrase');
25is($data->{stream}->[0]->[7], '<>:xip/c:MC$<b>64<i>0<i>129<i>17<b>1', 'mc phrase');
Akron5f511d22016-01-05 20:54:34 +010026
27is($data->{stream}->[-1]->[0], '<>:xip/c:VERB$<b>64<i>124<i>128<i>18<b>4', 'Noun phrase');
28
29done_testing;
30
31__END__
32
33
34
35