blob: 821c4a6f5cb0c0433cea3065423fc224fa1dee03 [file] [log] [blame]
Akrond99f8c82016-01-07 21:08:45 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Test::More skip_all => 'Not yet implemented';
6use Scalar::Util qw/weaken/;
7use Data::Dumper;
8
9use_ok('KorAP::Document');
10
11use File::Basename 'dirname';
12use File::Spec::Functions 'catdir';
13
Akron601fc152016-01-16 14:51:07 +010014my $path = catdir(dirname(__FILE__), 'corpus', 'doc', '0001');
Akrond99f8c82016-01-07 21:08:45 +010015
16ok(my $doc = KorAP::Document->new(
17 path => $path . '/'
18), 'Load Korap::Document');
19
20like($doc->path, qr!$path/$!, 'Path');
21ok($doc->parse, 'Parse document');
22
23ok($doc->primary->data, 'Primary data in existence');
24is($doc->primary->data_length, 129, 'Data length');
25
26use_ok('KorAP::Tokenizer');
27
28ok(my $tokens = KorAP::Tokenizer->new(
29 path => $doc->path,
30 doc => $doc,
31 foundry => 'OpenNLP',
32 layer => 'Tokens',
33 name => 'tokens'
34), 'New Tokenizer');
35
36ok($tokens->parse, 'Parse');
37
38ok($tokens->add('Mate', 'Dependency'), 'Add Structure');
39
40# my $data = $tokens->to_data->{data};
41
42done_testing;
43
44__END__
45