Handle UDPipe comments and ignore non-interpretable comments
TODO:
* handle XPosTags (column 5)?
* convert more metadata (udpipe_model_licence, ...)
Resolves #1, #2
Change-Id: Ic29125bdcdf7ba9bb8d84c94757a72cea6bcf500
diff --git a/t/test.t b/t/test.t
index 3a34be9..23ee224 100644
--- a/t/test.t
+++ b/t/test.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 41;
+use Test::More tests => 46;
use Test::Script;
use Test::TempDir::Tiny;
use File::Copy;
@@ -181,4 +181,19 @@
$zipcontent = `$UNZIP -c $zipfile`;
unlike($zipcontent, qr/.*name ="lemma".*/, "conllu2korapxml igores _ lemmas.");
like($zipcontent, qr/.*<f name="pos">NN|NN<\/f>.*/, "conllu2korapxml does not ignore pos for _ lemmas.");
+
+script_runs([ 'script/conllu2korapxml', '-l', 'debug', 't/data/goe.ud.conllu' ], {stdout => \$zipcontent}, "Runs conllu2korap with UDPipe and unparsable comments");
+script_stderr_like "Foundry:\\s+ud", "Found generator based foundry";
+script_stderr_like "Ignored\\s+foundry\\s+name:\\s+base", "Ignore defined foundry";
+
+$zipfile = "$test_tempdir/goe.ud.zip";
+open($fh, ">", $zipfile) or fail("cannot open file $zipfile for writing");
+print $fh $zipcontent;
+close($fh);
+
+$zipcontent = `$UNZIP -l $zipfile`;
+like($zipcontent, qr@GOE/AGA/00000/ud/morpho\.xml@, "conllu2korapxml UDPipe input conversion contains morpho layer with foundry name 'ud'");
+like($zipcontent, qr@GOE/AGA/00000/ud/dependency\.xml@, "conllu2korapxml UDPipe input conversion contains dependency layer with foundry name 'ud'");
+
+
done_testing;