Akron | f683310 | 2022-02-17 18:35:03 +0100 | [diff] [blame] | 1 | use strict; |
| 2 | use warnings; |
| 3 | use utf8; |
| 4 | use Test::More; |
| 5 | use Benchmark ':hireswallclock'; |
| 6 | use Mojo::DOM; |
| 7 | use Mojo::File; |
| 8 | use Mojo::ByteStream 'b'; |
| 9 | use Data::Dumper; |
| 10 | use File::Basename 'dirname'; |
| 11 | use File::Spec::Functions 'catdir'; |
| 12 | use lib 'lib', '../lib'; |
| 13 | |
| 14 | use_ok('KorAP::XML::Krill'); |
| 15 | |
| 16 | # ART |
| 17 | my $path = catdir(dirname(__FILE__), 'corpus','artificial'); |
| 18 | ok(my $doc = KorAP::XML::Krill->new( path => $path . '/' ), 'Load Korap::Document'); |
| 19 | |
| 20 | ok($doc->parse, 'Parse document'); |
| 21 | |
| 22 | $doc->parse; |
| 23 | |
| 24 | my $tokens = KorAP::XML::Tokenizer->new( |
| 25 | path => $doc->path, |
| 26 | doc => $doc, |
| 27 | foundry => 'OpenNLP', |
| 28 | layer => 'tokens_wrong', |
| 29 | name => 'Tokens' |
| 30 | ); |
| 31 | |
| 32 | # Order is wrong! |
| 33 | ok(!$tokens->parse, 'Parse tokens'); |
| 34 | |
| 35 | done_testing; |
| 36 | __END__ |
| 37 | |