blob: 3aa0f34203c74f0782e514e864906951c11fd222 [file] [log] [blame]
Nils Diewald8e323ee2014-04-23 17:28:14 +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';
10
11use File::Basename 'dirname';
12use File::Spec::Functions 'catdir';
13
Nils Diewald19205712015-06-18 20:06:45 +000014# TODO: Make 'text' -> 'primaryText'
15
Nils Diewald8e323ee2014-04-23 17:28:14 +000016use_ok('KorAP::Document');
17
18# WPD/00001
19my $path = catdir(dirname(__FILE__), 'WPD/00001');
20ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald19205712015-06-18 20:06:45 +000021like($doc->path, qr!$path/!, 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +000022
23ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document');
Nils Diewald19205712015-06-18 20:06:45 +000024like($doc->path, qr!$path/$!, 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +000025
26ok($doc->parse, 'Parse document');
27
28# Metdata
Nils Diewald19205712015-06-18 20:06:45 +000029is($doc->text_sigle, 'WPD_AAA.00001', 'ID');
30
Nils Diewald8e323ee2014-04-23 17:28:14 +000031is($doc->title, 'A', 'title');
32ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +000033is($doc->corpus_sigle, 'WPD', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +000034is($doc->pub_date, '20050328', 'pubDate');
35is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubPlace');
36is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
37is($doc->text_class->[1], 'reisen', 'TextClass');
38is($doc->text_class->[2], 'wissenschaft', 'TextClass');
39is($doc->text_class->[3], 'populaerwissenschaft', 'TextClass');
40ok(!$doc->text_class->[4], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +000041is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
42
43#is($doc->author->[0], 'Ruru', 'author');
44#is($doc->author->[1], 'Jens.Ol', 'author');
45#is($doc->author->[2], 'Aglarech', 'author');
46#ok(!$doc->author->[3], 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000047
48# Additional information
Nils Diewald19205712015-06-18 20:06:45 +000049ok(!$doc->editor, 'Editor');
Nils Diewald8e323ee2014-04-23 17:28:14 +000050is($doc->publisher, 'Wikipedia', 'Publisher');
51is($doc->creation_date, '20050000', 'Creation date');
Nils Diewald8e323ee2014-04-23 17:28:14 +000052ok(!$doc->text_type, 'No text_type');
Nils Diewald19205712015-06-18 20:06:45 +000053ok(!$doc->text_type_art, 'no text_type art');
54ok(!$doc->text_type_ref, 'no text_type ref');
55ok(!$doc->text_domain, 'no text_domain');
56ok(!$doc->text_column, 'no text_column');
57ok(!$doc->keywords_string, 'no keywords');
58is($doc->text_class_string, 'freizeit-unterhaltung reisen wissenschaft populaerwissenschaft', 'no text classes');
Nils Diewald19205712015-06-18 20:06:45 +000059
60#is($doc->coll_title, 'Wikipedia', 'Collection title');
61#is($doc->coll_sub_title, 'Die freie Enzyklopädie', 'Collection subtitle');
62#is($doc->coll_editor, 'wikipedia.org', 'Collection editor');
63#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000064
65# BRZ13/00001
66$path = catdir(dirname(__FILE__), 'BRZ13/00001');
67ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
68
69ok($doc->parse, 'Parse document');
70is($doc->title, 'Sexueller Missbrauch –„Das schreiende Kind steckt noch tief in mir“', 'title');
71ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +000072is($doc->text_sigle, 'BRZ13_APR.00001', 'ID');
73is($doc->corpus_sigle, 'BRZ13', 'corpusID');
Nils Diewald19205712015-06-18 20:06:45 +000074
Nils Diewald8e323ee2014-04-23 17:28:14 +000075is($doc->pub_date, '20130402', 'pubDate');
76is($doc->pub_place, 'Braunschweig', 'pubPlace');
Nils Diewald19205712015-06-18 20:06:45 +000077
Nils Diewald8e323ee2014-04-23 17:28:14 +000078is($doc->text_class->[0], 'staat-gesellschaft', 'TextClass');
79is($doc->text_class->[1], 'familie-geschlecht', 'TextClass');
80ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +000081ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000082
83# Additional information
84ok(!$doc->editor, 'Editor');
85is($doc->publisher, 'Braunschweiger Zeitungsverlag, Druckhaus Albert Limbach GmbH & Co. KG', 'Publisher');
86is($doc->creation_date, '20130402', 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +000087#is($doc->coll_title, 'Braunschweiger Zeitung', 'Collection title');
88#ok(!$doc->coll_sub_title, 'Collection subtitle');
89#ok(!$doc->coll_editor, 'Collection editor');
90#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000091is($doc->text_type, 'Zeitung: Tageszeitung', 'text_type');
92ok(!$doc->text_type_art, 'text_type art');
93
94# A01/13047
95$path = catdir(dirname(__FILE__), 'A01/13047');
96ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
97
98ok($doc->parse, 'Parse document');
99is($doc->title, 'Fischer und Kolp im Sonnenhügel', 'title');
100ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000101is($doc->text_sigle, 'A01_APR.13047', 'ID');
102is($doc->corpus_sigle, 'A01', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000103is($doc->pub_date, '20010402', 'pubDate');
104ok(!$doc->pub_place, 'pubPlace');
105is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
106is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass');
107ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000108ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000109
110# Additional information
111ok(!$doc->editor, 'Editor');
112ok(!$doc->publisher, 'Publisher');
113is($doc->creation_date, '20010402', 'Creation date');
Nils Diewald19205712015-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 +0000118ok(!$doc->text_type, 'text_type');
119is($doc->text_type_art, 'Bericht', 'text_type art');
120
Nils Diewald8e323ee2014-04-23 17:28:14 +0000121# ERL/0001
122$path = catdir(dirname(__FILE__), 'ERL/00001');
123ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
124
125ok($doc->parse, 'Parse document');
Akron9d8cbc52016-01-27 21:47:57 +0100126is($doc->title, 'Amtsblatt des Landesbezirks Baden [diverse Erlasse], Hrsg. und Schriftleitung: Präsidialstelle der Landesverwaltung Baden in Karlsruhe. - Karlsruhe, o.J.', 'title'); # Amtsblatt des Landesbezirks Baden [diverse Erlasse]
127# MK2/ERL.00001
Nils Diewald19205712015-06-18 20:06:45 +0000128
Nils Diewald8e323ee2014-04-23 17:28:14 +0000129ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000130is($doc->text_sigle, 'MK2_ERL.00001', 'ID');
131is($doc->corpus_sigle, 'MK2', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000132is($doc->pub_date, '00000000', 'pubDate');
133is($doc->pub_place, 'Karlsruhe', 'pubPlace');
134is($doc->text_class->[0], 'politik', 'TextClass');
135is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
136ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000137ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000138
139# Additional information
140ok(!$doc->editor, 'Editor');
141is($doc->publisher, 'Badenia Verlag und Druckerei', 'Publisher');
Nils Diewald7ec51532014-10-28 19:51:26 +0000142is($doc->creation_date, '19600000', 'Creation date');
Akron9d8cbc52016-01-27 21:47:57 +0100143
144# !!!
145# diag 'Non-acceptance of creation date ranges may be temporary';
146
147
Nils Diewald19205712015-06-18 20:06:45 +0000148#ok(!$doc->coll_title, 'Collection title');
149#ok(!$doc->coll_sub_title, 'Collection subtitle');
150#ok(!$doc->coll_editor, 'Collection editor');
151#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000152is($doc->text_type, 'Erlass', 'text_type');
153ok(!$doc->text_type_art, 'text_type art');
154
Nils Diewald8e323ee2014-04-23 17:28:14 +0000155# A01/02035-substring
Akron9d8cbc52016-01-27 21:47:57 +0100156$path = catdir(dirname(__FILE__), 'A00/02035-substring');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000157ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
158
159ok($doc->parse, 'Parse document');
Akron9d8cbc52016-01-27 21:47:57 +0100160is($doc->title, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035
Nils Diewald8e323ee2014-04-23 17:28:14 +0000161ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000162is($doc->text_sigle, 'A00_JAN.02035', 'ID');
163is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000164is($doc->pub_date, '20000111', 'pubDate');
165ok(!$doc->pub_place, 'pubPlace');
166is($doc->text_class->[0], 'sport', 'TextClass');
167is($doc->text_class->[1], 'ballsport', 'TextClass');
168ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000169ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000170
171# Additional information
172ok(!$doc->editor, 'Editor');
173ok(!$doc->publisher, 'Publisher');
174is($doc->creation_date, "20000111", 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +0000175#ok(!$doc->coll_title, 'Collection title');
176#ok(!$doc->coll_sub_title, 'Collection subtitle');
177#ok(!$doc->coll_editor, 'Collection editor');
178#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000179ok(!$doc->text_type, 'text_type');
180is($doc->text_type_art, 'Bericht', 'text_type art');
181
Nils Diewald8e323ee2014-04-23 17:28:14 +0000182# A01/02873-meta
Akron9d8cbc52016-01-27 21:47:57 +0100183$path = catdir(dirname(__FILE__), 'A00/02873-meta');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000184ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
185
186ok($doc->parse, 'Parse document');
187is($doc->title, 'Tradition und Moderne', 'title');
188ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000189is($doc->text_sigle, 'A00_JAN.02873', 'ID');
190is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000191is($doc->pub_date, '20000113', 'pubDate');
192ok(!$doc->pub_place, 'pubPlace');
193is($doc->text_class->[0], 'kultur', 'TextClass');
194is($doc->text_class->[1], 'film', 'TextClass');
195ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000196ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000197
Akron9d8cbc52016-01-27 21:47:57 +0100198
Nils Diewald8e323ee2014-04-23 17:28:14 +0000199# Additional information
200ok(!$doc->editor, 'Editor');
201ok(!$doc->publisher, 'Publisher');
202is($doc->creation_date, "20000113", 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +0000203#ok(!$doc->coll_title, 'Collection title');
204#ok(!$doc->coll_sub_title, 'Collection subtitle');
205#ok(!$doc->coll_editor, 'Collection editor');
206#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000207ok(!$doc->text_type, 'text_type');
208is($doc->text_type_art, 'Bericht', 'text_type art');
209
210
211# A01/05663-unbalanced
Akron9d8cbc52016-01-27 21:47:57 +0100212$path = catdir(dirname(__FILE__), 'A00/05663-unbalanced');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000213ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
214
215ok($doc->parse, 'Parse document');
216is($doc->title, 'Mehr Arbeitslose im Dezember', 'title');
217ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000218is($doc->text_sigle, 'A00_JAN.05663', 'ID');
219is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000220is($doc->pub_date, '20000124', 'pubDate');
221ok(!$doc->pub_place, 'pubPlace');
222is($doc->text_class->[0], 'gesundheit-ernaehrung', 'TextClass');
223is($doc->text_class->[1], 'gesundheit', 'TextClass');
224ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000225ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000226
Akron9d8cbc52016-01-27 21:47:57 +0100227
Nils Diewald8e323ee2014-04-23 17:28:14 +0000228# Additional information
229ok(!$doc->editor, 'Editor');
230ok(!$doc->publisher, 'Publisher');
231is($doc->creation_date, "20000124", 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +0000232#ok(!$doc->coll_title, 'Collection title');
233#ok(!$doc->coll_sub_title, 'Collection subtitle');
234#ok(!$doc->coll_editor, 'Collection editor');
235#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000236ok(!$doc->text_type, 'text_type');
237is($doc->text_type_art, 'Bericht', 'text_type art');
238
239
Nils Diewald8e323ee2014-04-23 17:28:14 +0000240# A01/07452-deep
Akron9d8cbc52016-01-27 21:47:57 +0100241$path = catdir(dirname(__FILE__), 'A00/07452-deep');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000242ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
243
244ok($doc->parse, 'Parse document');
245is($doc->title, 'Wil im Dezember 1999', 'title');
246ok(!$doc->sub_title, 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000247is($doc->text_sigle, 'A00_JAN.07452', 'ID');
248is($doc->corpus_sigle, 'A00', 'corpusID');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000249is($doc->pub_date, '20000129', 'pubDate');
250ok(!$doc->pub_place, 'pubPlace');
251is($doc->text_class->[0], 'politik', 'TextClass');
252is($doc->text_class->[1], 'kommunalpolitik', 'TextClass');
253ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000254ok(!$doc->author, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000255
Akron9d8cbc52016-01-27 21:47:57 +0100256
Nils Diewald8e323ee2014-04-23 17:28:14 +0000257# Additional information
258ok(!$doc->editor, 'Editor');
259ok(!$doc->publisher, 'Publisher');
260is($doc->creation_date, "20000129", 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +0000261#ok(!$doc->coll_title, 'Collection title');
262#ok(!$doc->coll_sub_title, 'Collection subtitle');
263#ok(!$doc->coll_editor, 'Collection editor');
264#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000265ok(!$doc->text_type, 'text_type');
266is($doc->text_type_art, 'Bericht', 'text_type art');
267
Nils Diewald98767bb2014-04-25 20:31:19 +0000268# ART
269$path = catdir(dirname(__FILE__), 'artificial');
270ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald19205712015-06-18 20:06:45 +0000271#is($doc->path, $path . '/', 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000272
Nils Diewald98767bb2014-04-25 20:31:19 +0000273ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document');
Nils Diewald19205712015-06-18 20:06:45 +0000274#is($doc->path, $path . '/', 'Path');
Nils Diewald98767bb2014-04-25 20:31:19 +0000275
276ok($doc->parse, 'Parse document');
277
278# Metdata
279is($doc->title, 'Artificial Title', 'title');
280is($doc->sub_title, 'Artificial Subtitle', 'subTitle');
Nils Diewald7ec51532014-10-28 19:51:26 +0000281is($doc->text_sigle, 'ART_ABC.00001', 'ID');
282is($doc->corpus_sigle, 'ART', 'corpusID');
Nils Diewald98767bb2014-04-25 20:31:19 +0000283is($doc->pub_date, '20010402', 'pubDate');
284is($doc->pub_place, 'Mannheim', 'pubPlace');
Akron9d8cbc52016-01-27 21:47:57 +0100285is($doc->pub_place_key, 'DE', 'pubPlace key');
Nils Diewald98767bb2014-04-25 20:31:19 +0000286is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass');
287is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass');
288ok(!$doc->text_class->[2], 'TextClass');
Nils Diewald19205712015-06-18 20:06:45 +0000289#is($doc->author->[0], 'Ruru', 'author');
290#is($doc->author->[1], 'Jens.Ol', 'author');
291#is($doc->author->[2], 'Aglarech', 'author');
292is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000293
294# Additional information
295is($doc->editor, 'Nils Diewald', 'Editor');
296is($doc->publisher, 'Artificial articles Inc.', 'Publisher');
297is($doc->creation_date, '19990601', 'Creation date');
Nils Diewald19205712015-06-18 20:06:45 +0000298#is($doc->coll_title, 'Artificial articles', 'Collection title');
299#is($doc->coll_sub_title, 'Best of!', 'Collection subtitle');
300#is($doc->coll_editor, 'Nils Diewald', 'Collection editor');
301#is($doc->coll_author, 'Nils Diewald', 'Collection author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000302is($doc->text_type, 'Zeitung: Tageszeitung', 'No text_type');
303is($doc->text_type_art, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000304
Nils Diewald19205712015-06-18 20:06:45 +0000305# Multipath headers
306$path = catdir(dirname(__FILE__), 'VDI/JAN/00001');
307ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
308like($doc->path, qr!$path/!, 'Path');
309
310ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document');
311like($doc->path, qr!$path/$!, 'Path');
312
313ok($doc->parse, 'Parse document');
Akron9d8cbc52016-01-27 21:47:57 +0100314
315
316is($doc->text_sigle, 'VDI14_JAN.00001', 'text sigle');
317is($doc->doc_sigle, 'VDI14_JAN', 'doc sigle');
318is($doc->corpus_sigle, 'VDI14', 'corpus sigle');
319
Nils Diewald19205712015-06-18 20:06:45 +0000320is($doc->title, '10- Zz mit Zahl', 'title');
Akron9d8cbc52016-01-27 21:47:57 +0100321
Nils Diewald19205712015-06-18 20:06:45 +0000322ok(!$doc->sub_title, 'subtitle');
323is($doc->pub_date, '20140117', 'pubdate');
324is($doc->pub_place, 'Düsseldorf', 'pubplace');
325is($doc->author, 'Windhövel, Kerstin', 'author');
326is($doc->publisher, 'VDI Verlag GmbH', 'publisher');
327ok(!$doc->editor, 'editor');
328
329ok(!$doc->text_type, 'text type');
330ok(!$doc->text_type_art, 'text type art');
331ok(!$doc->text_type_ref, 'text type ref');
332ok(!$doc->text_column, 'text column');
333ok(!$doc->text_domain, 'text domain');
334ok(!$doc->creation_date, 'creation date');
335ok(!$doc->license, 'License');
336ok(!$doc->pages, 'Pages');
337ok(!$doc->file_edition_statement, 'file edition statement');
338ok(!$doc->bibl_edition_statement, 'bibl edition statement');
339is($doc->reference, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference');
340
341ok(!$doc->language, 'Language');
Akron9d8cbc52016-01-27 21:47:57 +0100342# !!!
343# diag 'This may be "de" in the future';
Nils Diewald19205712015-06-18 20:06:45 +0000344
345is($doc->doc_title, 'VDI nachrichten, Januar 2014', 'Doc title');
346ok(!$doc->doc_sub_title, 'Doc Sub title');
347ok(!$doc->doc_editor, 'Doc editor');
348ok(!$doc->doc_author, 'Doc author');
349
350is($doc->corpus_title, 'VDI nachrichten 2014', 'Corpus title');
351ok(!$doc->corpus_sub_title, 'Corpus Sub title');
352ok(!$doc->corpus_editor, 'Corpus editor');
353ok(!$doc->corpus_author, 'Corpus author');
354
355is($doc->keywords_string, '', 'Keywords');
356is($doc->text_class_string, 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class');
357
Nils Diewald19205712015-06-18 20:06:45 +0000358# WDD
359$path = catdir(dirname(__FILE__), 'WDD/G27/38989');
360ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
361like($doc->path, qr!$path/!, 'Path');
362ok($doc->parse, 'Parse document');
363
364is($doc->text_sigle, 'WDD11_G27.38989', 'text sigle');
365is($doc->doc_sigle, 'WDD11_G27', 'doc sigle');
366is($doc->corpus_sigle, 'WDD11', 'corpus sigle');
367
368is($doc->title, 'Diskussion:Gunter A. Pilz', 'title');
369ok(!$doc->sub_title, 'subtitle');
370is($doc->pub_date, '20111029', 'pubdate');
371is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubplace');
372
373is($doc->author, '€pa, u.a.', 'author');
374is($doc->publisher, 'Wikipedia', 'publisher');
375ok(!$doc->editor, 'editor');
376
377is($doc->text_type, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type');
378ok(!$doc->text_type_art, 'text type art');
379ok(!$doc->text_type_ref, 'text type ref');
380ok(!$doc->text_column, 'text column');
381ok(!$doc->text_domain, 'text domain');
382
383is($doc->creation_date, '20070707', 'creation date');
384is($doc->license, 'CC-BY-SA', 'License');
385ok(!$doc->pages, 'Pages');
386ok(!$doc->file_edition_statement, 'file edition statement');
387ok(!$doc->bibl_edition_statement, 'bibl edition statement');
388is($doc->reference, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference');
389
390is($doc->language, 'de', 'Language');
391
392is($doc->doc_title, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title');
393ok(!$doc->doc_sub_title, 'Doc Sub title');
394ok(!$doc->doc_editor, 'Doc editor');
395ok(!$doc->doc_author, 'Doc author');
396
397is($doc->corpus_title, 'Wikipedia.de 2011 Diskussionen', 'Corpus title');
398ok(!$doc->corpus_sub_title, 'Corpus Sub title');
399ok(!$doc->corpus_editor, 'Corpus editor');
400ok(!$doc->corpus_author, 'Corpus author');
401
402is($doc->keywords_string, '', 'Keywords');
403is($doc->text_class_string, '', 'Text class');
404
Akron9d8cbc52016-01-27 21:47:57 +0100405
406is($doc->availability, 'CC-BY-SA', 'Availability');
407
408
Nils Diewald8e323ee2014-04-23 17:28:14 +0000409done_testing;
410__END__