Skip to content

Commit

Permalink
2korapxml: Add -o option
Browse files Browse the repository at this point in the history
Change-Id: I3da2e2848c4229c2b72de468517585f77855c7f5
  • Loading branch information
kupietz committed Jun 25, 2024
1 parent cc39147 commit 187abd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script/conllu2korapxml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use constant {
GetOptions(
'force-foundry|f=s' => \(my $foundry_name = ''),
'log|l=s' => \(my $log_level = 'warn'),
'output|o=s' => \(my $outh = '-'),

'help|h' => sub {
pod2usage(
Expand All @@ -50,7 +51,6 @@ $log->notice('Debugging is activated') if DEBUG;

my $docid="";
my $zip = undef;
my $outh = '-';
my $parser_file;
my $parse;
my $morpho_file;
Expand Down Expand Up @@ -295,6 +295,10 @@ Print version information.
Loglevel for I<Log::Any>. Defaults to C<warn>.
=item B<--output|-o>
Output file. Defaults to C<-> (stdout).
=back
=head1 EXAMPLES
Expand Down
5 changes: 5 additions & 0 deletions t/test.t
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ like($zipcontent, qr/.*<f name="pos">VVFIN<\/f>.*/, "conllu2korapxml extracts (x
unlike($zipcontent, qr/.*<f name="pos">_<\/f>.*/, "conllu2korapxml ignores _ pos tags.");
unlike($zipcontent, qr/.*<f name="upos">_<\/f>.*/, "conllu2korapxml ignores _ upos tags.");

$zipfile = "$test_tempdir/goe.ud2.zip";
script_runs([ 'script/conllu2korapxml', '-l', 'warn', '-o', $zipfile, 't/data/goe.ud.conllu.missing_textid' ], {}, "Runs conllu2korap with -o option");
like($zipcontent, qr@GOE/AGA/00000/ud/morpho\.xml@, "conllu2korapxml UDPipe input conversion -o option contains morpho layer with foundry name 'ud'");
like($zipcontent, qr@GOE/AGA/00000/ud/dependency\.xml@, "conllu2korapxml UDPipe input conversion with -o option contains dependency layer with foundry name 'ud'");

script_runs([ 'script/conllu2korapxml', 't/data/deu-deps.conllu' ], "Runs conllu2korap with UDPipe input");
script_stderr_unlike "fileparse(): need a valid pathname", "Ignore sent_id and newdoc id";
script_stderr_like "WARNING: No valid input document.*token offsets missing", "Warn on missing token offsets";
Expand Down

0 comments on commit 187abd7

Please sign in to comment.