blob: 50891f8d197b225771ecc75eb4e9057a1d6ba3bb [file] [log] [blame]
Akron14c7f672016-01-26 18:42:44 +01001use strict;
2use warnings;
3use Test::More;
4use File::Basename 'dirname';
5use File::Spec::Functions 'catdir';
6use Data::Dumper;
7use KorAP::Tokenizer;
8use KorAP::Document;
9use utf8;
10
11my $path = catdir(dirname(__FILE__), 'TEST', 'BSP', 1);
12
13ok(my $doc = KorAP::Document->new(
14 path => $path . '/'
15), 'Create Document');
16
17ok($doc->parse, 'Parse document');
18
19like($doc->path, qr!$path/!, 'Path');
20
21# Metdata
22is($doc->text_sigle, 'TEST_BSP.1', 'ID-text');
23is($doc->doc_sigle, 'TEST_BSP', 'ID-doc');
24is($doc->corpus_sigle, 'TEST', 'ID-corpus');
25
Akron9d8cbc52016-01-27 21:47:57 +010026is($doc->title, 'Sommerüberraschung', 'title');
27#is($doc->sub_title, 'Beispiel Text Untertitel', 'title');
28#is($doc->pub_date, '20010402', 'Publication date');
29#is($doc->pub_place, 'Mannheim', 'Publication place');
30is($doc->author, 'TEST.BSP.Autoren.1', 'Author');
31is($doc->store('sgbrAuthorAgeClass'), 'X', 'AgeClass');
32is($doc->store('sgbrAuthorSex'), 'M', 'Sex');
33is($doc->store('sgbrKodex'), 'M', 'Kodex');
34
35is($doc->doc_title, 'Beispielkorpus', 'Doc: title');
36is($doc->doc_sub_title, 'Subkorpus Beispieltext', 'Doc: subtitle');
37
38is($doc->language, 'de', 'Language');
39
40ok(!$doc->publisher, 'Publisher');
41ok(!$doc->editor, 'Editor');
42ok(!$doc->text_type, 'Text Type');
43ok(!$doc->text_type_art, 'Text Type Art');
44ok(!$doc->text_type_ref, 'Text Type Ref');
45ok(!$doc->text_column, 'Text Column');
46ok(!$doc->text_domain, 'Text Domain');
47ok(!$doc->creation_date, 'Creation Date');
48ok(!$doc->license, 'License');
49ok(!$doc->pages, 'Pages');
50ok(!$doc->file_edition_statement, 'File Edition Statement');
51ok(!$doc->bibl_edition_statement, 'Bibl Edition Statement');
52ok(!$doc->reference, 'Reference');
53
54ok(!$doc->doc_editor, 'Doc: editor');
55ok(!$doc->doc_author, 'Doc: author');
56
57ok(!$doc->corpus_title, 'Corpus: title');
58ok(!$doc->corpus_sub_title, 'Corpus: subtitle');
59ok(!$doc->corpus_editor, 'Corpus: editor');
60ok(!$doc->corpus_author, 'Corpus: author');
Akron14c7f672016-01-26 18:42:44 +010061
62done_testing;
Akron9d8cbc52016-01-27 21:47:57 +010063
64
65__END__