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'; |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 6 | use Mojo::DOM; |
Akron | 3ec0a1c | 2017-01-18 14:41:55 +0100 | [diff] [blame] | 7 | use Mojo::File; |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 8 | use Mojo::ByteStream 'b'; |
| 9 | use Data::Dumper; |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 10 | use lib 'lib', '../lib'; |
| 11 | |
| 12 | use File::Basename 'dirname'; |
| 13 | use File::Spec::Functions 'catdir'; |
| 14 | |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 15 | use_ok('KorAP::XML::Krill'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 16 | |
| 17 | # WPD/00001 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 18 | my $path = catdir(dirname(__FILE__), 'corpus/WPD/00001'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 19 | ok(my $doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 20 | like($doc->path, qr!\Q$path\E/!, 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 21 | |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 22 | ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 23 | like($doc->path, qr!\Q$path\E/$!, 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 24 | |
| 25 | ok($doc->parse, 'Parse document'); |
| 26 | |
| 27 | # Metdata |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 28 | is($doc->text_sigle, 'WPD/AAA/00001', 'ID'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 29 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 30 | my $meta = $doc->meta; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 31 | is($meta->{T_title}, 'A', 'title'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 32 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 33 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 34 | is($doc->corpus_sigle, 'WPD', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 35 | is($meta->{D_pub_date}, '20050328', 'pubDate'); |
| 36 | is($meta->{S_pub_place}, 'URL:http://de.wikipedia.org', 'pubPlace'); |
| 37 | is($meta->{K_text_class}->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 38 | is($meta->{K_text_class}->[1], 'reisen', 'TextClass'); |
| 39 | is($meta->{K_text_class}->[2], 'wissenschaft', 'TextClass'); |
| 40 | is($meta->{K_text_class}->[3], 'populaerwissenschaft', 'TextClass'); |
| 41 | ok(!$meta->{K_text_class}->[4], 'TextClass'); |
| 42 | is($meta->{T_author}, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 43 | |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 44 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 45 | #is($doc->author->[0], 'Ruru', 'author'); |
| 46 | #is($doc->author->[1], 'Jens.Ol', 'author'); |
| 47 | #is($doc->author->[2], 'Aglarech', 'author'); |
| 48 | #ok(!$doc->author->[3], 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 49 | |
| 50 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 51 | is($meta->{A_editor}, 'wikipedia.org', 'Editor'); |
| 52 | is($meta->{A_publisher}, 'Wikipedia', 'Publisher'); |
| 53 | is($meta->{D_creation_date}, '20050000', 'Creation date'); |
| 54 | ok(!$meta->{S_text_type}, 'No text_type'); |
| 55 | ok(!$meta->{S_text_type_art}, 'no text_type art'); |
| 56 | ok(!$meta->{S_text_type_ref}, 'no text_type ref'); |
| 57 | ok(!$meta->{S_text_domain}, 'no text_domain'); |
| 58 | ok(!$meta->{S_text_column}, 'no text_column'); |
| 59 | ok(!$meta->keywords('K_keywords'), 'no keywords'); |
| 60 | is($meta->keywords('K_text_class'), 'freizeit-unterhaltung reisen wissenschaft populaerwissenschaft', 'no text classes'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 61 | |
| 62 | #is($doc->coll_title, 'Wikipedia', 'Collection title'); |
| 63 | #is($doc->coll_sub_title, 'Die freie Enzyklopädie', 'Collection subtitle'); |
| 64 | #is($doc->coll_editor, 'wikipedia.org', 'Collection editor'); |
| 65 | #ok(!$doc->coll_author, 'Collection author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 66 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 67 | # A01/13047 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 68 | $path = catdir(dirname(__FILE__), 'corpus/A01/13047'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 69 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 70 | |
| 71 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 72 | $meta = $doc->meta; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 73 | is($meta->{T_title}, 'Fischer und Kolp im Sonnenhügel', 'title'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 74 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 75 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 76 | is($doc->text_sigle, 'A01/APR/13047', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 77 | is($doc->corpus_sigle, 'A01', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 78 | is($meta->{D_pub_date}, '20010402', 'pubDate'); |
| 79 | ok(!$meta->{S_pub_place}, 'pubPlace'); |
| 80 | is($meta->{K_text_class}->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 81 | is($meta->{K_text_class}->[1], 'vereine-veranstaltungen', 'TextClass'); |
| 82 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 83 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 84 | |
| 85 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 86 | ok(!$meta->{A_editor}, 'Editor'); |
| 87 | ok(!$meta->{A_publisher}, 'Publisher'); |
| 88 | is($meta->{D_creation_date}, '20010402', 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 89 | #ok(!$doc->coll_title, 'Collection title'); |
| 90 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 91 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 92 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 93 | ok(!$meta->{S_text_type}, 'text_type'); |
| 94 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 95 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 96 | # ERL/0001 |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 97 | $path = catdir(dirname(__FILE__), 'corpus/ERL/00001'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 98 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 99 | |
| 100 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 101 | |
| 102 | $meta = $doc->meta; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 103 | is($meta->{T_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] | 104 | # MK2/ERL.00001 |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 105 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 106 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 107 | is($doc->text_sigle, 'MK2/ERL/00001', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 108 | is($doc->corpus_sigle, 'MK2', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 109 | is($meta->{D_pub_date}, '00000000', 'pubDate'); |
| 110 | is($meta->{S_pub_place}, 'Karlsruhe', 'pubPlace'); |
| 111 | is($meta->{K_text_class}->[0], 'politik', 'TextClass'); |
| 112 | is($meta->{K_text_class}->[1], 'kommunalpolitik', 'TextClass'); |
| 113 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 114 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 115 | |
| 116 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 117 | ok(!$meta->{A_editor}, 'Editor'); |
| 118 | is($meta->{A_publisher}, 'Badenia Verlag und Druckerei', 'Publisher'); |
| 119 | is($meta->{D_creation_date}, '19600000', 'Creation date'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 120 | |
| 121 | # !!! |
| 122 | # diag 'Non-acceptance of creation date ranges may be temporary'; |
| 123 | |
| 124 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 125 | #ok(!$doc->coll_title, 'Collection title'); |
| 126 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 127 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 128 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 129 | is($meta->{S_text_type}, 'Erlass', 'text_type'); |
| 130 | ok(!$meta->{S_text_type_art}, 'text_type art'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 131 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 132 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 133 | # A01/02035-substring |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 134 | $path = catdir(dirname(__FILE__), 'corpus/A00/02035-substring'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 135 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 136 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 137 | |
| 138 | $meta = $doc->meta; |
| 139 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 140 | is($meta->{T_title}, 'St. Galler Tagblatt, 11.01.2000, Ressort: TB-RSP (Abk.)', 'title'); # A00/JAN.02035 |
| 141 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 142 | is($doc->text_sigle, 'A00/JAN/02035', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 143 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 144 | is($meta->{D_pub_date}, '20000111', 'pubDate'); |
| 145 | ok(!$meta->{S_pub_place}, 'pubPlace'); |
| 146 | is($meta->{K_text_class}->[0], 'sport', 'TextClass'); |
| 147 | is($meta->{K_text_class}->[1], 'ballsport', 'TextClass'); |
| 148 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 149 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 150 | |
| 151 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 152 | ok(!$meta->{A_editor}, 'Editor'); |
| 153 | ok(!$meta->{A_publisher}, 'Publisher'); |
| 154 | is($meta->{D_creation_date}, "20000111", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 155 | #ok(!$doc->coll_title, 'Collection title'); |
| 156 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 157 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 158 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 159 | ok(!$meta->{S_text_type}, 'text_type'); |
| 160 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 161 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 162 | # A01/02873-meta |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 163 | $path = catdir(dirname(__FILE__), 'corpus/A00/02873-meta'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 164 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 165 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 166 | $meta = $doc->meta; |
| 167 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 168 | is($meta->{T_title}, 'Tradition und Moderne', 'title'); |
| 169 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 170 | is($doc->text_sigle, 'A00/JAN/02873', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 171 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 172 | is($meta->{D_pub_date}, '20000113', 'pubDate'); |
| 173 | ok(!$meta->{S_pub_place}, 'pubPlace'); |
| 174 | is($meta->{K_text_class}->[0], 'kultur', 'TextClass'); |
| 175 | is($meta->{K_text_class}->[1], 'film', 'TextClass'); |
| 176 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 177 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 178 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 179 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 180 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 181 | ok(!$meta->{A_editor}, 'Editor'); |
| 182 | ok(!$meta->{A_publisher}, 'Publisher'); |
| 183 | is($meta->{D_creation_date}, "20000113", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 184 | #ok(!$doc->coll_title, 'Collection title'); |
| 185 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 186 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 187 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 188 | ok(!$meta->{S_text_type}, 'text_type'); |
| 189 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 190 | |
| 191 | |
| 192 | # A01/05663-unbalanced |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 193 | $path = catdir(dirname(__FILE__), 'corpus/A00/05663-unbalanced'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 194 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 195 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 196 | $meta = $doc->meta; |
| 197 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 198 | is($meta->{T_title}, 'Mehr Arbeitslose im Dezember', 'title'); |
| 199 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 200 | is($doc->text_sigle, 'A00/JAN/05663', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 201 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 202 | is($meta->{D_pub_date}, '20000124', 'pubDate'); |
| 203 | ok(!$meta->{S_pub_place}, 'pubPlace'); |
| 204 | is($meta->{K_text_class}->[0], 'gesundheit-ernaehrung', 'TextClass'); |
| 205 | is($meta->{K_text_class}->[1], 'gesundheit', 'TextClass'); |
| 206 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 207 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 208 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 209 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 210 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 211 | ok(!$meta->{A_editor}, 'Editor'); |
| 212 | ok(!$meta->{A_publisher}, 'Publisher'); |
| 213 | is($meta->{D_creation_date}, "20000124", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 214 | #ok(!$doc->coll_title, 'Collection title'); |
| 215 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 216 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 217 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 218 | ok(!$meta->{S_text_type}, 'text_type'); |
| 219 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 220 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 221 | # A01/07452-deep |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 222 | $path = catdir(dirname(__FILE__), 'corpus/A00/07452-deep'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 223 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 224 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 225 | $meta = $doc->meta; |
| 226 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 227 | is($meta->{T_title}, 'Wil im Dezember 1999', 'title'); |
| 228 | ok(!$meta->{T_sub_title}, 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 229 | is($doc->text_sigle, 'A00/JAN/07452', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 230 | is($doc->corpus_sigle, 'A00', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 231 | is($meta->{D_pub_date}, '20000129', 'pubDate'); |
| 232 | ok(!$meta->{S_pub_place}, 'pubPlace'); |
| 233 | is($meta->{K_text_class}->[0], 'politik', 'TextClass'); |
| 234 | is($meta->{K_text_class}->[1], 'kommunalpolitik', 'TextClass'); |
| 235 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
| 236 | ok(!$meta->{T_author}, 'author'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 237 | |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 238 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 239 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 240 | ok(!$meta->{A_editor}, 'Editor'); |
| 241 | ok(!$meta->{A_publisher}, 'Publisher'); |
| 242 | is($meta->{D_creation_date}, "20000129", 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 243 | #ok(!$doc->coll_title, 'Collection title'); |
| 244 | #ok(!$doc->coll_sub_title, 'Collection subtitle'); |
| 245 | #ok(!$doc->coll_editor, 'Collection editor'); |
| 246 | #ok(!$doc->coll_author, 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 247 | ok(!$meta->{S_text_type}, 'text_type'); |
| 248 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 249 | |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 250 | # ART |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 251 | $path = catdir(dirname(__FILE__), 'corpus/artificial'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 252 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 253 | #is($doc->path, $path . '/', 'Path'); |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 254 | |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 255 | ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 256 | #is($doc->path, $path . '/', 'Path'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 257 | |
| 258 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 259 | $meta = $doc->meta; |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 260 | |
| 261 | # Metdata |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 262 | is($meta->{T_title}, 'Artificial Title', 'title'); |
| 263 | is($meta->{T_sub_title}, 'Artificial Subtitle', 'subTitle'); |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 264 | is($doc->text_sigle, 'ART/ABC/00001', 'ID'); |
Nils Diewald | 840c924 | 2014-10-28 19:51:26 +0000 | [diff] [blame] | 265 | is($doc->corpus_sigle, 'ART', 'corpusID'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 266 | is($meta->{D_pub_date}, '20010402', 'pubDate'); |
| 267 | is($meta->{S_pub_place}, 'Mannheim', 'pubPlace'); |
| 268 | is($meta->{S_pub_place_key}, 'DE', 'pubPlace key'); |
| 269 | is($meta->{K_text_class}->[0], 'freizeit-unterhaltung', 'TextClass'); |
| 270 | is($meta->{K_text_class}->[1], 'vereine-veranstaltungen', 'TextClass'); |
| 271 | ok(!$meta->{K_text_class}->[2], 'TextClass'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 272 | #is($doc->author->[0], 'Ruru', 'author'); |
| 273 | #is($doc->author->[1], 'Jens.Ol', 'author'); |
| 274 | #is($doc->author->[2], 'Aglarech', 'author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 275 | is($meta->{T_author}, 'Ruru; Jens.Ol; Aglarech; u.a.', 'author'); |
Nils Diewald | 98767bb | 2014-04-25 20:31:19 +0000 | [diff] [blame] | 276 | |
| 277 | # Additional information |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 278 | is($meta->{A_editor}, 'Nils Diewald', 'Editor'); |
| 279 | is($meta->{A_publisher}, 'Artificial articles Inc.', 'Publisher'); |
| 280 | is($meta->{D_creation_date}, '19990601', 'Creation date'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 281 | #is($doc->coll_title, 'Artificial articles', 'Collection title'); |
| 282 | #is($doc->coll_sub_title, 'Best of!', 'Collection subtitle'); |
| 283 | #is($doc->coll_editor, 'Nils Diewald', 'Collection editor'); |
| 284 | #is($doc->coll_author, 'Nils Diewald', 'Collection author'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 285 | is($meta->{S_text_type}, 'Zeitung: Tageszeitung', 'No text_type'); |
| 286 | is($meta->{S_text_type_art}, 'Bericht', 'text_type art'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 287 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 288 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 289 | # Multipath headers |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 290 | $path = catdir(dirname(__FILE__), 'corpus/VDI/JAN/00001'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 291 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 292 | like($doc->path, qr!\Q$path\E/!, 'Path'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 293 | |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 294 | ok($doc = KorAP::XML::Krill->new( path => $path ), 'Load Korap::Document'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 295 | like($doc->path, qr!\Q$path\E/$!, 'Path'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 296 | |
| 297 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 298 | $meta = $doc->meta; |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 299 | |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 300 | is($doc->text_sigle, 'VDI14/JAN/00001', 'text sigle'); |
| 301 | is($doc->doc_sigle, 'VDI14/JAN', 'doc sigle'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 302 | is($meta->corpus_sigle, 'VDI14', 'corpus sigle'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 303 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 304 | is($meta->{T_title}, '10- Zz mit Zahl', 'title'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 305 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 306 | ok(!$meta->{T_sub_title}, 'subtitle'); |
| 307 | is($meta->{D_pub_date}, '20140117', 'pubdate'); |
| 308 | is($meta->{S_pub_place}, 'Düsseldorf', 'pubplace'); |
| 309 | is($meta->{T_author}, 'Windhövel, Kerstin', 'author'); |
| 310 | is($meta->{A_publisher}, 'VDI Verlag GmbH', 'publisher'); |
| 311 | ok(!$meta->{A_editor}, 'editor'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 312 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 313 | ok(!$meta->{S_text_type}, 'text type'); |
| 314 | ok(!$meta->{S_text_type_art}, 'text type art'); |
| 315 | ok(!$meta->{S_text_type_ref}, 'text type ref'); |
| 316 | ok(!$meta->{S_text_column}, 'text column'); |
| 317 | ok(!$meta->{S_text_domain}, 'text domain'); |
| 318 | ok(!$meta->{D_creation_date}, 'creation date'); |
| 319 | ok(!$meta->{S_availability}, 'License'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 320 | ok(!$meta->{pages}, 'Pages'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 321 | ok(!$meta->{A_file_edition_statement}, 'file edition statement'); |
| 322 | ok(!$meta->{A_bibl_edition_statement}, 'bibl edition statement'); |
| 323 | is($meta->{A_reference}, 'VDI nachrichten, 17.01.2014, S. 10; 10- Zz mit Zahl [Ausführliche Zitierung nicht verfügbar]', 'Reference'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 324 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 325 | ok(!$doc->{S_language}, 'Language'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 326 | # !!! |
| 327 | # diag 'This may be "de" in the future'; |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 328 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 329 | is($meta->{T_doc_title}, 'VDI nachrichten, Januar 2014', 'Doc title'); |
| 330 | ok(!$meta->{T_doc_sub_title}, 'Doc Sub title'); |
| 331 | ok(!$meta->{A_doc_editor}, 'Doc editor'); |
| 332 | ok(!$meta->{T_doc_author}, 'Doc author'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 333 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 334 | is($meta->{T_corpus_title}, 'VDI nachrichten', 'Corpus title'); |
| 335 | ok(!$meta->{T_corpus_sub_title}, 'Corpus Sub title'); |
| 336 | is($meta->{A_corpus_editor}, 'Verein Deutscher Ingenieure', 'Corpus editor'); |
| 337 | ok(!$meta->{T_corpus_author}, 'Corpus author'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 338 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 339 | is($meta->keywords('K_keywords'), '', 'Keywords'); |
| 340 | is($meta->keywords('K_text_class'), 'Freizeit-Unterhaltung Reisen Politik Ausland', 'Text class'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 341 | |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 342 | # WDD |
Akron | 9c0488f | 2016-01-28 14:17:15 +0100 | [diff] [blame] | 343 | $path = catdir(dirname(__FILE__), 'corpus/WDD/G27/38989'); |
Akron | e4c2e41 | 2016-01-28 15:10:50 +0100 | [diff] [blame] | 344 | ok($doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
Nils Diewald | b3e9ccd | 2016-10-24 15:16:52 +0200 | [diff] [blame] | 345 | like($doc->path, qr!\Q$path\E/!, 'Path'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 346 | ok($doc->parse, 'Parse document'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 347 | $meta = $doc->meta; |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 348 | |
Akron | 1cd5b87 | 2016-03-22 00:23:46 +0100 | [diff] [blame] | 349 | is($doc->text_sigle, 'WDD11/G27/38989', 'text sigle'); |
| 350 | is($doc->doc_sigle, 'WDD11/G27', 'doc sigle'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 351 | is($doc->corpus_sigle, 'WDD11', 'corpus sigle'); |
| 352 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 353 | is($meta->{T_title}, 'Diskussion:Gunter A. Pilz', 'title'); |
| 354 | ok(!$meta->{T_sub_title}, 'subtitle'); |
| 355 | is($meta->{D_pub_date}, '20111029', 'pubdate'); |
| 356 | is($meta->{S_pub_place}, 'URL:http://de.wikipedia.org', 'pubplace'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 357 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 358 | is($meta->{T_author}, '€pa, u.a.', 'author'); |
| 359 | is($meta->{A_publisher}, 'Wikipedia', 'publisher'); |
| 360 | is($meta->{A_editor}, 'wikipedia.org', 'Editor'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 361 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 362 | is($meta->{S_text_type}, 'Diskussionen zu Enzyklopädie-Artikeln', 'text type'); |
| 363 | ok(!$meta->{S_text_type_art}, 'text type art'); |
| 364 | ok(!$meta->{S_text_type_ref}, 'text type ref'); |
| 365 | ok(!$meta->{S_text_column}, 'text column'); |
| 366 | ok(!$meta->{S_text_domain}, 'text domain'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 367 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 368 | is($meta->{D_creation_date}, '20070707', 'creation date'); |
| 369 | is($meta->{S_availability}, 'CC-BY-SA', 'License'); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 370 | ok(!$meta->{pages}, 'Pages'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 371 | ok(!$meta->{A_file_edition_statement}, 'file edition statement'); |
| 372 | ok(!$meta->{A_bibl_edition_statement}, 'bibl edition statement'); |
| 373 | is($meta->{A_reference}, 'Diskussion:Gunter A. Pilz, In: Wikipedia - URL:http://de.wikipedia.org/wiki/Diskussion:Gunter_A._Pilz: Wikipedia, 2007', 'Reference'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 374 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 375 | is($meta->{S_language}, 'de', 'Language'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 376 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 377 | is($meta->{T_doc_title}, 'Wikipedia, Diskussionen zu Artikeln mit Anfangsbuchstabe G, Teil 27', 'Doc title'); |
| 378 | ok(!$meta->{T_doc_sub_title}, 'Doc Sub title'); |
| 379 | ok(!$meta->{A_doc_editor}, 'Doc editor'); |
| 380 | ok(!$meta->{T_doc_author}, 'Doc author'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 381 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 382 | is($meta->{T_corpus_title}, 'Wikipedia', 'Corpus title'); |
| 383 | ok(!$meta->{T_corpus_sub_title}, 'Corpus Sub title'); |
| 384 | is($meta->{A_corpus_editor}, 'wikipedia.org', 'Corpus editor'); |
| 385 | ok(!$meta->{T_corpus_author}, 'Corpus author'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 386 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 387 | is($meta->keywords('keywords'), '', 'Keywords'); |
| 388 | is($meta->keywords('text_class'), '', 'Text class'); |
Nils Diewald | feccbb1 | 2015-06-18 20:06:45 +0000 | [diff] [blame] | 389 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 390 | is($meta->{S_availability}, 'CC-BY-SA', 'Availability'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 391 | |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 392 | use_ok('KorAP::XML::Meta::I5'); |
| 393 | |
| 394 | $path = catdir(dirname(__FILE__), 'corpus', 'I5', 'rei-example.i5'); |
| 395 | ok($meta = KorAP::XML::Meta::I5->new, 'Construct meta object'); |
Akron | 3ec0a1c | 2017-01-18 14:41:55 +0100 | [diff] [blame] | 396 | my $dom = Mojo::DOM->new->parse(Mojo::File->new($path)->slurp); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 397 | ok($meta->parse($dom->at('idsHeader'), 'corpus'), 'Parse corpus header'); |
| 398 | |
| 399 | my $hash = $meta->to_hash; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 400 | is($hash->{S_availability}, 'CC-BY-SA', 'Availability'); |
| 401 | is($hash->{S_language}, 'de', 'Language'); |
| 402 | is($hash->{T_corpus_title}, 'Reden und Interviews', 'Corpus title'); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 403 | is($hash->{corpus_sigle}, 'REI', 'Corpus Sigle'); |
| 404 | |
| 405 | ok($meta->parse($dom->find('idsHeader')->[1], 'doc'), 'Parse corpus header'); |
| 406 | |
| 407 | $hash = $meta->to_hash; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 408 | is($hash->{S_availability}, 'CC-BY-SA', 'Availability'); |
| 409 | is($hash->{S_language}, 'de', 'Language'); |
| 410 | is($hash->{T_corpus_title}, 'Reden und Interviews', 'Corpus title'); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 411 | is($hash->{corpus_sigle}, 'REI', 'Corpus Sigle'); |
| 412 | is($hash->{doc_sigle}, 'REI/BNG', 'Document Sigle'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 413 | is($hash->{T_doc_title}, 'Reden der Bundestagsfraktion Bündnis 90/DIE GRÜNEN, (2002-2006)', 'Document Sigle'); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 414 | |
| 415 | ok($meta->parse($dom->find('idsHeader')->[2], 'text'), 'Parse corpus header'); |
| 416 | |
| 417 | $hash = $meta->to_hash; |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 418 | is($hash->{S_availability}, 'CC-BY-SA', 'Availability'); |
| 419 | is($hash->{S_language}, 'de', 'Language'); |
| 420 | is($hash->{T_corpus_title}, 'Reden und Interviews', 'Corpus title'); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 421 | is($hash->{corpus_sigle}, 'REI', 'Corpus Sigle'); |
| 422 | is($hash->{doc_sigle}, 'REI/BNG', 'Document Sigle'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 423 | is($hash->{T_doc_title}, 'Reden der Bundestagsfraktion Bündnis 90/DIE GRÜNEN, (2002-2006)', 'Document Sigle'); |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 424 | |
| 425 | is($hash->{text_sigle}, 'REI/BNG/00001'); |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 426 | is($hash->{T_title}, 'Energiewirtschaft'); |
| 427 | is($hash->{T_sub_title}, 'Rede im Deutschen Bundestag am 19.01.2002'); |
| 428 | is($hash->{D_creation_date}, '20020119'); |
| 429 | is($hash->{D_pub_date}, '20020119'); |
| 430 | is($hash->{S_pub_place_key}, 'DE'); |
| 431 | is($hash->{A_reference}, 'Hustedt, Michaele: Energiewirtschaft. Rede im Deutschen Bundestag am 19.01.2002, Hrsg: Bundestagsfraktion Bündnis 90/DIE GRÜNEN [Ausführliche Zitierung nicht verfügbar]'); |
| 432 | is($hash->{K_text_class}->[0], 'politik'); |
| 433 | is($hash->{K_text_class}->[1], 'inland'); |
| 434 | is($hash->{T_author}, 'Hustedt, Michaele'); |
| 435 | is($hash->{S_pub_place}, 'Berlin'); |
Akron | a866578 | 2016-01-27 21:47:57 +0100 | [diff] [blame] | 436 | |
Akron | 0465de5 | 2017-02-07 22:30:08 +0100 | [diff] [blame] | 437 | |
| 438 | # UMB45/D38/00001 |
| 439 | $path = catdir(dirname(__FILE__), 'corpus','UMB45','D38','00001'); |
| 440 | ok($doc = KorAP::XML::Krill->new( path => $path), 'Load Korap::Document'); |
| 441 | like($doc->path, qr!\Q$path\E/!, 'Path'); |
| 442 | |
| 443 | ok($doc->parse, 'Parse document'); |
| 444 | $meta = $doc->meta; |
| 445 | |
| 446 | is($doc->text_sigle, 'UMB45/D38/00001', 'text sigle'); |
| 447 | is($doc->doc_sigle, 'UMB45/D38', 'doc sigle'); |
| 448 | is($doc->corpus_sigle, 'UMB45', 'corpus sigle'); |
| 449 | |
Akron | 5eb3aa0 | 2019-01-25 18:30:47 +0100 | [diff] [blame^] | 450 | is($meta->{T_title}, 'In: Über Schuld und Aufgabe der geistigen Führungsschicht im deutschen politischen Leben der Gegenwart. - Göttingen, 1955', 'title'); |
Akron | 0465de5 | 2017-02-07 22:30:08 +0100 | [diff] [blame] | 451 | |
| 452 | |
Nils Diewald | 8e323ee | 2014-04-23 17:28:14 +0000 | [diff] [blame] | 453 | done_testing; |
| 454 | __END__ |
Akron | fbf6638 | 2016-07-12 19:44:01 +0200 | [diff] [blame] | 455 | |
| 456 | |
| 457 | |