blob: 92ebb8a386e8b34f19c6ea44fcb162d074f3419e [file] [log] [blame]
Nils Diewald98767bb2014-04-25 20:31:19 +00001#!/usr/bin/env perl
2# source ~/perl5/perlbrew/etc/bashrc
3# perlbrew switch perl-blead@korap
4use strict;
5use warnings;
6use utf8;
7use Test::More;
8use Benchmark ':hireswallclock';
9use lib 'lib', '../lib';
10use Scalar::Util qw/weaken/;
11
12use File::Basename 'dirname';
13use File::Spec::Functions 'catdir';
14
15use_ok('KorAP::Document');
16
17my $path = catdir(dirname(__FILE__), 'artificial');
18ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald6a2a14b2015-06-17 20:34:24 +000019like($doc->path, qr!$path/$!, 'Path');
Nils Diewald98767bb2014-04-25 20:31:19 +000020ok($doc->parse, 'Parse document');
21
22sub new_tokenizer {
23 my $x = $doc;
24 weaken $x;
25 return KorAP::Tokenizer->new(
26 path => $x->path,
27 doc => $x,
28 foundry => 'OpenNLP',
29 layer => 'Tokens',
30 name => 'tokens'
31 )
32};
33
34is($doc->primary->data,
35 'Zum letzten kulturellen Anlass lädt die Leitung des Schulheimes Hofbergli ein, '.
36 'bevor der Betrieb Ende Schuljahr eingestellt wird.', 'Primary data');
37
38is($doc->primary->data_length, 129, 'Primary data length');
39
40is($doc->primary->data(0,3), 'Zum', 'Get primary data');
41
42# Get tokens
43use_ok('KorAP::Tokenizer');
44# Get tokenization
45ok(my $tokens = KorAP::Tokenizer->new(
46 path => $doc->path,
47 doc => $doc,
48 foundry => 'OpenNLP',
49 layer => 'Tokens',
50 name => 'tokens'
51), 'New Tokenizer');
52ok($tokens->parse, 'Parse');
53
54is($tokens->foundry, 'OpenNLP', 'Foundry');
55
Nils Diewald840c9242014-10-28 19:51:26 +000056is($tokens->doc->text_sigle, 'ART_ABC.00001', 'Doc id');
Nils Diewald98767bb2014-04-25 20:31:19 +000057is($tokens->should, 20, 'Should');
58is($tokens->have, 18, 'Have');
59is($tokens->name, 'tokens', 'Name');
60is($tokens->layer, 'Tokens', 'Layer');
61
Nils Diewald6d565072014-10-30 23:20:58 +000062is($tokens->stream->pos(0)->to_string, '[(0-3)-:tokens$<i>18|_0#0-3|i:zum|s:Zum]', 'Token is correct');
63
64is($tokens->stream->pos(1)->to_string, '[(4-11)_1#4-11|i:letzten|s:letzten]', 'Token is correct');
Nils Diewald98767bb2014-04-25 20:31:19 +000065
66my $i = 2;
67foreach ([12,23, 'kulturellen'],
68 [24,30, 'Anlass'],
69 [31,35, 'lädt'],
70 [36,39, 'die'],
71 [40,47, 'Leitung'],
72 [48,51, 'des'],
73 [52,63, 'Schulheimes'],
74 [64,73, 'Hofbergli'],
75 [74,77, 'ein'],
76 [79,84, 'bevor'],
77 [85,88, 'der'],
78 [89,96, 'Betrieb'],
79 [97,101, 'Ende'],
80 [102,111, 'Schuljahr'],
81 [112,123, 'eingestellt'],
82 [124,128, 'wird']
83 ) {
84 is($tokens->stream->pos($i++)->to_string,
85 '[('.$_->[0].'-'.$_->[1].')'.
Nils Diewald6d565072014-10-30 23:20:58 +000086 '_'.($i-1).'#'.$_->[0].'-'.$_->[1] . '|' .
87 'i:'.lc($_->[2]).'|s:'.$_->[2].']',
Nils Diewald98767bb2014-04-25 20:31:19 +000088 'Token is correct');
89};
90
91ok(!$tokens->stream->pos($i++), 'No more tokens');
92
93# Add OpenNLP/morpho
94ok($tokens->add('OpenNLP', 'Morpho'), 'Add OpenNLP/Morpho');
95
Nils Diewald6d565072014-10-30 23:20:58 +000096
Nils Diewald98767bb2014-04-25 20:31:19 +000097$i = 0;
98foreach (qw/APPRART ADJA ADJA NN VVFIN ART NN ART NN NE PTKVZ KOUS ART NN NN NN VVPP VAFIN/) {
99 like($tokens->stream->pos($i++)->to_string,
100 qr!\|opennlp/p:$_!,
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000101 'Annotation (OpenNLP/p) is correct: ' . $_
102 );
Nils Diewald98767bb2014-04-25 20:31:19 +0000103};
104
105# Add OpenNLP/sentences
106ok($tokens->add('OpenNLP', 'Sentences'), 'Add OpenNLP/Sentences');
107
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000108is($tokens->stream->pos(0)->to_string,
109 '[(0-3)-:opennlp/sentences$<i>1|-:tokens$<i>18|<>:opennlp/s:s#0-129$<i>17<b>0|_0#0-3|i:zum|opennlp/p:APPRART|s:Zum]',
110# '[(0-3)-:opennlp/sentences$<i>1|-:tokens$<i>18|_0#0-3|i:zum|s:Zum|opennlp/p:APPRART|<>:opennlp/s:s#0-129$<i>17]',
111 'Correct sentence'
112 );
Nils Diewald98767bb2014-04-25 20:31:19 +0000113
114# New instantiation
115ok($tokens = KorAP::Tokenizer->new(
116 path => $doc->path,
117 doc => $doc,
118 foundry => 'OpenNLP',
119 layer => 'Tokens',
120 name => 'tokens'
121), 'New Tokenizer');
122
123ok($tokens->parse, 'Parse');
124
125# Add OpenNLP/sentences
126ok($tokens->add('Base', 'Sentences'), 'Add Base/Sentences');
127
128# Add OpenNLP/sentences
129ok($tokens->add('Base', 'Paragraphs'), 'Add Base/Paragraphs');
130
131is($tokens->stream->pos(0)->to_string,
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000132 '[(0-3)-:base/paragraphs$<i>0|-:base/sentences$<i>1|-:tokens$<i>18|<>:base/s:t#0-129$<i>17<b>0|<>:base/s:s#0-129$<i>17<b>2|_0#0-3|i:zum|s:Zum]',
133# '[(0-3)-:base/paragraphs$<i>0|-:base/sentences$<i>1|-:tokens$<i>18|_0#0-3|i:zum|s:Zum|<>:base/s:t#0-129$<i>17<b>0|<>:base/s:s#0-129$<i>17<b>0]',
Nils Diewald98767bb2014-04-25 20:31:19 +0000134 'Correct base annotation');
135
Nils Diewald98767bb2014-04-25 20:31:19 +0000136# New instantiation
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000137ok($tokens = new_tokenizer->parse, 'Parse');
Nils Diewald98767bb2014-04-25 20:31:19 +0000138
139# Add CoreNLP/NamedEntities
140ok($tokens->add('CoreNLP', 'NamedEntities', 'ne_dewac_175m_600'), 'Add CoreNLP/NamedEntities');
141ok($tokens->add('CoreNLP', 'NamedEntities', 'ne_hgc_175m_600'), 'Add CoreNLP/NamedEntities');
142
Nils Diewald6d565072014-10-30 23:20:58 +0000143# [(64-73)s:Hofbergli|i:hofbergli|_9#64-73|corenlp/ne_dewac_175m_600:I-LOC|corenlp/ne_hgc_175m_600:I-LOC]
Nils Diewald98767bb2014-04-25 20:31:19 +0000144is($tokens->stream->pos(9)->to_string,
Nils Diewald6d565072014-10-30 23:20:58 +0000145 '[(64-73)_9#64-73|corenlp/ne:I-LOC|i:hofbergli|s:Hofbergli]',
Nils Diewald98767bb2014-04-25 20:31:19 +0000146 'Correct NamedEntities annotation');
147
Nils Diewald98767bb2014-04-25 20:31:19 +0000148# New instantiation
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000149ok($tokens = new_tokenizer->parse, 'Parse');
Nils Diewald98767bb2014-04-25 20:31:19 +0000150
151# Add CoreNLP/Morpho
152ok($tokens->add('CoreNLP', 'Morpho'), 'Add CoreNLP/Morpho');
153
154is($tokens->stream->pos(0)->to_string,
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000155 '[(0-3)-:tokens$<i>18|_0#0-3|corenlp/p:APPRART|i:zum|s:Zum]',
156# '[(0-3)-:tokens$<i>18|_0#0-3|i:zum|s:Zum|corenlp/p:APPRART]',
Nils Diewald98767bb2014-04-25 20:31:19 +0000157 'Correct corenlp annotation');
158
159$i = 0;
160foreach (qw/APPRART ADJ ADJA NN VVFIN ART NN ART NN NE PTKVZ KOUS ART NN NN NN VVPP VAFIN/) {
161 like($tokens->stream->pos($i++)->to_string,
162 qr!\|corenlp/p:$_!,
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000163 'Annotation (CoreNLP/p) is correct: '. $_);
Nils Diewald98767bb2014-04-25 20:31:19 +0000164};
165
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000166
167
Nils Diewald98767bb2014-04-25 20:31:19 +0000168# Add CoreNLP/Sentences
169ok($tokens->add('CoreNLP', 'Sentences'), 'Add CoreNLP/Sentences');
170
171is($tokens->stream->pos(0)->to_string,
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000172 '[(0-3)-:corenlp/sentences$<i>1|-:tokens$<i>18|<>:corenlp/s:s#0-129$<i>17<b>0|_0#0-3|corenlp/p:APPRART|i:zum|s:Zum]',
173# '[(0-3)-:corenlp/sentences$<i>1|-:tokens$<i>18|_0#0-3|i:zum|s:Zum|corenlp/p:APPRART|<>:corenlp/s:s#0-129$<i>17]',
Nils Diewald98767bb2014-04-25 20:31:19 +0000174 'Correct corenlp annotation');
175
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000176
Nils Diewald98767bb2014-04-25 20:31:19 +0000177# New instantiation
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000178ok($tokens = new_tokenizer->parse, 'New Tokenizer');
Nils Diewald98767bb2014-04-25 20:31:19 +0000179
180# Add CoreNLP/Sentences
181ok($tokens->add('Connexor', 'Sentences'), 'Add Connexor/Sentences');
182
183is($tokens->stream->pos(0)->to_string,
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000184 '[(0-3)-:cnx/sentences$<i>1|-:tokens$<i>18|<>:cnx/s:s#0-129$<i>17<b>0|_0#0-3|i:zum|s:Zum]',
185 # '[(0-3)-:cnx/sentences$<i>1|-:tokens$<i>18|_0#0-3|i:zum|s:Zum|<>:cnx/s:s#0-129$<i>17<b>0]',
Nils Diewald98767bb2014-04-25 20:31:19 +0000186 'Correct cnx annotation');
187
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000188# New instantiation
189ok($tokens = new_tokenizer->parse, 'New Tokenizer');
190
191# Add Connexor/Morpho
192ok($tokens->add('Connexor', 'Morpho'), 'Add Connexor/Morpho');
193
194$i = 0;
195foreach (qw/! A A N V DET N DET N N NUM CS DET N N N V V/) {
196 if ($_ eq '!') {
197 $i++;
198 next;
199 };
200 like($tokens->stream->pos($i++)->to_string,
201 qr!\|cnx/p:$_!,
202 'Annotation (Connexor/p) is correct: ' . $_);
203};
204
Nils Diewald6d565072014-10-30 23:20:58 +0000205
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000206$i = 0;
207foreach (qw/! ! ! ! IND:PRES ! ! ! ! Prop ! ! ! ! ! ! PCP:PERF IND:PRES/) {
208 if ($_ eq '!') {
209 $i++;
210 next;
211 };
212 foreach my $f (split(':', $_)) {
213 like($tokens->stream->pos($i)->to_string,
214 qr!\|cnx/m:$f!,
215 'Annotation (Connexor/m) is correct: '. $f);
216 };
217 $i++;
218};
219
220# New instantiation
221ok($tokens = new_tokenizer->parse, 'New Tokenizer');
222
223# Add Connexor/Phrase
224ok($tokens->add('Connexor', 'Phrase'), 'Add Connexor/Phrase');
225my $stream = $tokens->stream;
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000226like($stream->pos(1)->to_string, qr!<>:cnx/c:np#4-30\$<i>4<b>0!, 'Annotation (Connexor/c) is correct');
227like($stream->pos(6)->to_string, qr!<>:cnx/c:np#40-47\$<i>7<b>0!, 'Annotation (Connexor/c) is correct');
228like($stream->pos(8)->to_string, qr!<>:cnx/c:np#52-73\$<i>10<b>0!, 'Annotation (Connexor/c) is correct');
229like($stream->pos(13)->to_string, qr!<>:cnx/c:np#89-111\$<i>16<b>0!, 'Annotation (Connexor/c) is correct');
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000230
231# New instantiation
232ok($tokens = new_tokenizer->parse, 'New Tokenizer');
233
234# Add Connexor/Syntax
235ok($tokens->add('Connexor', 'Syntax'), 'Add Connexor/Syntax');
236$stream = $tokens->stream;
237
238$i = 0;
239foreach (qw/! @PREMOD @PREMOD @NH @MAIN @PREMOD @NH @PREMOD
240 @PREMOD @NH @NH @PREMARK @PREMOD @PREMOD @NH @NH @MAIN @AUX/) {
241 if ($_ eq '!') {
242 $i++;
243 next;
244 };
245 like($tokens->stream->pos($i++)->to_string,
246 qr!\|cnx/syn:$_!,
247 'Annotation (Connexor/syn) is correct: ' . $_);
248};
249
250# New instantiation
251ok($tokens = new_tokenizer->parse, 'New Tokenizer');
252
253# Add XIP/Sentences
254ok($tokens->add('XIP', 'Sentences'), 'Add XIP/Sentences');
255
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000256is($tokens->stream->pos(0)->to_string,
257 '[(0-3)-:tokens$<i>18|-:xip/sentences$<i>1|<>:xip/s:s#0-129$<i>17<b>0|_0#0-3|i:zum|s:Zum]',
258# '[(0-3)-:tokens$<i>18|_0#0-3|i:zum|s:Zum|-:xip/sentences$<i>1|<>:xip/s:s#0-129$<i>17<b>0]',
259 'First sentence'
260 );
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000261
262# Add XIP/Morpho
263ok($tokens->add('XIP', 'Morpho'), 'Add XIP/Morpho');
264$stream = $tokens->stream;
265
266$i = 0;
267foreach (qw/PREP ADJ ADJ NOUN VERB DET NOUN DET NOUN NOUN PTCL CONJ DET NOUN NOUN NOUN VERB VERB/) {
268 if ($_ eq '!') {
269 $i++;
270 next;
271 };
272 like($tokens->stream->pos($i++)->to_string,
273 qr!\|xip/p:$_!,
274 'Annotation (xip/p) is correct: ' . $_);
275};
276
277$i = 0;
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000278foreach ('zu', 'letzt', 'kulturell', 'Anlass', '=laden:laden', 'die', 'Leitung', 'der', '\#schulen:\#Heim:schulen\#Heim', 'Hofbergli', 'ein', 'bevor', 'der', 'Betrieb', 'Ende', '\#schulen:\#Jahr:schulen\#Jahr') {
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000279 if ($_ eq '!') {
280 $i++;
281 next;
282 };
283 foreach my $f (split(':', $_)) {
284 like($tokens->stream->pos($i)->to_string,
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000285 qr!\|xip\/l:\Q$f\E!,
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000286 'Annotation (xip/l) is correct: ' . $f);
287 };
288 $i++;
289};
290
291# New instantiation
292ok($tokens = new_tokenizer->parse, 'New Tokenizer');
293
294# Add XIP/Sentences
Nils Diewald47c3ef32014-04-30 19:13:17 +0000295ok($tokens->add('XIP', 'Dependency'), 'Add XIP/Dependency');
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000296
Nils Diewald6a2a14b2015-06-17 20:34:24 +0000297
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000298$stream = $tokens->stream;
299like($stream->pos(1)->to_string, qr!\|>:xip/d:NMOD\$<i>3!, 'Dependency fine');
300like($stream->pos(3)->to_string, qr!\|<:xip/d:NMOD\$<i>1!, 'Dependency fine');
301like($stream->pos(3)->to_string, qr!\|<:xip/d:NMOD\$<i>2!, 'Dependency fine');
302like($stream->pos(4)->to_string, qr!\|>xip/d:VMAIN\$<i>4!, 'Dependency fine');
303like($stream->pos(4)->to_string, qr!\|<:xip/d:SUBJ\$<i>6!, 'Dependency fine');
304like($stream->pos(4)->to_string, qr!\|<:xip/d:VPREF\$<i>10!, 'Dependency fine');
305like($stream->pos(5)->to_string, qr!\|>:xip/d:DETERM\$<i>6!, 'Dependency fine');
306like($stream->pos(6)->to_string, qr!\|<:xip/d:DETERM\$<i>5!, 'Dependency fine');
307like($stream->pos(6)->to_string, qr!\|>:xip/d:SUBJ\$<i>4!, 'Dependency fine');
308like($stream->pos(6)->to_string, qr!\|<:xip/d:NMOD\$<i>8!, 'Dependency fine');
309like($stream->pos(7)->to_string, qr!\|>:xip/d:DETERM\$<i>8!, 'Dependency fine');
310like($stream->pos(8)->to_string, qr!\|<:xip/d:DETERM\$<i>7!, 'Dependency fine');
311like($stream->pos(8)->to_string, qr!\|>:xip/d:NMOD\$<i>6!, 'Dependency fine');
312like($stream->pos(8)->to_string, qr!\|<:xip/d:NMOD\$<i>9!, 'Dependency fine');
313like($stream->pos(9)->to_string, qr!\|>:xip/d:NMOD\$<i>8!, 'Dependency fine');
314like($stream->pos(10)->to_string, qr!\|>:xip/d:VPREF\$<i>4!, 'Dependency fine');
315like($stream->pos(11)->to_string, qr!\|>:xip/d:CONNECT\$<i>16!, 'Dependency fine');
316like($stream->pos(12)->to_string, qr!\|>:xip/d:DETERM\$<i>13!, 'Dependency fine');
317like($stream->pos(13)->to_string, qr!\|<:xip/d:DETERM\$<i>12!, 'Dependency fine');
318like($stream->pos(13)->to_string, qr!\|>:xip/d:SUBJ\$<i>16!, 'Dependency fine');
319like($stream->pos(14)->to_string, qr!\|>:xip/d:OBJ\$<i>16!, 'Dependency fine');
320like($stream->pos(15)->to_string, qr!\|>:xip/d:OBJ\$<i>16!, 'Dependency fine');
321like($stream->pos(16)->to_string, qr!\|<:xip/d:CONNECT\$<i>11!, 'Dependency fine');
322like($stream->pos(16)->to_string, qr!\|<:xip/d:SUBJ\$<i>13!, 'Dependency fine');
323like($stream->pos(16)->to_string, qr!\|<:xip/d:OBJ\$<i>14!, 'Dependency fine');
324like($stream->pos(16)->to_string, qr!\|<:xip/d:OBJ\$<i>15!, 'Dependency fine');
325like($stream->pos(16)->to_string, qr!\|>:xip/d:AUXIL\$<i>17!, 'Dependency fine');
326like($stream->pos(16)->to_string, qr!\|>xip/d:VMAIN\$<i>16!, 'Dependency fine');
327like($stream->pos(16)->to_string, qr!\|<xip/d:VMAIN\$<i>16!, 'Dependency fine');
328like($stream->pos(17)->to_string, qr!\|<:xip/d:AUXIL\$<i>16!, 'Dependency fine');
329
Nils Diewald47c3ef32014-04-30 19:13:17 +0000330# New instantiation
331ok($tokens = new_tokenizer->parse, 'New Tokenizer');
332
333# Add XIP/Sentences
334ok($tokens->add('XIP', 'Constituency'), 'Add XIP/Constituency');
335
336$stream = $tokens->stream;
337like($stream->pos(0)->to_string, qr!\|<>:xip/c:TOP#0-129\$<i>17!, 'Constituency fine');
338like($stream->pos(0)->to_string, qr!\|<>:xip/c:MC#0-129\$<i>17<b>1!, 'Constituency fine');
339like($stream->pos(0)->to_string, qr!\|<>:xip/c:PP#0-30\$<i>4<b>2!, 'Constituency fine');
340like($stream->pos(0)->to_string, qr!\|<>:xip/c:PREP#0-3\$<i>1!, 'Constituency fine');
341
342like($stream->pos(1)->to_string, qr!\|<>:xip/c:NP#4-30\$<i>4<b>3!, 'Constituency fine');
343like($stream->pos(1)->to_string, qr!\|<>:xip/c:NPA#4-30\$<i>4<b>4!, 'Constituency fine');
344like($stream->pos(1)->to_string, qr!\|<>:xip/c:AP#4-11\$<i>2<b>5!, 'Constituency fine');
345like($stream->pos(1)->to_string, qr!\|<>:xip/c:ADJ#4-11\$<i>2<b>6!, 'Constituency fine');
346
347like($stream->pos(2)->to_string, qr!\|<>:xip/c:AP#12-23\$<i>3<b>5!, 'Constituency fine');
348like($stream->pos(2)->to_string, qr!\|<>:xip/c:ADJ#12-23\$<i>3<b>6!, 'Constituency fine');
349
350like($stream->pos(3)->to_string, qr!\|<>:xip/c:NOUN#24-30\$<i>4<b>5!, 'Constituency fine');
351
352like($stream->pos(4)->to_string, qr!\|<>:xip/c:VERB#31-35\$<i>5<b>2!, 'Constituency fine');
353
354like($stream->pos(5)->to_string, qr!\|<>:xip/c:NP#36-47\$<i>7<b>2!, 'Constituency fine');
355like($stream->pos(5)->to_string, qr!\|<>:xip/c:DET#36-39\$<i>6<b>3!, 'Constituency fine');
356
357like($stream->pos(6)->to_string, qr!\|<>:xip/c:NPA#40-47\$<i>7<b>3!, 'Constituency fine');
358like($stream->pos(6)->to_string, qr!\|<>:xip/c:NOUN#40-47\$<i>7<b>4!, 'Constituency fine');
359
360like($stream->pos(7)->to_string, qr!\|<>:xip/c:NP#48-63\$<i>9<b>2!, 'Constituency fine');
361like($stream->pos(7)->to_string, qr!\|<>:xip/c:DET#48-51\$<i>8<b>3!, 'Constituency fine');
362
363like($stream->pos(8)->to_string, qr!\|<>:xip/c:NPA#52-63\$<i>9<b>3!, 'Constituency fine');
364like($stream->pos(8)->to_string, qr!\|<>:xip/c:NOUN#52-63\$<i>9<b>4!, 'Constituency fine');
365
366like($stream->pos(9)->to_string, qr!\|<>:xip/c:NP#64-73\$<i>10<b>2!, 'Constituency fine');
367like($stream->pos(9)->to_string, qr!\|<>:xip/c:NPA#64-73\$<i>10<b>3!, 'Constituency fine');
368like($stream->pos(9)->to_string, qr!\|<>:xip/c:NOUN#64-73\$<i>10<b>4!, 'Constituency fine');
369
370like($stream->pos(10)->to_string, qr!\|<>:xip/c:PTCL#74-77\$<i>11<b>2!, 'Constituency fine');
371
372like($stream->pos(11)->to_string, qr!\|<>:xip/c:SC#79-128\$<i>18!, 'Constituency fine');
373like($stream->pos(11)->to_string, qr!\|<>:xip/c:CONJ#79-84\$<i>12<b>1!, 'Constituency fine');
374
375like($stream->pos(12)->to_string, qr!\|<>:xip/c:NP#85-96\$<i>14<b>1!, 'Constituency fine');
376like($stream->pos(12)->to_string, qr!\|<>:xip/c:DET#85-88\$<i>13<b>2!, 'Constituency fine');
377
378
379like($stream->pos(13)->to_string, qr!\|<>:xip/c:NPA#89-96\$<i>14<b>2!, 'Constituency fine');
380like($stream->pos(13)->to_string, qr!\|<>:xip/c:NOUN#89-96\$<i>14<b>3!, 'Constituency fine');
381
382like($stream->pos(14)->to_string, qr!\|<>:xip/c:NP#97-101\$<i>15<b>1!, 'Constituency fine');
383like($stream->pos(14)->to_string, qr!\|<>:xip/c:NPA#97-101\$<i>15<b>2!, 'Constituency fine');
384like($stream->pos(14)->to_string, qr!\|<>:xip/c:NOUN#97-101\$<i>15<b>3!, 'Constituency fine');
385
386like($stream->pos(15)->to_string, qr!\|<>:xip/c:NP#102-111\$<i>16<b>1!, 'Constituency fine');
387like($stream->pos(15)->to_string, qr!\|<>:xip/c:NPA#102-111\$<i>16<b>2!, 'Constituency fine');
388like($stream->pos(15)->to_string, qr!\|<>:xip/c:NOUN#102-111\$<i>16<b>3!, 'Constituency fine');
389
390like($stream->pos(16)->to_string, qr!\|<>:xip/c:VERB#112-123\$<i>17<b>1!, 'Constituency fine');
391
392like($stream->pos(17)->to_string, qr!\|<>:xip/c:VERB#124-128\$<i>18<b>1!, 'Constituency fine');
393
394# diag $stream->to_string;
395
Nils Diewald21a3e1a2014-04-28 18:48:16 +0000396
397# ADJA ADJA NN VVFIN ART NN ART NN NE PTKVZ KOUS ART NN NN NN VVPP VAFIN
398done_testing;
399__END__
Nils Diewald98767bb2014-04-25 20:31:19 +0000400
401
402# Todo: CoreNLP/Constituency!
Nils Diewald98767bb2014-04-25 20:31:19 +0000403
404
Nils Diewald98767bb2014-04-25 20:31:19 +0000405
406
407
408# Connexor
409push(@layers, ['Connexor', 'Morpho']);
410push(@layers, ['Connexor', 'Syntax']);
411push(@layers, ['Connexor', 'Phrase']);
412push(@layers, ['Connexor', 'Sentences']);
413
414# TreeTagger
415push(@layers, ['TreeTagger', 'Morpho']);
416push(@layers, ['TreeTagger', 'Sentences']);
417
418# Mate
419# push(@layers, ['Mate', 'Morpho']);
420push(@layers, ['Mate', 'Dependency']);
421
422# XIP
423push(@layers, ['XIP', 'Morpho']);
424push(@layers, ['XIP', 'Constituency']);
425push(@layers, ['XIP', 'Dependency']);
426push(@layers, ['XIP', 'Sentences']);
427
428
Nils Diewald98767bb2014-04-25 20:31:19 +0000429__END__