blob: f740cad3731cf6cd359c70ad91418a1303cabd4e [file] [log] [blame]
Akron601fc152016-01-16 14:51:07 +01001package TestInit;
2use strict;
3use warnings;
4use File::Basename 'dirname';
5use File::Spec::Functions 'catdir';
6use KorAP::Tokenizer;
7use KorAP::Document;
8
9sub tokens {
10 my $file = shift;
11 my $path = catdir(dirname(__FILE__), 'corpus', 'doc', $file);
12
13 my $doc = KorAP::Document->new(
14 path => $path . '/'
15 ) or return;
16
17 $doc->parse;
18
19 my $tokens = KorAP::Tokenizer->new(
20 path => $doc->path,
21 doc => $doc,
22 foundry => 'OpenNLP',
23 layer => 'Tokens',
24 name => 'tokens'
25 ) or return;
26
27 $tokens->parse or return;
28
29 return $tokens;
30};
31
321;