Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 1 | use strict; |
| 2 | use warnings; |
| 3 | use utf8; |
| 4 | use Test::More; |
| 5 | use Benchmark ':hireswallclock'; |
| 6 | use lib 'lib', '../lib'; |
| 7 | |
| 8 | use File::Basename 'dirname'; |
| 9 | use File::Spec::Functions 'catdir'; |
| 10 | |
| 11 | use_ok('KorAP::Document'); |
| 12 | |
| 13 | # WPD/00001 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 14 | my $path = catdir(dirname(__FILE__), 'corpus/WPD/00001'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 15 | ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 16 | like($doc->path, qr!$path/!, 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 17 | |
| 18 | ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 19 | like($doc->path, qr!$path/$!, 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 20 | |
| 21 | ok($doc->parse, 'Parse document'); |
| 22 | |
| 23 | # Metdata |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 24 | is($doc->text_sigle, 'WPD_AAA.00001', 'ID'); |
| 25 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 26 | is($doc->title, 'A', 'title'); |
| 27 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 28 | is($doc->corpus_sigle, 'WPD', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 29 | is($doc->pub_date, '20050328', 'pubDate'); |
| 30 | is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubPlace'); |
| 31 | is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 32 | is($doc->text_class->[1], 'reisen', 'TextClass'); |
| 33 | is($doc->text_class->[2], 'wissenschaft', 'TextClass'); |
| 34 | is($doc->text_class->[3], 'populaerwissenschaft', 'TextClass'); |
| 35 | ok(!$doc->text_class->[4], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 36 | is($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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 42 | |
| 43 | # Additional information |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 44 | ok(!$doc->editor, 'Editor'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 45 | is($doc->publisher, 'Wikipedia', 'Publisher'); |
| 46 | is($doc->creation_date, '20050000', 'Creation date'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 47 | ok(!$doc->text_type, 'No text_type'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 48 | ok(!$doc->text_type_art, 'no text_type art'); |
| 49 | ok(!$doc->text_type_ref, 'no text_type ref'); |
| 50 | ok(!$doc->text_domain, 'no text_domain'); |
| 51 | ok(!$doc->text_column, 'no text_column'); |
| 52 | ok(!$doc->keywords_string, 'no keywords'); |
| 53 | is($doc->text_class_string, 'freizeit-unterhaltung reisen wissenschaft populaerwissenschaft', 'no text classes'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 54 | |
| 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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 59 | |
| 60 | # BRZ13/00001 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 61 | $path = catdir(dirname(__FILE__), 'corpus/BRZ13/00001'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 62 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 63 | |
| 64 | ok($doc->parse, 'Parse document'); |
| 65 | is($doc->title, 'Sexueller Missbrauch –„Das schreiende Kind steckt noch tief in mir“', 'title'); |
| 66 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 67 | is($doc->text_sigle, 'BRZ13_APR.00001', 'ID'); |
| 68 | is($doc->corpus_sigle, 'BRZ13', 'corpusID'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 69 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 70 | is($doc->pub_date, '20130402', 'pubDate'); |
| 71 | is($doc->pub_place, 'Braunschweig', 'pubPlace'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 72 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 73 | is($doc->text_class->[0], 'staat-gesellschaft', 'TextClass'); |
| 74 | is($doc->text_class->[1], 'familie-geschlecht', 'TextClass'); |
| 75 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 76 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 77 | |
| 78 | # Additional information |
| 79 | ok(!$doc->editor, 'Editor'); |
| 80 | is($doc->publisher, 'Braunschweiger Zeitungsverlag, Druckhaus Albert Limbach GmbH & Co. KG', 'Publisher'); |
| 81 | is($doc->creation_date, '20130402', 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 82 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 86 | is($doc->text_type, 'Zeitung: Tageszeitung', 'text_type'); |
| 87 | ok(!$doc->text_type_art, 'text_type art'); |
| 88 | |
| 89 | # A01/13047 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 90 | $path = catdir(dirname(__FILE__), 'corpus/A01/13047'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 91 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 92 | |
| 93 | ok($doc->parse, 'Parse document'); |
| 94 | is($doc->title, 'Fischer und Kolp im Sonnenhügel', 'title'); |
| 95 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 96 | is($doc->text_sigle, 'A01_APR.13047', 'ID'); |
| 97 | is($doc->corpus_sigle, 'A01', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 98 | is($doc->pub_date, '20010402', 'pubDate'); |
| 99 | ok(!$doc->pub_place, 'pubPlace'); |
| 100 | is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 101 | is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass'); |
| 102 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 103 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 104 | |
| 105 | # Additional information |
| 106 | ok(!$doc->editor, 'Editor'); |
| 107 | ok(!$doc->publisher, 'Publisher'); |
| 108 | is($doc->creation_date, '20010402', 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 109 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 113 | ok(!$doc->text_type, 'text_type'); |
| 114 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
| 115 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 116 | # ERL/0001 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 117 | $path = catdir(dirname(__FILE__), 'corpus/ERL/00001'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 118 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 119 | |
| 120 | ok($doc->parse, 'Parse document'); |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 121 | is($doc->title, 'Amtsblatt des Landesbezirks Baden [diverse Erlasse]', 'title'); # Amtsblatt des Landesbezirks Baden [diverse Erlasse] |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 122 | # MK2/ERL.00001 |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 123 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 124 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 125 | is($doc->text_sigle, 'MK2_ERL.00001', 'ID'); |
| 126 | is($doc->corpus_sigle, 'MK2', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 127 | is($doc->pub_date, '00000000', 'pubDate'); |
| 128 | is($doc->pub_place, 'Karlsruhe', 'pubPlace'); |
| 129 | is($doc->text_class->[0], 'politik', 'TextClass'); |
| 130 | is($doc->text_class->[1], 'kommunalpolitik', 'TextClass'); |
| 131 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 132 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 133 | |
| 134 | # Additional information |
| 135 | ok(!$doc->editor, 'Editor'); |
| 136 | is($doc->publisher, 'Badenia Verlag und Druckerei', 'Publisher'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 137 | is($doc->creation_date, '19600000', 'Creation date'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 138 | |
| 139 | # !!! |
| 140 | # diag 'Non-acceptance of creation date ranges may be temporary'; |
| 141 | |
| 142 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 143 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 147 | is($doc->text_type, 'Erlass', 'text_type'); |
| 148 | ok(!$doc->text_type_art, 'text_type art'); |
| 149 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 150 | # A01/02035-substring |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 151 | $path = catdir(dirname(__FILE__), 'corpus/A00/02035-substring'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 152 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 153 | |
| 154 | ok($doc->parse, 'Parse document'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 155 | is($doc->title, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035 |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 156 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 157 | is($doc->text_sigle, 'A00_JAN.02035', 'ID'); |
| 158 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 159 | is($doc->pub_date, '20000111', 'pubDate'); |
| 160 | ok(!$doc->pub_place, 'pubPlace'); |
| 161 | is($doc->text_class->[0], 'sport', 'TextClass'); |
| 162 | is($doc->text_class->[1], 'ballsport', 'TextClass'); |
| 163 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 164 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 165 | |
| 166 | # Additional information |
| 167 | ok(!$doc->editor, 'Editor'); |
| 168 | ok(!$doc->publisher, 'Publisher'); |
| 169 | is($doc->creation_date, "20000111", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 170 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 174 | ok(!$doc->text_type, 'text_type'); |
| 175 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
| 176 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 177 | # A01/02873-meta |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 178 | $path = catdir(dirname(__FILE__), 'corpus/A00/02873-meta'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 179 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 180 | |
| 181 | ok($doc->parse, 'Parse document'); |
| 182 | is($doc->title, 'Tradition und Moderne', 'title'); |
| 183 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 184 | is($doc->text_sigle, 'A00_JAN.02873', 'ID'); |
| 185 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 186 | is($doc->pub_date, '20000113', 'pubDate'); |
| 187 | ok(!$doc->pub_place, 'pubPlace'); |
| 188 | is($doc->text_class->[0], 'kultur', 'TextClass'); |
| 189 | is($doc->text_class->[1], 'film', 'TextClass'); |
| 190 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 191 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 192 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 193 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 194 | # Additional information |
| 195 | ok(!$doc->editor, 'Editor'); |
| 196 | ok(!$doc->publisher, 'Publisher'); |
| 197 | is($doc->creation_date, "20000113", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 198 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 202 | ok(!$doc->text_type, 'text_type'); |
| 203 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
| 204 | |
| 205 | |
| 206 | # A01/05663-unbalanced |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 207 | $path = catdir(dirname(__FILE__), 'corpus/A00/05663-unbalanced'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 208 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 209 | |
| 210 | ok($doc->parse, 'Parse document'); |
| 211 | is($doc->title, 'Mehr Arbeitslose im Dezember', 'title'); |
| 212 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 213 | is($doc->text_sigle, 'A00_JAN.05663', 'ID'); |
| 214 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 215 | is($doc->pub_date, '20000124', 'pubDate'); |
| 216 | ok(!$doc->pub_place, 'pubPlace'); |
| 217 | is($doc->text_class->[0], 'gesundheit-ernaehrung', 'TextClass'); |
| 218 | is($doc->text_class->[1], 'gesundheit', 'TextClass'); |
| 219 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 220 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 221 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 222 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 223 | # Additional information |
| 224 | ok(!$doc->editor, 'Editor'); |
| 225 | ok(!$doc->publisher, 'Publisher'); |
| 226 | is($doc->creation_date, "20000124", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 227 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 231 | ok(!$doc->text_type, 'text_type'); |
| 232 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
| 233 | |
| 234 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 235 | # A01/07452-deep |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 236 | $path = catdir(dirname(__FILE__), 'corpus/A00/07452-deep'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 237 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 238 | |
| 239 | ok($doc->parse, 'Parse document'); |
| 240 | is($doc->title, 'Wil im Dezember 1999', 'title'); |
| 241 | ok(!$doc->sub_title, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 242 | is($doc->text_sigle, 'A00_JAN.07452', 'ID'); |
| 243 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 244 | is($doc->pub_date, '20000129', 'pubDate'); |
| 245 | ok(!$doc->pub_place, 'pubPlace'); |
| 246 | is($doc->text_class->[0], 'politik', 'TextClass'); |
| 247 | is($doc->text_class->[1], 'kommunalpolitik', 'TextClass'); |
| 248 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 249 | ok(!$doc->author, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 250 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 251 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 252 | # Additional information |
| 253 | ok(!$doc->editor, 'Editor'); |
| 254 | ok(!$doc->publisher, 'Publisher'); |
| 255 | is($doc->creation_date, "20000129", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 256 | #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 Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 260 | ok(!$doc->text_type, 'text_type'); |
| 261 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
| 262 | |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 263 | # ART |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 264 | $path = catdir(dirname(__FILE__), 'corpus/artificial'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 265 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 266 | #is($doc->path, $path . '/', 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 267 | |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 268 | ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 269 | #is($doc->path, $path . '/', 'Path'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 270 | |
| 271 | ok($doc->parse, 'Parse document'); |
| 272 | |
| 273 | # Metdata |
| 274 | is($doc->title, 'Artificial Title', 'title'); |
| 275 | is($doc->sub_title, 'Artificial Subtitle', 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 276 | is($doc->text_sigle, 'ART_ABC.00001', 'ID'); |
| 277 | is($doc->corpus_sigle, 'ART', 'corpusID'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 278 | is($doc->pub_date, '20010402', 'pubDate'); |
| 279 | is($doc->pub_place, 'Mannheim', 'pubPlace'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 280 | is($doc->pub_place_key, 'DE', 'pubPlace key'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 281 | is($doc->text_class->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 282 | is($doc->text_class->[1], 'vereine-veranstaltungen', 'TextClass'); |
| 283 | ok(!$doc->text_class->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 284 | #is($doc->author->[0], 'Ruru', 'author'); |
| 285 | #is($doc->author->[1], 'Jens.Ol', 'author'); |
| 286 | #is($doc->author->[2], 'Aglarech', 'author'); |
| 287 | is($doc->author, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 288 | |
| 289 | # Additional information |
| 290 | is($doc->editor, 'Nils Diewald', 'Editor'); |
| 291 | is($doc->publisher, 'Artificial articles Inc.', 'Publisher'); |
| 292 | is($doc->creation_date, '19990601', 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 293 | #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 Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 297 | is($doc->text_type, 'Zeitung: Tageszeitung', 'No text_type'); |
| 298 | is($doc->text_type_art, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 299 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 300 | # Multipath headers |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 301 | $path = catdir(dirname(__FILE__), 'corpus/VDI/JAN/00001'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 302 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 303 | like($doc->path, qr!$path/!, 'Path'); |
| 304 | |
| 305 | ok($doc = KorAP::Document->new( path => $path ), 'Load Korap::Document'); |
| 306 | like($doc->path, qr!$path/$!, 'Path'); |
| 307 | |
| 308 | ok($doc->parse, 'Parse document'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 309 | |
| 310 | |
| 311 | is($doc->text_sigle, 'VDI14_JAN.00001', 'text sigle'); |
| 312 | is($doc->doc_sigle, 'VDI14_JAN', 'doc sigle'); |
| 313 | is($doc->corpus_sigle, 'VDI14', 'corpus sigle'); |
| 314 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 315 | is($doc->title, '10- Zz mit Zahl', 'title'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 316 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 317 | ok(!$doc->sub_title, 'subtitle'); |
| 318 | is($doc->pub_date, '20140117', 'pubdate'); |
| 319 | is($doc->pub_place, 'Düsseldorf', 'pubplace'); |
| 320 | is($doc->author, 'Windhövel, Kerstin', 'author'); |
| 321 | is($doc->publisher, 'VDI Verlag GmbH', 'publisher'); |
| 322 | ok(!$doc->editor, 'editor'); |
| 323 | |
| 324 | ok(!$doc->text_type, 'text type'); |
| 325 | ok(!$doc->text_type_art, 'text type art'); |
| 326 | ok(!$doc->text_type_ref, 'text type ref'); |
| 327 | ok(!$doc->text_column, 'text column'); |
| 328 | ok(!$doc->text_domain, 'text domain'); |
| 329 | ok(!$doc->creation_date, 'creation date'); |
| 330 | ok(!$doc->license, 'License'); |
| 331 | ok(!$doc->pages, 'Pages'); |
| 332 | ok(!$doc->file_edition_statement, 'file edition statement'); |
| 333 | ok(!$doc->bibl_edition_statement, 'bibl edition statement'); |
| 334 | is($doc->reference, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference'); |
| 335 | |
| 336 | ok(!$doc->language, 'Language'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 337 | # !!! |
| 338 | # diag 'This may be "de" in the future'; |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 339 | |
| 340 | is($doc->doc_title, 'VDI nachrichten, Januar 2014', 'Doc title'); |
| 341 | ok(!$doc->doc_sub_title, 'Doc Sub title'); |
| 342 | ok(!$doc->doc_editor, 'Doc editor'); |
| 343 | ok(!$doc->doc_author, 'Doc author'); |
| 344 | |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 345 | is($doc->corpus_title, 'VDI nachrichten', 'Corpus title'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 346 | ok(!$doc->corpus_sub_title, 'Corpus Sub title'); |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 347 | is($doc->corpus_editor, 'Verein Deutscher Ingenieure', 'Corpus editor'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 348 | ok(!$doc->corpus_author, 'Corpus author'); |
| 349 | |
| 350 | is($doc->keywords_string, '', 'Keywords'); |
| 351 | is($doc->text_class_string, 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class'); |
| 352 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 353 | # WDD |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 354 | $path = catdir(dirname(__FILE__), 'corpus/WDD/G27/38989'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 355 | ok($doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document'); |
| 356 | like($doc->path, qr!$path/!, 'Path'); |
| 357 | ok($doc->parse, 'Parse document'); |
| 358 | |
| 359 | is($doc->text_sigle, 'WDD11_G27.38989', 'text sigle'); |
| 360 | is($doc->doc_sigle, 'WDD11_G27', 'doc sigle'); |
| 361 | is($doc->corpus_sigle, 'WDD11', 'corpus sigle'); |
| 362 | |
| 363 | is($doc->title, 'Diskussion:Gunter A. Pilz', 'title'); |
| 364 | ok(!$doc->sub_title, 'subtitle'); |
| 365 | is($doc->pub_date, '20111029', 'pubdate'); |
| 366 | is($doc->pub_place, 'URL:http://de.wikipedia.org', 'pubplace'); |
| 367 | |
| 368 | is($doc->author, '€pa, u.a.', 'author'); |
| 369 | is($doc->publisher, 'Wikipedia', 'publisher'); |
| 370 | ok(!$doc->editor, 'editor'); |
| 371 | |
| 372 | is($doc->text_type, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type'); |
| 373 | ok(!$doc->text_type_art, 'text type art'); |
| 374 | ok(!$doc->text_type_ref, 'text type ref'); |
| 375 | ok(!$doc->text_column, 'text column'); |
| 376 | ok(!$doc->text_domain, 'text domain'); |
| 377 | |
| 378 | is($doc->creation_date, '20070707', 'creation date'); |
| 379 | is($doc->license, 'CC-BY-SA', 'License'); |
| 380 | ok(!$doc->pages, 'Pages'); |
| 381 | ok(!$doc->file_edition_statement, 'file edition statement'); |
| 382 | ok(!$doc->bibl_edition_statement, 'bibl edition statement'); |
| 383 | is($doc->reference, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference'); |
| 384 | |
| 385 | is($doc->language, 'de', 'Language'); |
| 386 | |
| 387 | is($doc->doc_title, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title'); |
| 388 | ok(!$doc->doc_sub_title, 'Doc Sub title'); |
| 389 | ok(!$doc->doc_editor, 'Doc editor'); |
| 390 | ok(!$doc->doc_author, 'Doc author'); |
| 391 | |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 392 | is($doc->corpus_title, 'Wikipedia', 'Corpus title'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 393 | ok(!$doc->corpus_sub_title, 'Corpus Sub title'); |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame^] | 394 | is($doc->corpus_editor, 'wikipedia.org', 'Corpus editor'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 395 | ok(!$doc->corpus_author, 'Corpus author'); |
| 396 | |
| 397 | is($doc->keywords_string, '', 'Keywords'); |
| 398 | is($doc->text_class_string, '', 'Text class'); |
| 399 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 400 | |
| 401 | is($doc->availability, 'CC-BY-SA', 'Availability'); |
| 402 | |
| 403 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 404 | done_testing; |
| 405 | __END__ |