blob: a33b25d723d6060a458d8e83b3d171ca22b96293 [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
Akron1cd5b872016-03-22 00:23:46 +010024is($doc->text_sigle, 'WPD/AAA/00001', 'ID');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000025
Akron35db6e32016-03-17 22:42:22 +010026my $meta = $doc->meta;
27is($meta->{title}, 'A', 'title');
28ok(!$meta->{sub_title}, 'subTitle');
Nils Diewald840c9242014-10-28 19:51:26 +000029is($doc->corpus_sigle, 'WPD', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +010030is($meta->{pub_date}, '20050328', 'pubDate');
31is($meta->{pub_place}, 'URL:http://de.wikipedia.org', 'pubPlace');
32is($meta->{text_class}->[0], 'freizeit-unterhaltung', 'TextClass');
33is($meta->{text_class}->[1], 'reisen', 'TextClass');
34is($meta->{text_class}->[2], 'wissenschaft', 'TextClass');
35is($meta->{text_class}->[3], 'populaerwissenschaft', 'TextClass');
36ok(!$meta->{text_class}->[4], 'TextClass');
37is($meta->{author}, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000038
39#is($doc->author->[0], 'Ruru', 'author');
40#is($doc->author->[1], 'Jens.Ol', 'author');
41#is($doc->author->[2], 'Aglarech', 'author');
42#ok(!$doc->author->[3], 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000043
44# Additional information
Akron35db6e32016-03-17 22:42:22 +010045ok(!$meta->{editor}, 'Editor');
46is($meta->{publisher}, 'Wikipedia', 'Publisher');
47is($meta->{creation_date}, '20050000', 'Creation date');
48ok(!$meta->{text_type}, 'No text_type');
49ok(!$meta->{text_type_art}, 'no text_type art');
50ok(!$meta->{text_type_ref}, 'no text_type ref');
51ok(!$meta->{text_domain}, 'no text_domain');
52ok(!$meta->{text_column}, 'no text_column');
53ok(!$meta->keywords('keywords'), 'no keywords');
54is($meta->keywords('text_class'), 'freizeit-unterhaltung reisen wissenschaft populaerwissenschaft', 'no text classes');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000055
56#is($doc->coll_title, 'Wikipedia', 'Collection title');
57#is($doc->coll_sub_title, 'Die freie Enzyklopädie', 'Collection subtitle');
58#is($doc->coll_editor, 'wikipedia.org', 'Collection editor');
59#ok(!$doc->coll_author, 'Collection author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000060
Nils Diewald8e323ee2014-04-23 17:28:14 +000061# A01/13047
Akron9c0488f2016-01-28 14:17:15 +010062$path = catdir(dirname(__FILE__), 'corpus/A01/13047');
Akrone4c2e412016-01-28 15:10:50 +010063ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +000064
65ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +010066$meta = $doc->meta;
67is($meta->{title}, 'Fischer und Kolp im Sonnenhügel', 'title');
68
69ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +010070is($doc->text_sigle, 'A01/APR/13047', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +000071is($doc->corpus_sigle, 'A01', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +010072is($meta->{pub_date}, '20010402', 'pubDate');
73ok(!$meta->{pub_place}, 'pubPlace');
74is($meta->{text_class}->[0], 'freizeit-unterhaltung', 'TextClass');
75is($meta->{text_class}->[1], 'vereine-veranstaltungen', 'TextClass');
76ok(!$meta->{text_class}->[2], 'TextClass');
77ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +000078
79# Additional information
Akron35db6e32016-03-17 22:42:22 +010080ok(!$meta->{editor}, 'Editor');
81ok(!$meta->{publisher}, 'Publisher');
82is($meta->{creation_date}, '20010402', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +000083#ok(!$doc->coll_title, 'Collection title');
84#ok(!$doc->coll_sub_title, 'Collection subtitle');
85#ok(!$doc->coll_editor, 'Collection editor');
86#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +010087ok(!$meta->{text_type}, 'text_type');
88is($meta->{text_type_art}, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +000089
Nils Diewald8e323ee2014-04-23 17:28:14 +000090# ERL/0001
Akron9c0488f2016-01-28 14:17:15 +010091$path = catdir(dirname(__FILE__), 'corpus/ERL/00001');
Akrone4c2e412016-01-28 15:10:50 +010092ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +000093
94ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +010095
96$meta = $doc->meta;
97is($meta->{title}, 'Amtsblatt des Landesbezirks Baden [diverse Erlasse]', 'title'); # Amtsblatt des Landesbezirks Baden [diverse Erlasse]
Akrona8665782016-01-27 21:47:57 +010098# MK2/ERL.00001
Nils Diewaldfeccbb12015-06-18 20:06:45 +000099
Akron35db6e32016-03-17 22:42:22 +0100100ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100101is($doc->text_sigle, 'MK2/ERL/00001', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000102is($doc->corpus_sigle, 'MK2', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100103is($meta->{pub_date}, '00000000', 'pubDate');
104is($meta->{pub_place}, 'Karlsruhe', 'pubPlace');
105is($meta->{text_class}->[0], 'politik', 'TextClass');
106is($meta->{text_class}->[1], 'kommunalpolitik', 'TextClass');
107ok(!$meta->{text_class}->[2], 'TextClass');
108ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000109
110# Additional information
Akron35db6e32016-03-17 22:42:22 +0100111ok(!$meta->{editor}, 'Editor');
112is($meta->{publisher}, 'Badenia Verlag und Druckerei', 'Publisher');
113is($meta->{creation_date}, '19600000', 'Creation date');
Akrona8665782016-01-27 21:47:57 +0100114
115# !!!
116# diag 'Non-acceptance of creation date ranges may be temporary';
117
118
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000119#ok(!$doc->coll_title, 'Collection title');
120#ok(!$doc->coll_sub_title, 'Collection subtitle');
121#ok(!$doc->coll_editor, 'Collection editor');
122#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100123is($meta->{text_type}, 'Erlass', 'text_type');
124ok(!$meta->{text_type_art}, 'text_type art');
125
Nils Diewald8e323ee2014-04-23 17:28:14 +0000126
Nils Diewald8e323ee2014-04-23 17:28:14 +0000127# A01/02035-substring
Akron9c0488f2016-01-28 14:17:15 +0100128$path = catdir(dirname(__FILE__), 'corpus/A00/02035-substring');
Akrone4c2e412016-01-28 15:10:50 +0100129ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000130ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100131
132$meta = $doc->meta;
133
134is($meta->{title}, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035
135ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100136is($doc->text_sigle, 'A00/JAN/02035', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000137is($doc->corpus_sigle, 'A00', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100138is($meta->{pub_date}, '20000111', 'pubDate');
139ok(!$meta->{pub_place}, 'pubPlace');
140is($meta->{text_class}->[0], 'sport', 'TextClass');
141is($meta->{text_class}->[1], 'ballsport', 'TextClass');
142ok(!$meta->{text_class}->[2], 'TextClass');
143ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000144
145# Additional information
Akron35db6e32016-03-17 22:42:22 +0100146ok(!$meta->{editor}, 'Editor');
147ok(!$meta->{publisher}, 'Publisher');
148is($meta->{creation_date}, "20000111", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000149#ok(!$doc->coll_title, 'Collection title');
150#ok(!$doc->coll_sub_title, 'Collection subtitle');
151#ok(!$doc->coll_editor, 'Collection editor');
152#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100153ok(!$meta->{text_type}, 'text_type');
154is($meta->{text_type_art}, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000155
Nils Diewald8e323ee2014-04-23 17:28:14 +0000156# A01/02873-meta
Akron9c0488f2016-01-28 14:17:15 +0100157$path = catdir(dirname(__FILE__), 'corpus/A00/02873-meta');
Akrone4c2e412016-01-28 15:10:50 +0100158ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000159ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100160$meta = $doc->meta;
161
162is($meta->{title}, 'Tradition und Moderne', 'title');
163ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100164is($doc->text_sigle, 'A00/JAN/02873', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000165is($doc->corpus_sigle, 'A00', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100166is($meta->{pub_date}, '20000113', 'pubDate');
167ok(!$meta->{pub_place}, 'pubPlace');
168is($meta->{text_class}->[0], 'kultur', 'TextClass');
169is($meta->{text_class}->[1], 'film', 'TextClass');
170ok(!$meta->{text_class}->[2], 'TextClass');
171ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000172
Akrona8665782016-01-27 21:47:57 +0100173
Nils Diewald8e323ee2014-04-23 17:28:14 +0000174# Additional information
Akron35db6e32016-03-17 22:42:22 +0100175ok(!$meta->{editor}, 'Editor');
176ok(!$meta->{publisher}, 'Publisher');
177is($meta->{creation_date}, "20000113", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000178#ok(!$doc->coll_title, 'Collection title');
179#ok(!$doc->coll_sub_title, 'Collection subtitle');
180#ok(!$doc->coll_editor, 'Collection editor');
181#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100182ok(!$meta->{text_type}, 'text_type');
183is($meta->{text_type_art}, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000184
185
186# A01/05663-unbalanced
Akron9c0488f2016-01-28 14:17:15 +0100187$path = catdir(dirname(__FILE__), 'corpus/A00/05663-unbalanced');
Akrone4c2e412016-01-28 15:10:50 +0100188ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000189ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100190$meta = $doc->meta;
191
192is($meta->{title}, 'Mehr Arbeitslose im Dezember', 'title');
193ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100194is($doc->text_sigle, 'A00/JAN/05663', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000195is($doc->corpus_sigle, 'A00', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100196is($meta->{pub_date}, '20000124', 'pubDate');
197ok(!$meta->{pub_place}, 'pubPlace');
198is($meta->{text_class}->[0], 'gesundheit-ernaehrung', 'TextClass');
199is($meta->{text_class}->[1], 'gesundheit', 'TextClass');
200ok(!$meta->{text_class}->[2], 'TextClass');
201ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000202
Akrona8665782016-01-27 21:47:57 +0100203
Nils Diewald8e323ee2014-04-23 17:28:14 +0000204# Additional information
Akron35db6e32016-03-17 22:42:22 +0100205ok(!$meta->{editor}, 'Editor');
206ok(!$meta->{publisher}, 'Publisher');
207is($meta->{creation_date}, "20000124", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000208#ok(!$doc->coll_title, 'Collection title');
209#ok(!$doc->coll_sub_title, 'Collection subtitle');
210#ok(!$doc->coll_editor, 'Collection editor');
211#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100212ok(!$meta->{text_type}, 'text_type');
213is($meta->{text_type_art}, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000214
Nils Diewald8e323ee2014-04-23 17:28:14 +0000215# A01/07452-deep
Akron9c0488f2016-01-28 14:17:15 +0100216$path = catdir(dirname(__FILE__), 'corpus/A00/07452-deep');
Akrone4c2e412016-01-28 15:10:50 +0100217ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000218ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100219$meta = $doc->meta;
220
221is($meta->{title}, 'Wil im Dezember 1999', 'title');
222ok(!$meta->{sub_title}, 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100223is($doc->text_sigle, 'A00/JAN/07452', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000224is($doc->corpus_sigle, 'A00', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100225is($meta->{pub_date}, '20000129', 'pubDate');
226ok(!$meta->{pub_place}, 'pubPlace');
227is($meta->{text_class}->[0], 'politik', 'TextClass');
228is($meta->{text_class}->[1], 'kommunalpolitik', 'TextClass');
229ok(!$meta->{text_class}->[2], 'TextClass');
230ok(!$meta->{author}, 'author');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000231
Akrona8665782016-01-27 21:47:57 +0100232
Nils Diewald8e323ee2014-04-23 17:28:14 +0000233# Additional information
Akron35db6e32016-03-17 22:42:22 +0100234ok(!$meta->{editor}, 'Editor');
235ok(!$meta->{publisher}, 'Publisher');
236is($meta->{creation_date}, "20000129", 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000237#ok(!$doc->coll_title, 'Collection title');
238#ok(!$doc->coll_sub_title, 'Collection subtitle');
239#ok(!$doc->coll_editor, 'Collection editor');
240#ok(!$doc->coll_author, 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100241ok(!$meta->{text_type}, 'text_type');
242is($meta->{text_type_art}, 'Bericht', 'text_type art');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000243
Nils Diewald98767bb2014-04-25 20:31:19 +0000244# ART
Akron9c0488f2016-01-28 14:17:15 +0100245$path = catdir(dirname(__FILE__), 'corpus/artificial');
Akrone4c2e412016-01-28 15:10:50 +0100246ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000247#is($doc->path, $path . '/', 'Path');
Nils Diewald8e323ee2014-04-23 17:28:14 +0000248
Akrone4c2e412016-01-28 15:10:50 +0100249ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000250#is($doc->path, $path . '/', 'Path');
Nils Diewald98767bb2014-04-25 20:31:19 +0000251
252ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100253$meta = $doc->meta;
Nils Diewald98767bb2014-04-25 20:31:19 +0000254
255# Metdata
Akron35db6e32016-03-17 22:42:22 +0100256is($meta->{title}, 'Artificial Title', 'title');
257is($meta->{sub_title}, 'Artificial Subtitle', 'subTitle');
Akron1cd5b872016-03-22 00:23:46 +0100258is($doc->text_sigle, 'ART/ABC/00001', 'ID');
Nils Diewald840c9242014-10-28 19:51:26 +0000259is($doc->corpus_sigle, 'ART', 'corpusID');
Akron35db6e32016-03-17 22:42:22 +0100260is($meta->{pub_date}, '20010402', 'pubDate');
261is($meta->{pub_place}, 'Mannheim', 'pubPlace');
262is($meta->{pub_place_key}, 'DE', 'pubPlace key');
263is($meta->{text_class}->[0], 'freizeit-unterhaltung', 'TextClass');
264is($meta->{text_class}->[1], 'vereine-veranstaltungen', 'TextClass');
265ok(!$meta->{text_class}->[2], 'TextClass');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000266#is($doc->author->[0], 'Ruru', 'author');
267#is($doc->author->[1], 'Jens.Ol', 'author');
268#is($doc->author->[2], 'Aglarech', 'author');
Akron35db6e32016-03-17 22:42:22 +0100269is($meta->{author}, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author');
Nils Diewald98767bb2014-04-25 20:31:19 +0000270
271# Additional information
Akron35db6e32016-03-17 22:42:22 +0100272is($meta->{editor}, 'Nils Diewald', 'Editor');
273is($meta->{publisher}, 'Artificial articles Inc.', 'Publisher');
274is($meta->{creation_date}, '19990601', 'Creation date');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000275#is($doc->coll_title, 'Artificial articles', 'Collection title');
276#is($doc->coll_sub_title, 'Best of!', 'Collection subtitle');
277#is($doc->coll_editor, 'Nils Diewald', 'Collection editor');
278#is($doc->coll_author, 'Nils Diewald', 'Collection author');
Akron35db6e32016-03-17 22:42:22 +0100279is($meta->{text_type}, 'Zeitung: Tageszeitung', 'No text_type');
280is($meta->{text_type_art}, 'Bericht', 'text_type art');
281
Nils Diewald8e323ee2014-04-23 17:28:14 +0000282
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000283# Multipath headers
Akron9c0488f2016-01-28 14:17:15 +0100284$path = catdir(dirname(__FILE__), 'corpus/VDI/JAN/00001');
Akrone4c2e412016-01-28 15:10:50 +0100285ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000286like($doc->path, qr!$path/!, 'Path');
287
Akrone4c2e412016-01-28 15:10:50 +0100288ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000289like($doc->path, qr!$path/$!, 'Path');
290
291ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100292$meta = $doc->meta;
Akrona8665782016-01-27 21:47:57 +0100293
Akron1cd5b872016-03-22 00:23:46 +0100294is($doc->text_sigle, 'VDI14/JAN/00001', 'text sigle');
295is($doc->doc_sigle, 'VDI14/JAN', 'doc sigle');
Akron35db6e32016-03-17 22:42:22 +0100296is($meta->corpus_sigle, 'VDI14', 'corpus sigle');
Akrona8665782016-01-27 21:47:57 +0100297
Akron35db6e32016-03-17 22:42:22 +0100298is($meta->{title}, '10- Zz mit Zahl', 'title');
Akrona8665782016-01-27 21:47:57 +0100299
Akron35db6e32016-03-17 22:42:22 +0100300ok(!$meta->{sub_title}, 'subtitle');
301is($meta->{pub_date}, '20140117', 'pubdate');
302is($meta->{pub_place}, 'Düsseldorf', 'pubplace');
303is($meta->{author}, 'Windhövel, Kerstin', 'author');
304is($meta->{publisher}, 'VDI Verlag GmbH', 'publisher');
305ok(!$meta->{editor}, 'editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000306
Akron35db6e32016-03-17 22:42:22 +0100307ok(!$meta->{text_type}, 'text type');
308ok(!$meta->{text_type_art}, 'text type art');
309ok(!$meta->{text_type_ref}, 'text type ref');
310ok(!$meta->{text_column}, 'text column');
311ok(!$meta->{text_domain}, 'text domain');
312ok(!$meta->{creation_date}, 'creation date');
Akron6396c302016-03-18 16:05:39 +0100313ok(!$meta->{availability}, 'License');
Akron35db6e32016-03-17 22:42:22 +0100314ok(!$meta->{pages}, 'Pages');
315ok(!$meta->{file_edition_statement}, 'file edition statement');
316ok(!$meta->{bibl_edition_statement}, 'bibl edition statement');
317is($meta->{reference}, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000318
Akron35db6e32016-03-17 22:42:22 +0100319ok(!$doc->{language}, 'Language');
Akrona8665782016-01-27 21:47:57 +0100320# !!!
321# diag 'This may be "de" in the future';
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000322
Akron35db6e32016-03-17 22:42:22 +0100323is($meta->{doc_title}, 'VDI nachrichten, Januar 2014', 'Doc title');
324ok(!$meta->{doc_sub_title}, 'Doc Sub title');
325ok(!$meta->{doc_editor}, 'Doc editor');
326ok(!$meta->{doc_author}, 'Doc author');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000327
Akron35db6e32016-03-17 22:42:22 +0100328is($meta->{corpus_title}, 'VDI nachrichten', 'Corpus title');
329ok(!$meta->{corpus_sub_title}, 'Corpus Sub title');
330is($meta->{corpus_editor}, 'Verein Deutscher Ingenieure', 'Corpus editor');
331ok(!$meta->{corpus_author}, 'Corpus author');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000332
Akron35db6e32016-03-17 22:42:22 +0100333is($meta->keywords('keywords'), '', 'Keywords');
334is($meta->keywords('text_class'), 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000335
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000336# WDD
Akron9c0488f2016-01-28 14:17:15 +0100337$path = catdir(dirname(__FILE__), 'corpus/WDD/G27/38989');
Akrone4c2e412016-01-28 15:10:50 +0100338ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000339like($doc->path, qr!$path/!, 'Path');
340ok($doc->parse, 'Parse document');
Akron35db6e32016-03-17 22:42:22 +0100341$meta = $doc->meta;
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000342
Akron1cd5b872016-03-22 00:23:46 +0100343is($doc->text_sigle, 'WDD11/G27/38989', 'text sigle');
344is($doc->doc_sigle, 'WDD11/G27', 'doc sigle');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000345is($doc->corpus_sigle, 'WDD11', 'corpus sigle');
346
Akron35db6e32016-03-17 22:42:22 +0100347is($meta->{title}, 'Diskussion:Gunter A. Pilz', 'title');
348ok(!$meta->{sub_title}, 'subtitle');
349is($meta->{pub_date}, '20111029', 'pubdate');
350is($meta->{pub_place}, 'URL:http://de.wikipedia.org', 'pubplace');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000351
Akron35db6e32016-03-17 22:42:22 +0100352is($meta->{author}, '€pa, u.a.', 'author');
353is($meta->{publisher}, 'Wikipedia', 'publisher');
354ok(!$meta->{editor}, 'editor');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000355
Akron35db6e32016-03-17 22:42:22 +0100356is($meta->{text_type}, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type');
357ok(!$meta->{text_type_art}, 'text type art');
358ok(!$meta->{text_type_ref}, 'text type ref');
359ok(!$meta->{text_column}, 'text column');
360ok(!$meta->{text_domain}, 'text domain');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000361
Akron35db6e32016-03-17 22:42:22 +0100362is($meta->{creation_date}, '20070707', 'creation date');
Akron6396c302016-03-18 16:05:39 +0100363is($meta->{availability}, 'CC-BY-SA', 'License');
Akron35db6e32016-03-17 22:42:22 +0100364ok(!$meta->{pages}, 'Pages');
365ok(!$meta->{file_edition_statement}, 'file edition statement');
366ok(!$meta->{bibl_edition_statement}, 'bibl edition statement');
367is($meta->{reference}, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000368
Akron35db6e32016-03-17 22:42:22 +0100369is($meta->{language}, 'de', 'Language');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000370
Akron35db6e32016-03-17 22:42:22 +0100371is($meta->{doc_title}, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title');
372ok(!$meta->{doc_sub_title}, 'Doc Sub title');
373ok(!$meta->{doc_editor}, 'Doc editor');
374ok(!$meta->{doc_author}, 'Doc author');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000375
Akron35db6e32016-03-17 22:42:22 +0100376is($meta->{corpus_title}, 'Wikipedia', 'Corpus title');
377ok(!$meta->{corpus_sub_title}, 'Corpus Sub title');
378is($meta->{corpus_editor}, 'wikipedia.org', 'Corpus editor');
379ok(!$meta->{corpus_author}, 'Corpus author');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000380
Akron35db6e32016-03-17 22:42:22 +0100381is($meta->keywords('keywords'), '', 'Keywords');
382is($meta->keywords('text_class'), '', 'Text class');
Nils Diewaldfeccbb12015-06-18 20:06:45 +0000383
Akron35db6e32016-03-17 22:42:22 +0100384is($meta->{availability}, 'CC-BY-SA', 'Availability');
Akrona8665782016-01-27 21:47:57 +0100385
386
Nils Diewald8e323ee2014-04-23 17:28:14 +0000387done_testing;
388__END__