blob: d09e4eccbf381a946081dafe2a2b42b903c97f2a [file] [log] [blame]
Nils Diewald8e323ee2014-04-23 17:28:14 +00001use strict;
2use warnings;
3use utf8;
4use Test::More;
5use Benchmark ':hireswallclock';
6use lib 'lib', '../lib';
7
8use File::Basename 'dirname';
9use File::Spec::Functions 'catdir';
10
Akrone4c2e412016-01-28 15:10:50 +010011use_ok('KorAP::XML::Krill');
Nils Diewald8e323ee2014-04-23 17:28:14 +000012
13# WPD/00001
Akron9c0488f2016-01-28 14:17:15 +010014my $path = catdir(dirname(__FILE__), 'corpus/WPD/00001');
Akrone4c2e412016-01-28 15:10:50 +010015ok(my $doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000016like($doc->path, qr!$path/!, 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +000017
Akrone4c2e412016-01-28 15:10:50 +010018ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000019like($doc->path, qr!$path/$!, 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +000020
21ok($doc->parse, 'Parse document');
22
23# Metdata
Nils Diewaldfeccbb12015-06-18 20:06:45 +000024is($doc->text_sigle, 'WPD_AAA.00001', 'ID');
25
Nils Diewald8e323ee2014-04-23 17:28:14 +000026is($doc->title, 'A', 'title');
27ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000028is($doc->corpus_sigle, 'WPD', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +000029is($doc->pub_date, '20050328', 'pubDate');
30is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubPlace');
31is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
32is($doc->text_class->[1], 'reisen', 'TextClass');
33is($doc->text_class->[2], 'wissenschaft', 'TextClass');
34is($doc->text_class->[3], 'populaerwissenschaft', 'TextClass');
35ok(!$doc->text_class->[4], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000036is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
37
38#is($doc->author->[0], 'Ruru', 'author');
39#is($doc->author->[1], 'Jens.Ol', 'author');
40#is($doc->author->[2], 'Aglarech', 'author');
41#ok(!$doc->author->[3], 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000042
43# Additional information
Nils Diewaldfeccbb12015-06-18 20:06:45 +000044ok(!$doc->editor, 'Editor');
Nils Diewald8e323ee2014-04-23 17:28:14 +000045is($doc->publisher, 'Wikipedia', 'Publisher');
46is($doc->creation_date, '20050000', 'Creation date');
Nils Diewald8e323ee2014-04-23 17:28:14 +000047ok(!$doc->text_type, 'No text_type');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000048ok(!$doc->text_type_art, 'no text_type art');
49ok(!$doc->text_type_ref, 'no text_type ref');
50ok(!$doc->text_domain, 'no text_domain');
51ok(!$doc->text_column, 'no text_column');
52ok(!$doc->keywords_string, 'no keywords');
53is($doc->text_class_string, 'freizeit-unterhaltung reisen wissenschaft populaerwissenschaft', 'no text classes');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000054
55#is($doc->coll_title, 'Wikipedia', 'Collection title');
56#is($doc->coll_sub_title, 'Die freie Enzyklopädie', 'Collection subtitle');
57#is($doc->coll_editor, 'wikipedia.org', 'Collection editor');
58#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000059
Nils Diewald8e323ee2014-04-23 17:28:14 +000060# A01/13047
Akron9c0488f2016-01-28 14:17:15 +010061$path = catdir(dirname(__FILE__), 'corpus/A01/13047');
Akrone4c2e412016-01-28 15:10:50 +010062ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +000063
64ok($doc->parse, 'Parse document');
65is($doc->title, 'Fischer und Kolp im Sonnenhügel', 'title');
66ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000067is($doc->text_sigle, 'A01_APR.13047', 'ID');
68is($doc->corpus_sigle, 'A01', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +000069is($doc->pub_date, '20010402', 'pubDate');
70ok(!$doc->pub_place, 'pubPlace');
71is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
72is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass');
73ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000074ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000075
76# Additional information
77ok(!$doc->editor, 'Editor');
78ok(!$doc->publisher, 'Publisher');
79is($doc->creation_date, '20010402', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000080#ok(!$doc->coll_title, 'Collection title');
81#ok(!$doc->coll_sub_title, 'Collection subtitle');
82#ok(!$doc->coll_editor, 'Collection editor');
83#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000084ok(!$doc->text_type, 'text_type');
85is($doc->text_type_art, 'Bericht', 'text_type art');
86
Nils Diewald8e323ee2014-04-23 17:28:14 +000087# ERL/0001
Akron9c0488f2016-01-28 14:17:15 +010088$path = catdir(dirname(__FILE__), 'corpus/ERL/00001');
Akrone4c2e412016-01-28 15:10:50 +010089ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +000090
91ok($doc->parse, 'Parse document');
Akron9c0488f2016-01-28 14:17:15 +010092is($doc->title, 'Amtsblatt des Landesbezirks Baden [diverse Erlasse]', 'title'); # Amtsblatt des Landesbezirks Baden [diverse Erlasse]
Akrona8665782016-01-27 21:47:57 +010093# MK2/ERL.00001
Nils Diewaldfeccbb12015-06-18 20:06:45 +000094
Nils Diewald8e323ee2014-04-23 17:28:14 +000095ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000096is($doc->text_sigle, 'MK2_ERL.00001', 'ID');
97is($doc->corpus_sigle, 'MK2', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +000098is($doc->pub_date, '00000000', 'pubDate');
99is($doc->pub_place, 'Karlsruhe', 'pubPlace');
100is($doc->text_class->[0], 'politik', 'TextClass');
101is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
102ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000103ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000104
105# Additional information
106ok(!$doc->editor, 'Editor');
107is($doc->publisher, 'Badenia Verlag und Druckerei', 'Publisher');
Nils Diewald840c9242014-10-28 19:51:26 +0000108is($doc->creation_date, '19600000', 'Creation date');
Akrona8665782016-01-27 21:47:57 +0100109
110# !!!
111# diag 'Non-acceptance of creation date ranges may be temporary';
112
113
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000114#ok(!$doc->coll_title, 'Collection title');
115#ok(!$doc->coll_sub_title, 'Collection subtitle');
116#ok(!$doc->coll_editor, 'Collection editor');
117#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000118is($doc->text_type, 'Erlass', 'text_type');
119ok(!$doc->text_type_art, 'text_type art');
120
Nils Diewald8e323ee2014-04-23 17:28:14 +0000121# A01/02035-substring
Akron9c0488f2016-01-28 14:17:15 +0100122$path = catdir(dirname(__FILE__), 'corpus/A00/02035-substring');
Akrone4c2e412016-01-28 15:10:50 +0100123ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000124
125ok($doc->parse, 'Parse document');
Akrona8665782016-01-27 21:47:57 +0100126is($doc->title, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035
Nils Diewald8e323ee2014-04-23 17:28:14 +0000127ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000128is($doc->text_sigle, 'A00_JAN.02035', 'ID');
129is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000130is($doc->pub_date, '20000111', 'pubDate');
131ok(!$doc->pub_place, 'pubPlace');
132is($doc->text_class->[0], 'sport', 'TextClass');
133is($doc->text_class->[1], 'ballsport', 'TextClass');
134ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000135ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000136
137# Additional information
138ok(!$doc->editor, 'Editor');
139ok(!$doc->publisher, 'Publisher');
140is($doc->creation_date, "20000111", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000141#ok(!$doc->coll_title, 'Collection title');
142#ok(!$doc->coll_sub_title, 'Collection subtitle');
143#ok(!$doc->coll_editor, 'Collection editor');
144#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000145ok(!$doc->text_type, 'text_type');
146is($doc->text_type_art, 'Bericht', 'text_type art');
147
Nils Diewald8e323ee2014-04-23 17:28:14 +0000148# A01/02873-meta
Akron9c0488f2016-01-28 14:17:15 +0100149$path = catdir(dirname(__FILE__), 'corpus/A00/02873-meta');
Akrone4c2e412016-01-28 15:10:50 +0100150ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000151
152ok($doc->parse, 'Parse document');
153is($doc->title, 'Tradition und Moderne', 'title');
154ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000155is($doc->text_sigle, 'A00_JAN.02873', 'ID');
156is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000157is($doc->pub_date, '20000113', 'pubDate');
158ok(!$doc->pub_place, 'pubPlace');
159is($doc->text_class->[0], 'kultur', 'TextClass');
160is($doc->text_class->[1], 'film', 'TextClass');
161ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000162ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000163
Akrona8665782016-01-27 21:47:57 +0100164
Nils Diewald8e323ee2014-04-23 17:28:14 +0000165# Additional information
166ok(!$doc->editor, 'Editor');
167ok(!$doc->publisher, 'Publisher');
168is($doc->creation_date, "20000113", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000169#ok(!$doc->coll_title, 'Collection title');
170#ok(!$doc->coll_sub_title, 'Collection subtitle');
171#ok(!$doc->coll_editor, 'Collection editor');
172#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000173ok(!$doc->text_type, 'text_type');
174is($doc->text_type_art, 'Bericht', 'text_type art');
175
176
177# A01/05663-unbalanced
Akron9c0488f2016-01-28 14:17:15 +0100178$path = catdir(dirname(__FILE__), 'corpus/A00/05663-unbalanced');
Akrone4c2e412016-01-28 15:10:50 +0100179ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000180
181ok($doc->parse, 'Parse document');
182is($doc->title, 'Mehr Arbeitslose im Dezember', 'title');
183ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000184is($doc->text_sigle, 'A00_JAN.05663', 'ID');
185is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000186is($doc->pub_date, '20000124', 'pubDate');
187ok(!$doc->pub_place, 'pubPlace');
188is($doc->text_class->[0], 'gesundheit-ernaehrung', 'TextClass');
189is($doc->text_class->[1], 'gesundheit', 'TextClass');
190ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000191ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000192
Akrona8665782016-01-27 21:47:57 +0100193
Nils Diewald8e323ee2014-04-23 17:28:14 +0000194# Additional information
195ok(!$doc->editor, 'Editor');
196ok(!$doc->publisher, 'Publisher');
197is($doc->creation_date, "20000124", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000198#ok(!$doc->coll_title, 'Collection title');
199#ok(!$doc->coll_sub_title, 'Collection subtitle');
200#ok(!$doc->coll_editor, 'Collection editor');
201#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000202ok(!$doc->text_type, 'text_type');
203is($doc->text_type_art, 'Bericht', 'text_type art');
204
205
Nils Diewald8e323ee2014-04-23 17:28:14 +0000206# A01/07452-deep
Akron9c0488f2016-01-28 14:17:15 +0100207$path = catdir(dirname(__FILE__), 'corpus/A00/07452-deep');
Akrone4c2e412016-01-28 15:10:50 +0100208ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000209
210ok($doc->parse, 'Parse document');
211is($doc->title, 'Wil im Dezember 1999', 'title');
212ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000213is($doc->text_sigle, 'A00_JAN.07452', 'ID');
214is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000215is($doc->pub_date, '20000129', 'pubDate');
216ok(!$doc->pub_place, 'pubPlace');
217is($doc->text_class->[0], 'politik', 'TextClass');
218is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
219ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000220ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000221
Akrona8665782016-01-27 21:47:57 +0100222
Nils Diewald8e323ee2014-04-23 17:28:14 +0000223# Additional information
224ok(!$doc->editor, 'Editor');
225ok(!$doc->publisher, 'Publisher');
226is($doc->creation_date, "20000129", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000227#ok(!$doc->coll_title, 'Collection title');
228#ok(!$doc->coll_sub_title, 'Collection subtitle');
229#ok(!$doc->coll_editor, 'Collection editor');
230#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000231ok(!$doc->text_type, 'text_type');
232is($doc->text_type_art, 'Bericht', 'text_type art');
233
Nils Diewald98767bb2014-04-25 20:31:19 +0000234# ART
Akron9c0488f2016-01-28 14:17:15 +0100235$path = catdir(dirname(__FILE__), 'corpus/artificial');
Akrone4c2e412016-01-28 15:10:50 +0100236ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000237#is($doc->path, $path . '/', 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000238
Akrone4c2e412016-01-28 15:10:50 +0100239ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000240#is($doc->path, $path . '/', 'Path');
Nils Diewald98767bb2014-04-25 20:31:19 +0000241
242ok($doc->parse, 'Parse document');
243
244# Metdata
245is($doc->title, 'Artificial Title', 'title');
246is($doc->sub_title, 'Artificial Subtitle', 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000247is($doc->text_sigle, 'ART_ABC.00001', 'ID');
248is($doc->corpus_sigle, 'ART', 'corpusID');
Nils Diewald98767bb2014-04-25 20:31:19 +0000249is($doc->pub_date, '20010402', 'pubDate');
250is($doc->pub_place, 'Mannheim', 'pubPlace');
Akrona8665782016-01-27 21:47:57 +0100251is($doc->pub_place_key, 'DE', 'pubPlace key');
Nils Diewald98767bb2014-04-25 20:31:19 +0000252is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
253is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass');
254ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000255#is($doc->author->[0], 'Ruru', 'author');
256#is($doc->author->[1], 'Jens.Ol', 'author');
257#is($doc->author->[2], 'Aglarech', 'author');
258is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000259
260# Additional information
261is($doc->editor, 'Nils Diewald', 'Editor');
262is($doc->publisher, 'Artificial articles Inc.', 'Publisher');
263is($doc->creation_date, '19990601', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000264#is($doc->coll_title, 'Artificial articles', 'Collection title');
265#is($doc->coll_sub_title, 'Best of!', 'Collection subtitle');
266#is($doc->coll_editor, 'Nils Diewald', 'Collection editor');
267#is($doc->coll_author, 'Nils Diewald', 'Collection author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000268is($doc->text_type, 'Zeitung: Tageszeitung', 'No text_type');
269is($doc->text_type_art, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000270
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000271# Multipath headers
Akron9c0488f2016-01-28 14:17:15 +0100272$path = catdir(dirname(__FILE__), 'corpus/VDI/JAN/00001');
Akrone4c2e412016-01-28 15:10:50 +0100273ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000274like($doc->path, qr!$path/!, 'Path');
275
Akrone4c2e412016-01-28 15:10:50 +0100276ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000277like($doc->path, qr!$path/$!, 'Path');
278
279ok($doc->parse, 'Parse document');
Akrona8665782016-01-27 21:47:57 +0100280
281
282is($doc->text_sigle, 'VDI14_JAN.00001', 'text sigle');
283is($doc->doc_sigle, 'VDI14_JAN', 'doc sigle');
284is($doc->corpus_sigle, 'VDI14', 'corpus sigle');
285
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000286is($doc->title, '10- Zz mit Zahl', 'title');
Akrona8665782016-01-27 21:47:57 +0100287
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000288ok(!$doc->sub_title, 'subtitle');
289is($doc->pub_date, '20140117', 'pubdate');
290is($doc->pub_place, 'Düsseldorf', 'pubplace');
291is($doc->author, 'Windhövel, Kerstin', 'author');
292is($doc->publisher, 'VDI Verlag GmbH', 'publisher');
293ok(!$doc->editor, 'editor');
294
295ok(!$doc->text_type, 'text type');
296ok(!$doc->text_type_art, 'text type art');
297ok(!$doc->text_type_ref, 'text type ref');
298ok(!$doc->text_column, 'text column');
299ok(!$doc->text_domain, 'text domain');
300ok(!$doc->creation_date, 'creation date');
301ok(!$doc->license, 'License');
302ok(!$doc->pages, 'Pages');
303ok(!$doc->file_edition_statement, 'file edition statement');
304ok(!$doc->bibl_edition_statement, 'bibl edition statement');
305is($doc->reference, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference');
306
307ok(!$doc->language, 'Language');
Akrona8665782016-01-27 21:47:57 +0100308# !!!
309# diag 'This may be "de" in the future';
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000310
311is($doc->doc_title, 'VDI nachrichten, Januar 2014', 'Doc title');
312ok(!$doc->doc_sub_title, 'Doc Sub title');
313ok(!$doc->doc_editor, 'Doc editor');
314ok(!$doc->doc_author, 'Doc author');
315
Akron9c0488f2016-01-28 14:17:15 +0100316is($doc->corpus_title, 'VDI nachrichten', 'Corpus title');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000317ok(!$doc->corpus_sub_title, 'Corpus Sub title');
Akron9c0488f2016-01-28 14:17:15 +0100318is($doc->corpus_editor, 'Verein Deutscher Ingenieure', 'Corpus editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000319ok(!$doc->corpus_author, 'Corpus author');
320
321is($doc->keywords_string, '', 'Keywords');
322is($doc->text_class_string, 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class');
323
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000324# WDD
Akron9c0488f2016-01-28 14:17:15 +0100325$path = catdir(dirname(__FILE__), 'corpus/WDD/G27/38989');
Akrone4c2e412016-01-28 15:10:50 +0100326ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000327like($doc->path, qr!$path/!, 'Path');
328ok($doc->parse, 'Parse document');
329
330is($doc->text_sigle, 'WDD11_G27.38989', 'text sigle');
331is($doc->doc_sigle, 'WDD11_G27', 'doc sigle');
332is($doc->corpus_sigle, 'WDD11', 'corpus sigle');
333
334is($doc->title, 'Diskussion:Gunter A. Pilz', 'title');
335ok(!$doc->sub_title, 'subtitle');
336is($doc->pub_date, '20111029', 'pubdate');
337is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubplace');
338
339is($doc->author, '€pa, u.a.', 'author');
340is($doc->publisher, 'Wikipedia', 'publisher');
341ok(!$doc->editor, 'editor');
342
343is($doc->text_type, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type');
344ok(!$doc->text_type_art, 'text type art');
345ok(!$doc->text_type_ref, 'text type ref');
346ok(!$doc->text_column, 'text column');
347ok(!$doc->text_domain, 'text domain');
348
349is($doc->creation_date, '20070707', 'creation date');
350is($doc->license, 'CC-BY-SA', 'License');
351ok(!$doc->pages, 'Pages');
352ok(!$doc->file_edition_statement, 'file edition statement');
353ok(!$doc->bibl_edition_statement, 'bibl edition statement');
354is($doc->reference, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference');
355
356is($doc->language, 'de', 'Language');
357
358is($doc->doc_title, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title');
359ok(!$doc->doc_sub_title, 'Doc Sub title');
360ok(!$doc->doc_editor, 'Doc editor');
361ok(!$doc->doc_author, 'Doc author');
362
Akron9c0488f2016-01-28 14:17:15 +0100363is($doc->corpus_title, 'Wikipedia', 'Corpus title');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000364ok(!$doc->corpus_sub_title, 'Corpus Sub title');
Akron9c0488f2016-01-28 14:17:15 +0100365is($doc->corpus_editor, 'wikipedia.org', 'Corpus editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000366ok(!$doc->corpus_author, 'Corpus author');
367
368is($doc->keywords_string, '', 'Keywords');
369is($doc->text_class_string, '', 'Text class');
370
Akrona8665782016-01-27 21:47:57 +0100371
372is($doc->availability, 'CC-BY-SA', 'Availability');
373
374
Nils Diewald8e323ee2014-04-23 17:28:14 +0000375done_testing;
376__END__