blob: b03dad205e78625cf273706e3221a7c15b6ce542 [file] [log] [blame]
package TestInit;
use strict;
use warnings;
use File::Basename 'dirname';
use File::Spec::Functions 'catdir';
use KorAP::XML::Tokenizer;
use KorAP::XML::Krill;
sub tokens {
my $file = shift;
my $path = catdir(dirname(__FILE__), 'corpus', 'doc', $file);
my $doc = KorAP::XML::Krill->new(
path => $path . '/'
) or return;
$doc->parse;
my $tokens = KorAP::XML::Tokenizer->new(
path => $doc->path,
doc => $doc,
foundry => 'OpenNLP',
layer => 'Tokens',
name => 'tokens'
) or return;
$tokens->parse or return;
return $tokens;
};
1;