korapxml2conllu: add option --colmuns=<n>
Print only n columns and only the token if n=1. Mainly useful to pass data
tools that are not CoNLL-U-ready.
Change-Id: I078093b2484cc9ef9eb40b87c63ec3784d8eae38
diff --git a/t/test.t b/t/test.t
index 8539d10..5d0152f 100644
--- a/t/test.t
+++ b/t/test.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 28;
+use Test::More tests => 30;
use Test::Script;
use Test::TempDir::Tiny;
use File::Copy;
@@ -51,8 +51,18 @@
script_stdout_is $expected, "Converts $base_fname correctly to CoNLL-U";
}
-my $test_tempdir = tempdir();
my $expected;
+if (open(my $fh, '<', 't/data/goe.1c.txt')) {
+ local $/;
+ $expected = <$fh>;
+ close($fh);
+} else {
+ fail("cannot open file.");
+}
+script_runs([ 'script/korapxml2conllu', '-c', '1', 't/data/goe.zip' ], "Runs korapxml2conllu in one column mode");
+script_stdout_is $expected, "Converts correctly in one column mode.";
+
+my $test_tempdir = tempdir();
my $conllu_fname = "t/data/goe.morpho.conllu";
if(open(my $fh, '<', $conllu_fname )) {
local $/;