blob: 9d5421ef1f951b2b6dc8c1b454fe470c71b58fe2 [file] [log] [blame]
Akron126e33c2016-01-07 21:08:45 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
Akrond3a0bad2016-02-26 14:07:58 +01005use Test::More;
Akrondcbee642020-10-30 18:01:43 +01006use KorAP::XML::Annotation::Mate::Dependency;
Akron126e33c2016-01-07 21:08:45 +01007use Scalar::Util qw/weaken/;
8use Data::Dumper;
Akron151676d2016-03-14 20:12:14 +01009use lib 't/annotation';
Akron11ef51d2016-01-18 19:07:56 +010010use TestInit;
Akron126e33c2016-01-07 21:08:45 +010011
Akron11ef51d2016-01-18 19:07:56 +010012ok(my $tokens = TestInit::tokens('0001'), 'Parse tokens');
Akron126e33c2016-01-07 21:08:45 +010013
Akron14ca9f02016-01-29 19:38:18 +010014ok($tokens->add('Mate', 'Dependency'), 'Add Dependency');
Akron126e33c2016-01-07 21:08:45 +010015
Akron14ca9f02016-01-29 19:38:18 +010016my $data = $tokens->to_data->{data}->{stream};
Akron194be542016-01-21 12:52:43 +010017
Akrond19e2752017-11-16 15:48:26 +010018is($data->[4]->[-1], 's:lädt', 'Surface form');
Akron75ba57d2016-03-07 23:36:27 +010019is($data->[4]->[1], '<:mate/d:--$<b>32<i>4', '< rel 1 (unary)');
20is($data->[4]->[2], '>:mate/d:--$<b>32<i>4', '> rel 1 (unary)');
Akron88000f92016-03-05 12:39:57 +010021#is($data->[4]->[8], 'mate/d:&&&$<b>128<s>1', 'token for rel 1 (unary)');
Akron14ca9f02016-01-29 19:38:18 +010022
Akrond19e2752017-11-16 15:48:26 +010023is($data->[1]->[-1], 's:letzten', 'Surface');
Akron75ba57d2016-03-07 23:36:27 +010024is($data->[1]->[0], '>:mate/d:NK$<b>32<i>3', '> rel 2 (term-to-term)');
Akron88000f92016-03-05 12:39:57 +010025#is($data->[1]->[3], 'mate/d:&&&$<b>128<s>1', '< rel 2 (term-to-term)');
26
Akrond19e2752017-11-16 15:48:26 +010027is($data->[3]->[-1], 's:Anlass', 'Surface');
Akron75ba57d2016-03-07 23:36:27 +010028is($data->[3]->[1], '<:mate/d:NK$<b>32<i>1', '< rel 2 (term-to-term)');
Akron88000f92016-03-05 12:39:57 +010029#is($data->[3]->[5], 'mate/d:&&&$<b>128<s>1', '< rel 2 (term-to-term)');
Akrond3a0bad2016-02-26 14:07:58 +010030
Akron126e33c2016-01-07 21:08:45 +010031
32done_testing;
Akron126e33c2016-01-07 21:08:45 +010033__END__
34