blob: 51eb2bed57062e52d69ef7d35dc03f41fc02a348 [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
60# BRZ13/00001
Akron9c0488f2016-01-28 14:17:15 +010061$path = catdir(dirname(__FILE__), 'corpus/BRZ13/00001');
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, 'Sexueller Missbrauch –„Das schreiende Kind steckt noch tief in mir“', 'title');
66ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000067is($doc->text_sigle, 'BRZ13_APR.00001', 'ID');
68is($doc->corpus_sigle, 'BRZ13', 'corpusID');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000069
Nils Diewald8e323ee2014-04-23 17:28:14 +000070is($doc->pub_date, '20130402', 'pubDate');
71is($doc->pub_place, 'Braunschweig', 'pubPlace');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000072
Nils Diewald8e323ee2014-04-23 17:28:14 +000073is($doc->text_class->[0], 'staat-gesellschaft', 'TextClass');
74is($doc->text_class->[1], 'familie-geschlecht', 'TextClass');
75ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000076ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000077
78# Additional information
79ok(!$doc->editor, 'Editor');
80is($doc->publisher, 'Braunschweiger Zeitungsverlag, Druckhaus Albert Limbach GmbH & Co. KG', 'Publisher');
81is($doc->creation_date, '20130402', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000082#is($doc->coll_title, 'Braunschweiger Zeitung', 'Collection title');
83#ok(!$doc->coll_sub_title, 'Collection subtitle');
84#ok(!$doc->coll_editor, 'Collection editor');
85#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000086is($doc->text_type, 'Zeitung: Tageszeitung', 'text_type');
87ok(!$doc->text_type_art, 'text_type art');
88
89# A01/13047
Akron9c0488f2016-01-28 14:17:15 +010090$path = catdir(dirname(__FILE__), 'corpus/A01/13047');
Akrone4c2e412016-01-28 15:10:50 +010091ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +000092
93ok($doc->parse, 'Parse document');
94is($doc->title, 'Fischer und Kolp im Sonnenhügel', 'title');
95ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000096is($doc->text_sigle, 'A01_APR.13047', 'ID');
97is($doc->corpus_sigle, 'A01', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +000098is($doc->pub_date, '20010402', 'pubDate');
99ok(!$doc->pub_place, 'pubPlace');
100is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
101is($doc->text_class->[1], 'vereine-veranstaltungen', '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');
107ok(!$doc->publisher, 'Publisher');
108is($doc->creation_date, '20010402', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000109#ok(!$doc->coll_title, 'Collection title');
110#ok(!$doc->coll_sub_title, 'Collection subtitle');
111#ok(!$doc->coll_editor, 'Collection editor');
112#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000113ok(!$doc->text_type, 'text_type');
114is($doc->text_type_art, 'Bericht', 'text_type art');
115
Nils Diewald8e323ee2014-04-23 17:28:14 +0000116# ERL/0001
Akron9c0488f2016-01-28 14:17:15 +0100117$path = catdir(dirname(__FILE__), 'corpus/ERL/00001');
Akrone4c2e412016-01-28 15:10:50 +0100118ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000119
120ok($doc->parse, 'Parse document');
Akron9c0488f2016-01-28 14:17:15 +0100121is($doc->title, 'Amtsblatt des Landesbezirks Baden [diverse Erlasse]', 'title'); # Amtsblatt des Landesbezirks Baden [diverse Erlasse]
Akrona8665782016-01-27 21:47:57 +0100122# MK2/ERL.00001
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000123
Nils Diewald8e323ee2014-04-23 17:28:14 +0000124ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000125is($doc->text_sigle, 'MK2_ERL.00001', 'ID');
126is($doc->corpus_sigle, 'MK2', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000127is($doc->pub_date, '00000000', 'pubDate');
128is($doc->pub_place, 'Karlsruhe', 'pubPlace');
129is($doc->text_class->[0], 'politik', 'TextClass');
130is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
131ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000132ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000133
134# Additional information
135ok(!$doc->editor, 'Editor');
136is($doc->publisher, 'Badenia Verlag und Druckerei', 'Publisher');
Nils Diewald840c9242014-10-28 19:51:26 +0000137is($doc->creation_date, '19600000', 'Creation date');
Akrona8665782016-01-27 21:47:57 +0100138
139# !!!
140# diag 'Non-acceptance of creation date ranges may be temporary';
141
142
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000143#ok(!$doc->coll_title, 'Collection title');
144#ok(!$doc->coll_sub_title, 'Collection subtitle');
145#ok(!$doc->coll_editor, 'Collection editor');
146#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000147is($doc->text_type, 'Erlass', 'text_type');
148ok(!$doc->text_type_art, 'text_type art');
149
Nils Diewald8e323ee2014-04-23 17:28:14 +0000150# A01/02035-substring
Akron9c0488f2016-01-28 14:17:15 +0100151$path = catdir(dirname(__FILE__), 'corpus/A00/02035-substring');
Akrone4c2e412016-01-28 15:10:50 +0100152ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000153
154ok($doc->parse, 'Parse document');
Akrona8665782016-01-27 21:47:57 +0100155is($doc->title, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035
Nils Diewald8e323ee2014-04-23 17:28:14 +0000156ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000157is($doc->text_sigle, 'A00_JAN.02035', 'ID');
158is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000159is($doc->pub_date, '20000111', 'pubDate');
160ok(!$doc->pub_place, 'pubPlace');
161is($doc->text_class->[0], 'sport', 'TextClass');
162is($doc->text_class->[1], 'ballsport', 'TextClass');
163ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000164ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000165
166# Additional information
167ok(!$doc->editor, 'Editor');
168ok(!$doc->publisher, 'Publisher');
169is($doc->creation_date, "20000111", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000170#ok(!$doc->coll_title, 'Collection title');
171#ok(!$doc->coll_sub_title, 'Collection subtitle');
172#ok(!$doc->coll_editor, 'Collection editor');
173#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000174ok(!$doc->text_type, 'text_type');
175is($doc->text_type_art, 'Bericht', 'text_type art');
176
Nils Diewald8e323ee2014-04-23 17:28:14 +0000177# A01/02873-meta
Akron9c0488f2016-01-28 14:17:15 +0100178$path = catdir(dirname(__FILE__), 'corpus/A00/02873-meta');
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, 'Tradition und Moderne', 'title');
183ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000184is($doc->text_sigle, 'A00_JAN.02873', 'ID');
185is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000186is($doc->pub_date, '20000113', 'pubDate');
187ok(!$doc->pub_place, 'pubPlace');
188is($doc->text_class->[0], 'kultur', 'TextClass');
189is($doc->text_class->[1], 'film', '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, "20000113", '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
206# A01/05663-unbalanced
Akron9c0488f2016-01-28 14:17:15 +0100207$path = catdir(dirname(__FILE__), 'corpus/A00/05663-unbalanced');
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, 'Mehr Arbeitslose im Dezember', 'title');
212ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000213is($doc->text_sigle, 'A00_JAN.05663', 'ID');
214is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000215is($doc->pub_date, '20000124', 'pubDate');
216ok(!$doc->pub_place, 'pubPlace');
217is($doc->text_class->[0], 'gesundheit-ernaehrung', 'TextClass');
218is($doc->text_class->[1], 'gesundheit', '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, "20000124", '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
234
Nils Diewald8e323ee2014-04-23 17:28:14 +0000235# A01/07452-deep
Akron9c0488f2016-01-28 14:17:15 +0100236$path = catdir(dirname(__FILE__), 'corpus/A00/07452-deep');
Akrone4c2e412016-01-28 15:10:50 +0100237ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000238
239ok($doc->parse, 'Parse document');
240is($doc->title, 'Wil im Dezember 1999', 'title');
241ok(!$doc->sub_title, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000242is($doc->text_sigle, 'A00_JAN.07452', 'ID');
243is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000244is($doc->pub_date, '20000129', 'pubDate');
245ok(!$doc->pub_place, 'pubPlace');
246is($doc->text_class->[0], 'politik', 'TextClass');
247is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
248ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000249ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000250
Akrona8665782016-01-27 21:47:57 +0100251
Nils Diewald8e323ee2014-04-23 17:28:14 +0000252# Additional information
253ok(!$doc->editor, 'Editor');
254ok(!$doc->publisher, 'Publisher');
255is($doc->creation_date, "20000129", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000256#ok(!$doc->coll_title, 'Collection title');
257#ok(!$doc->coll_sub_title, 'Collection subtitle');
258#ok(!$doc->coll_editor, 'Collection editor');
259#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000260ok(!$doc->text_type, 'text_type');
261is($doc->text_type_art, 'Bericht', 'text_type art');
262
Nils Diewald98767bb2014-04-25 20:31:19 +0000263# ART
Akron9c0488f2016-01-28 14:17:15 +0100264$path = catdir(dirname(__FILE__), 'corpus/artificial');
Akrone4c2e412016-01-28 15:10:50 +0100265ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000266#is($doc->path, $path . '/', 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000267
Akrone4c2e412016-01-28 15:10:50 +0100268ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000269#is($doc->path, $path . '/', 'Path');
Nils Diewald98767bb2014-04-25 20:31:19 +0000270
271ok($doc->parse, 'Parse document');
272
273# Metdata
274is($doc->title, 'Artificial Title', 'title');
275is($doc->sub_title, 'Artificial Subtitle', 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +0000276is($doc->text_sigle, 'ART_ABC.00001', 'ID');
277is($doc->corpus_sigle, 'ART', 'corpusID');
Nils Diewald98767bb2014-04-25 20:31:19 +0000278is($doc->pub_date, '20010402', 'pubDate');
279is($doc->pub_place, 'Mannheim', 'pubPlace');
Akrona8665782016-01-27 21:47:57 +0100280is($doc->pub_place_key, 'DE', 'pubPlace key');
Nils Diewald98767bb2014-04-25 20:31:19 +0000281is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
282is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass');
283ok(!$doc->text_class->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000284#is($doc->author->[0], 'Ruru', 'author');
285#is($doc->author->[1], 'Jens.Ol', 'author');
286#is($doc->author->[2], 'Aglarech', 'author');
287is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000288
289# Additional information
290is($doc->editor, 'Nils Diewald', 'Editor');
291is($doc->publisher, 'Artificial articles Inc.', 'Publisher');
292is($doc->creation_date, '19990601', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000293#is($doc->coll_title, 'Artificial articles', 'Collection title');
294#is($doc->coll_sub_title, 'Best of!', 'Collection subtitle');
295#is($doc->coll_editor, 'Nils Diewald', 'Collection editor');
296#is($doc->coll_author, 'Nils Diewald', 'Collection author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000297is($doc->text_type, 'Zeitung: Tageszeitung', 'No text_type');
298is($doc->text_type_art, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000299
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000300# Multipath headers
Akron9c0488f2016-01-28 14:17:15 +0100301$path = catdir(dirname(__FILE__), 'corpus/VDI/JAN/00001');
Akrone4c2e412016-01-28 15:10:50 +0100302ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000303like($doc->path, qr!$path/!, 'Path');
304
Akrone4c2e412016-01-28 15:10:50 +0100305ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000306like($doc->path, qr!$path/$!, 'Path');
307
308ok($doc->parse, 'Parse document');
Akrona8665782016-01-27 21:47:57 +0100309
310
311is($doc->text_sigle, 'VDI14_JAN.00001', 'text sigle');
312is($doc->doc_sigle, 'VDI14_JAN', 'doc sigle');
313is($doc->corpus_sigle, 'VDI14', 'corpus sigle');
314
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000315is($doc->title, '10- Zz mit Zahl', 'title');
Akrona8665782016-01-27 21:47:57 +0100316
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000317ok(!$doc->sub_title, 'subtitle');
318is($doc->pub_date, '20140117', 'pubdate');
319is($doc->pub_place, 'Düsseldorf', 'pubplace');
320is($doc->author, 'Windhövel, Kerstin', 'author');
321is($doc->publisher, 'VDI Verlag GmbH', 'publisher');
322ok(!$doc->editor, 'editor');
323
324ok(!$doc->text_type, 'text type');
325ok(!$doc->text_type_art, 'text type art');
326ok(!$doc->text_type_ref, 'text type ref');
327ok(!$doc->text_column, 'text column');
328ok(!$doc->text_domain, 'text domain');
329ok(!$doc->creation_date, 'creation date');
330ok(!$doc->license, 'License');
331ok(!$doc->pages, 'Pages');
332ok(!$doc->file_edition_statement, 'file edition statement');
333ok(!$doc->bibl_edition_statement, 'bibl edition statement');
334is($doc->reference, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference');
335
336ok(!$doc->language, 'Language');
Akrona8665782016-01-27 21:47:57 +0100337# !!!
338# diag 'This may be "de" in the future';
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000339
340is($doc->doc_title, 'VDI nachrichten, Januar 2014', 'Doc title');
341ok(!$doc->doc_sub_title, 'Doc Sub title');
342ok(!$doc->doc_editor, 'Doc editor');
343ok(!$doc->doc_author, 'Doc author');
344
Akron9c0488f2016-01-28 14:17:15 +0100345is($doc->corpus_title, 'VDI nachrichten', 'Corpus title');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000346ok(!$doc->corpus_sub_title, 'Corpus Sub title');
Akron9c0488f2016-01-28 14:17:15 +0100347is($doc->corpus_editor, 'Verein Deutscher Ingenieure', 'Corpus editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000348ok(!$doc->corpus_author, 'Corpus author');
349
350is($doc->keywords_string, '', 'Keywords');
351is($doc->text_class_string, 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class');
352
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000353# WDD
Akron9c0488f2016-01-28 14:17:15 +0100354$path = catdir(dirname(__FILE__), 'corpus/WDD/G27/38989');
Akrone4c2e412016-01-28 15:10:50 +0100355ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000356like($doc->path, qr!$path/!, 'Path');
357ok($doc->parse, 'Parse document');
358
359is($doc->text_sigle, 'WDD11_G27.38989', 'text sigle');
360is($doc->doc_sigle, 'WDD11_G27', 'doc sigle');
361is($doc->corpus_sigle, 'WDD11', 'corpus sigle');
362
363is($doc->title, 'Diskussion:Gunter A. Pilz', 'title');
364ok(!$doc->sub_title, 'subtitle');
365is($doc->pub_date, '20111029', 'pubdate');
366is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubplace');
367
368is($doc->author, '€pa, u.a.', 'author');
369is($doc->publisher, 'Wikipedia', 'publisher');
370ok(!$doc->editor, 'editor');
371
372is($doc->text_type, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type');
373ok(!$doc->text_type_art, 'text type art');
374ok(!$doc->text_type_ref, 'text type ref');
375ok(!$doc->text_column, 'text column');
376ok(!$doc->text_domain, 'text domain');
377
378is($doc->creation_date, '20070707', 'creation date');
379is($doc->license, 'CC-BY-SA', 'License');
380ok(!$doc->pages, 'Pages');
381ok(!$doc->file_edition_statement, 'file edition statement');
382ok(!$doc->bibl_edition_statement, 'bibl edition statement');
383is($doc->reference, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference');
384
385is($doc->language, 'de', 'Language');
386
387is($doc->doc_title, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title');
388ok(!$doc->doc_sub_title, 'Doc Sub title');
389ok(!$doc->doc_editor, 'Doc editor');
390ok(!$doc->doc_author, 'Doc author');
391
Akron9c0488f2016-01-28 14:17:15 +0100392is($doc->corpus_title, 'Wikipedia', 'Corpus title');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000393ok(!$doc->corpus_sub_title, 'Corpus Sub title');
Akron9c0488f2016-01-28 14:17:15 +0100394is($doc->corpus_editor, 'wikipedia.org', 'Corpus editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000395ok(!$doc->corpus_author, 'Corpus author');
396
397is($doc->keywords_string, '', 'Keywords');
398is($doc->text_class_string, '', 'Text class');
399
Akrona8665782016-01-27 21:47:57 +0100400
401is($doc->availability, 'CC-BY-SA', 'Availability');
402
403
Nils Diewald8e323ee2014-04-23 17:28:14 +0000404done_testing;
405__END__