Added struct support and PTI
Change-Id: Ia418958e1c26f2c83026c29089be806cad157762
diff --git a/t/index/base_paragraphs.t b/t/index/base_paragraphs.t
new file mode 100644
index 0000000..2abc198
--- /dev/null
+++ b/t/index/base_paragraphs.t
@@ -0,0 +1,64 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use Scalar::Util qw/weaken/;
+
+use_ok('KorAP::Document');
+
+use File::Basename 'dirname';
+use File::Spec::Functions 'catdir';
+
+my $path = catdir(dirname(__FILE__), 'corpus', 'doc', 'text');
+
+ok(my $doc = KorAP::Document->new(
+ path => $path . '/'
+), 'Load Korap::Document');
+
+like($doc->path, qr!$path/$!, 'Path');
+ok($doc->parse, 'Parse document');
+
+ok($doc->primary->data, 'Primary data in existence');
+is($doc->primary->data_length, 129, 'Data length');
+
+use_ok('KorAP::Tokenizer');
+
+ok(my $tokens = KorAP::Tokenizer->new(
+ path => $doc->path,
+ doc => $doc,
+ foundry => 'OpenNLP',
+ layer => 'Tokens',
+ name => 'tokens'
+), 'New Tokenizer');
+
+ok($tokens->parse, 'Parse');
+
+ok($tokens->add('Base', 'Paragraphs'), 'Add Structure');
+
+
+done_testing;
+
+__END__
+
+
+
+
+
+done_testing;
+__END__
+
+
+sub new_tokenizer {
+ my $x = $doc;
+ weaken $x;
+ return KorAP::Tokenizer->new(
+ path => $x->path,
+ doc => $x,
+ foundry => 'DeReKo',
+ layer => 'Structure',
+ name => 'spans'
+ )
+};
+
+__END__