blob: 7abf629fc190a1a47e85eed6a6dfdf62a03e0b68 [file] [log] [blame]
Akrona8665782016-01-27 21:47:57 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More;
6use Scalar::Util qw/weaken/;
7use Data::Dumper;
8use lib 't/index';
9use TestInit;
10use File::Basename 'dirname';
11use File::Spec::Functions 'catdir';
12
13
14my $path = catdir(dirname(__FILE__), 'corpus', 'doc', '0001');
15
16ok(my $doc = KorAP::Document->new( path => $path . '/' ), 'Load Korap::Document');
17ok($doc->parse, 'Parse document');
18like($doc->path, qr!$path/!, 'Path');
19
20is($doc->primary->data,
21 'Zum letzten kulturellen Anlass lädt die Leitung des Schulheimes Hofbergli ein, '.
22 'bevor der Betrieb Ende Schuljahr eingestellt wird.', 'Primary data');
23
24is($doc->primary->data_length, 129, 'Primary data length');
25
26is($doc->primary->data(0,3), 'Zum', 'Get primary data');
27
28
29done_testing;
30
31__END__