blob: 386567f5148fcb076936e4a99e3caaa89a8b324b [file] [log] [blame]
Marc Kupietz5e7f20a2020-02-17 18:17:11 +01001#!/usr/bin/env perl
2use strict;
3use warnings;
4use POSIX;
Marc Kupietz6a79cad2021-03-19 16:26:58 +01005use Log::Any '$log';
6use Log::Any::Adapter;
7use Pod::Usage;
8use Getopt::Long qw(GetOptions :config no_auto_abbrev);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +01009use Encode;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010010
11my $MAX_SENTENCE_LENGTH=10000;
12my $COMMENT_START="#";
Marc Kupietza2680b92021-10-11 17:24:28 +020013my $COMMENT_END="";
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010014
15my $test=0;
16my $text_no=0;
17my %opts;
18my %plain_texts;
Marc Kupietzd8455832021-02-11 17:30:29 +010019my %sentence_ends;
20
Marc Kupietz4cc243a2021-10-11 17:15:16 +020021our $VERSION = '0.4.1.9000';
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010022
Marc Kupietz0ab8a2c2021-03-19 16:21:00 +010023our $VERSION_MSG = "\nkorapxml2conllu - v$VERSION\n";
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010024
Marc Kupietz6a79cad2021-03-19 16:26:58 +010025use constant {
26 # Set to 1 for minimal more debug output (no need to be parametrized)
27 DEBUG => $ENV{KORAPXMLCONLLU_DEBUG} // 0
28};
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010029
Marc Kupietz6a79cad2021-03-19 16:26:58 +010030GetOptions(
31 'sigle-pattern|p=s' => \(my $sigle_pattern = ''),
Marc Kupietzeb7d06a2021-03-19 16:29:16 +010032 'extract-attributes-regex|e=s' => \(my $extract_attributes_regex = ''),
Marc Kupietz6a79cad2021-03-19 16:26:58 +010033 'log|l=s' => \(my $log_level = 'warn'),
Marc Kupietzd7d5d6a2021-10-11 17:52:58 +020034 'columns|c=n' => \(my $columns = 10),
Marc Kupietzd8455832021-02-11 17:30:29 +010035
Marc Kupietz6a79cad2021-03-19 16:26:58 +010036 'help|h' => sub {
37 pod2usage(
38 -verbose => 99,
39 -sections => 'NAME|DESCRIPTION|SYNOPSIS|ARGUMENTS|OPTIONS|EXAMPLES',
40 -msg => $VERSION_MSG,
41 -output => '-'
42 )
43 },
44 'version|v' => sub {
45 pod2usage(
46 -verbose => 0,
47 -msg => $VERSION_MSG,
48 -output => '-'
49 );
50 }
51);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010052
Marc Kupietz6a79cad2021-03-19 16:26:58 +010053# Establish logger
54binmode(STDERR, ':encoding(UTF-8)');
55Log::Any::Adapter->set('Stderr', log_level => $log_level);
56$log->notice('Debugging is activated') if DEBUG;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010057
58my $docid="";
59my ($current_id, $current_from, $current_to, $token);
60my $current;
61my ($unknown, $known) = (0, 0);
62my @current_lines;
63my %processedFilenames;
64my $zipsiglepattern = (defined($ENV{ZIPSIGLEPATTERN})? $ENV{ZIPSIGLEPATTERN} : "");
Marc Kupietzd8455832021-02-11 17:30:29 +010065my $baseOnly;
Marc Kupietzeb7d06a2021-03-19 16:29:16 +010066my %extras;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010067
68my ($ID_idx, $FORM_idx, $LEMMA_idx, $UPOS_idx, $XPOS_idx, $FEATS_idx, $HEAD_idx, $DEPREC_idx, $DEPS_idx, $MISC_idx) = (0..9);
69
Marc Kupietzc7d1b932020-09-23 13:17:17 +020070my $UNZIP = `sh -c 'command -v unzip'`;
71chomp $UNZIP;
72
73
74if ($UNZIP eq '') {
75 warn('No unzip executable found in PATH.');
76 return 0;
77};
78
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010079foreach my $morpho_zip (@ARGV) {
80 die "cannot open $morpho_zip" if(! -r $morpho_zip);
81 my $data_zip = $morpho_zip;
82 if ($data_zip !~ /\.zip/ && $data_zip =~ /\.conllu?/i) {
83 open(CONLL, "<$data_zip") or die "cannot open $data_zip";
84 while(<CONLL>) {
85 print;
86 }
87 close(CONLL);
88 next;
89 }
90 $data_zip =~ s/\.([^.]+)\.zip$/.zip/;
91 my $foundry = $1;
92 die "cannot open data file $data_zip corresponding to $morpho_zip" if(! -r $data_zip);
93
94 my $first=1;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +010095 my @conll = ("_") x 10;
96 my $filename;
97
Marc Kupietzd8455832021-02-11 17:30:29 +010098 $baseOnly = $morpho_zip eq $data_zip;
99 my ($morphoOrTokenCommand, $plaintextAndStructureCommand);
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100100 if (!$baseOnly) {
101 $morphoOrTokenCommand = "$UNZIP -c $morpho_zip '*/${sigle_pattern}*/*/*/morpho.xml' $zipsiglepattern |";
102 if ($extract_attributes_regex) {
103 $plaintextAndStructureCommand = "$UNZIP -c $data_zip '*/${sigle_pattern}*/*/[sd][ta]*.xml' $zipsiglepattern |";
104 } else {
105 $plaintextAndStructureCommand = "$UNZIP -c $data_zip '*/${sigle_pattern}*/*/data.xml' $zipsiglepattern |";
106 }
Marc Kupietzd8455832021-02-11 17:30:29 +0100107 } else {
108 $foundry = "base";
Marc Kupietzf1fdc192021-10-08 13:29:59 +0200109 $morphoOrTokenCommand = "$UNZIP -l $morpho_zip '*/${sigle_pattern}*/*/*/morpho.xml' $zipsiglepattern";
110 if (`$morphoOrTokenCommand` !~ /morpho\.xml/) {
111 $morphoOrTokenCommand =~ s/morpho\.xml/tokens.xml/;
112 } else {
113 $baseOnly = 0;
114 }
115 $morphoOrTokenCommand =~ s/-l/-c/;
116 $morphoOrTokenCommand .= ' |';
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100117 $plaintextAndStructureCommand = "$UNZIP -c $data_zip '*/${sigle_pattern}*/*/[sd][ta]*.xml' $zipsiglepattern |";
Marc Kupietzd8455832021-02-11 17:30:29 +0100118 }
119
120 open (MORPHO_OR_TOKENPIPE, $morphoOrTokenCommand) or die "cannot unzip $morpho_zip";
121 open (PLAINTEXTPIPE, $plaintextAndStructureCommand) or die "cannot unzip $data_zip";
Marc Kupietza2680b92021-10-11 17:24:28 +0200122 print "$COMMENT_START foundry = $foundry$COMMENT_END\n";
Marc Kupietzd8455832021-02-11 17:30:29 +0100123 while (<MORPHO_OR_TOKENPIPE>) {
Marc Kupietz30c41b12020-09-22 14:32:34 +0200124 if (/^ inflating: (.*)/) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100125 $filename=$1;
Marc Kupietzd8455832021-02-11 17:30:29 +0100126 while($processedFilenames{$filename} && !eof(MORPHO_OR_TOKENPIPE)) {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100127 $log->warn("$filename already processed");
Marc Kupietzd8455832021-02-11 17:30:29 +0100128 while (<MORPHO_OR_TOKENPIPE>) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100129 last if(/\s+inflating:\s+(.*)/);
130 }
Marc Kupietzd8455832021-02-11 17:30:29 +0100131 $filename=$1 if(!eof(MORPHO_OR_TOKENPIPE) && /\s+inflating:\s+(.*)/);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100132 }
Marc Kupietz30c41b12020-09-22 14:32:34 +0200133 } elsif(m@^\s*<layer\s+.*docid="([^"]+)"@) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100134 last if($test && $text_no++ > 3);
135 if(!$first) {
136 closeDoc(0);
137 }
138 $processedFilenames{$filename}=1;
139 $docid=$1;
140 @current_lines=();
141 $known=$unknown=0;
142 $current="";
143 if ($first) {
144 $first = 0;
145 }
146 if(!fetch_plaintext($docid)) { # skip this text
Marc Kupietzd8455832021-02-11 17:30:29 +0100147 while (<MORPHO_OR_TOKENPIPE>) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100148 last if(m@</layer>@);
149 }
150 }
Marc Kupietza2680b92021-10-11 17:24:28 +0200151 print STDOUT "$COMMENT_START filename = $filename$COMMENT_END\n$COMMENT_START text_id = $docid$COMMENT_END\n";
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100152 $log->debug("Analyzing $docid");
Marc Kupietz30c41b12020-09-22 14:32:34 +0200153 } elsif (m@^\s*<f\s+.*name="([^"]+)">([^<]+)</f>@) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100154 if ($1 eq "lemma") {
155 $conll[$LEMMA_idx] = $2;
156 $conll[$LEMMA_idx] =~ s/[\t\n\r]//g; # make sure that lemmas never contain tabs or newlines
157 if($conll[$LEMMA_idx] eq 'UNKNOWN') {
158 $conll[$LEMMA_idx] = "--";
159 $unknown++;
160 } else {
161 $known++;
162 }
163 } elsif ($1 eq 'pos' || $1 eq "ctag") {
164 $unknown++;
165 $conll[$XPOS_idx] = $conll[$UPOS_idx] = $2;
166 } elsif ($1 eq 'msd') {
167 $conll[$FEATS_idx] = $2;
168 } elsif ($1 eq 'certainty') {
169 $conll[$MISC_idx] = $2;
170 }
171 } elsif (/<span /) {
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100172 my $last_from = $current_from // -1;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100173 ($current_id) = /id="[^0-9]*([^\"]*)"/;
174 ($current_from) = /from="([^\"]*)"/;
175 ($current_to) = /to="([^\"]*)"/;
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100176 if($extract_attributes_regex) {
177 for (my $i = $last_from + 1; $i <= $current_from; $i++) {
178 if ($extras{$docid}{$i}) {
179 $current .= $extras{$docid}{$i};
180 undef $extras{$docid}{$i};
181 }
182 }
183 }
Marc Kupietz1db65e52021-07-31 23:38:07 +0200184# $log->debug("found span: $current_id $current_from $current_to");
Marc Kupietz7e71a822020-06-22 17:14:30 +0200185 $token = substr($plain_texts{$docid}, $current_from, $current_to - $current_from);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100186 if (!defined $token) {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100187 $log->warn("could not retrieve token for $docid at $current_from-$current_to/", length($plain_texts{$docid}), " - ending with: ", substr($plain_texts{$docid},length($plain_texts{$docid})-10));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100188 $token = "_";
189 }
190 $token=~s/[\t\n\r]//g; # make sure that tokens never contain tabs or newlines
191 @conll = ("_") x 10;
192 $conll[$FORM_idx] = encode("utf-8", $token);
Marc Kupietzd8455832021-02-11 17:30:29 +0100193 if($baseOnly) {
194 my @vals = ($current_from, $current_to);
Marc Kupietz1db65e52021-07-31 23:38:07 +0200195# $log->debug("joining : ", join(" ", @vals));
Marc Kupietzd8455832021-02-11 17:30:29 +0100196 push @current_lines, \@vals;
197 $known++;
198 $conll[$ID_idx] = $#current_lines+1;
Marc Kupietzd7d5d6a2021-10-11 17:52:58 +0200199 if ($columns == 1) {
200 $current .= "$conll[1]\n";
201 } else {
202 $current .= join("\t", @conll[0..$columns-1]) . "\n"; # conll columns
203 }
Marc Kupietzd8455832021-02-11 17:30:29 +0100204 fetch_plaintext($docid);
205 if ($sentence_ends{$docid}{$current_to}) {
206 $current .= "\n";
207 printTokenRanges();
208 print STDOUT $current;
209 $current = "";
210 $known = 0;
211 $unknown = 0;
212 @current_lines = ();
213 }
214 }
Marc Kupietz30c41b12020-09-22 14:32:34 +0200215 } elsif (m@^\s*</fs>@) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100216 my @vals = ($current_from, $current_to);
Marc Kupietz1db65e52021-07-31 23:38:07 +0200217# $log->debug("joining : ", join(" ", @vals));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100218 push @current_lines, \@vals;
219 # convert gathered information to CONLL
220 $conll[$ID_idx] = $#current_lines+1;
Marc Kupietzd7d5d6a2021-10-11 17:52:58 +0200221 if ($columns == 1) {
222 $current .= "$conll[1]\n";
223 } else {
224 $current .= join("\t", @conll[0..$columns-1]) . "\n"; # conll columns
225 }
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100226 if($conll[$XPOS_idx] eq '$.' || ($conll[$XPOS_idx] eq 'SENT' && $token eq '.') || $known + $unknown >= $MAX_SENTENCE_LENGTH) {
227 $current .= "\n";
228 if($known + $unknown > 0) { # only print sentence if it contains some words
229 printTokenRanges();
230 print STDOUT $current;
231 }
232 $current=""; $known=0; $unknown=0;
233 @current_lines = ();
234 }
Marc Kupietzd8455832021-02-11 17:30:29 +0100235 while (<MORPHO_OR_TOKENPIPE>) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100236 last if (m@</span>@); # only consider first interpretation
237 }
238 }
239 }
240 $current .= "\n";
241 closeDoc(1);
Marc Kupietzd8455832021-02-11 17:30:29 +0100242 close(MORPHO_OR_TOKENPIPE);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100243 close(PLAINTEXTPIPE);
244}
245exit;
246
247sub printTokenRanges {
248 print "$COMMENT_START start_offsets = ", $current_lines[0]->[0];
249 foreach my $t (@current_lines) {
250 print STDOUT " $t->[0]";
251 }
Marc Kupietza2680b92021-10-11 17:24:28 +0200252 print "$COMMENT_END\n$COMMENT_START end_offsets = ", $current_lines[$#current_lines]->[1];
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100253 foreach my $t (@current_lines) {
254 print STDOUT " $t->[1]";
255 }
Marc Kupietza2680b92021-10-11 17:24:28 +0200256 print "$COMMENT_END\n";
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100257}
258
259sub closeDoc {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100260 $log->debug("closing doc");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100261 if($known + $unknown > 0) { # only parse a sentence if it has some words
262 chomp $current;
263 chomp $current;
264 chomp $current;
265 $current .= "\n\n";
266 printTokenRanges();
267 print STDOUT $current;
268 }
269}
270
271# read data.xml to figure out the tokens
272# (ideally tokens should also be in in morpho.xml, but they are not)
273sub fetch_plaintext {
274 my ($target_id) = @_;
275 my $docid;
276 my $text_started=0;
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100277 my $text_count = 0;
Marc Kupietzd8455832021-02-11 17:30:29 +0100278 my ($current_id, $current_from, $current_to);
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100279
Marc Kupietzd8455832021-02-11 17:30:29 +0100280 if($plain_texts{$target_id} && (!$baseOnly || $sentence_ends{$target_id}{-1})) {
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100281# print STDERR "already got $target_id\n";
Marc Kupietz1db65e52021-07-31 23:38:07 +0200282 $log->debug("Already got $target_id");
Marc Kupietzd8455832021-02-11 17:30:29 +0100283 return 1;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100284 }
285 while(<PLAINTEXTPIPE>) {
286 if(/<raw_text[^>]+docid="([^"]*)/) {
287 $docid=$1;
Marc Kupietz1db65e52021-07-31 23:38:07 +0200288 $log->debug("Getting plain text for $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100289 $text_started=0;
Marc Kupietzd8455832021-02-11 17:30:29 +0100290 } elsif(/<layer[^>]+docid="([^"]*)/) {
291 $docid=$1;
292 $sentence_ends{$docid}{-1}=1;
293 } elsif(m@<span @) {
294 ($current_id) = /id="[^0-9]*([^\"]*)"/;
295 ($current_from) = /from="([^\"]*)"/;
296 ($current_to) = /to="([^\"]*)"/;
297 } elsif(m@<f\s[^>]*>s</f>@) {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100298 $log->debug("Found sentence end for $docid \@$current_to");
Marc Kupietzd8455832021-02-11 17:30:29 +0100299 $sentence_ends{$docid}{$current_to}=1;
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100300 } elsif($extract_attributes_regex && m@<f\sname="name"[^>]*>([^<]+)</f>@) {
301 my $current_element = $1;
Marc Kupietz1db65e52021-07-31 23:38:07 +0200302 $log->debug("Looking for matching attributes in $docid");
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100303 while(<PLAINTEXTPIPE>) {
304 last if(m@</fs>@);
305 if(m@<f\sname="([^"]+)"[^>]*>([^<]+)</f>@) {
306 my $current_node = "$current_element/$1";
307 my $value = $2;
308 if ($current_node =~ /$extract_attributes_regex/) {
Marc Kupietz1db65e52021-07-31 23:38:07 +0200309 $log->debug("Found matching attribute: $docid - $current_node = $value");
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100310 $extras{$docid}{$current_from} .= "# $current_node = $value\n";
311 }
312 }
313 }
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100314 } elsif (m@<text>(.*)</text>@) {
315 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
316 s/&lt;/</go;
317 s/&gt;/>/go;
318 s/&amp;/&/go;
319 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
320 $plain_texts{$docid} = $_;
Marc Kupietz093b21c2021-07-31 23:39:51 +0200321 last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100322 } elsif (m@<text>(.*)@) {
323 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
324 s/&lt;/</go;
325 s/&gt;/>/go;
326 s/&amp;/&/go;
327 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
328 $plain_texts{$docid} = "$_ ";
329 $text_started=1;
330 } elsif ($text_started && m@(.*)</text>@) {
331 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
332 s/&lt;/</go;
333 s/&gt;/>/go;
334 s/&amp;/&/go;
335 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
336 $plain_texts{$docid} .= $_;
337 $text_started=0;
Marc Kupietz093b21c2021-07-31 23:39:51 +0200338 last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100339 } elsif ($text_started) {
340 chomp;
341 $_ = decode("utf-8", $_, Encode::FB_DEFAULT) . ' ';
342 s/&lt;/</go;
343 s/&gt;/>/go;
344 s/&amp;/&/go;
345 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
346 $plain_texts{$docid} .= $_;
347 }
348 }
Marc Kupietz1db65e52021-07-31 23:38:07 +0200349 $log->debug("Got plain text for $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100350 if(defined($ENV{PLAINTEXTFILTER})) {
351 if ($plain_texts{$docid} !~ $ENV{PLAINTEXTFILTER}) {
352 $plain_texts{$docid} = undef;
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100353 $log->info("Skipping $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100354 return(undef);
355 } else {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100356 $log->debug("Using $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100357 }
358 }
359 return(1);
360}
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100361
362=pod
363
364=encoding utf8
365
366=head1 NAME
367
368korapxml2conllu - Conversion of KorAP-XML zips to CoNLL-U
369
370=head1 SYNOPSIS
371
372 korapxml2conllu zca15.tree_tagger.zip > zca15.conllu
373
374=head1 DESCRIPTION
375
376C<korapxml2conllu> is a script to Convert L<KorAP-XML format|https://github.com/KorAP/KorAP-XML-Krill#about-korap-xml> base or morpho zips to CoNLL(-U) format with all information necessary
377 for reconstruction in comment lines.
378
379=head1 INSTALLATION
380
381 $ cpanm https://github.com/KorAP/KorAP-XML-CoNLL-U.git
382
383=head1 OPTIONS
384
385=over 2
386
387=item B<--sigle-pattern|-p>
388
389Convert only texts from the KorAP XML zip files with folder names (i.e. sigles) matching the glob pattern.
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100390
391=item B<--extract-attribute-pattern|-e>
392
393Extract element/attribute regular expressions to comments.
394
Marc Kupietzd7d5d6a2021-10-11 17:52:58 +0200395=item B<--columns>=I<int> | B<-c> I<int>
396
397Print n columns (default: 10). If n=1, only the token itself is printed.
398
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100399=item B<--help|-h>
400
401Print help information.
402
403=item B<--version|-v>
404
405Print version information.
406
407
408=item B<--log|-l>
409
410Loglevel for I<Log::Any>. Defaults to C<warn>.
411
412=back
413
414=head1 EXAMPLES
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100415
416 korapxml2conllu -e '(posting/id|div/id)' t/data/wdf19.zip
417
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100418=head1 COPYRIGHT AND LICENSE
419
420Copyright (C) 2021, L<IDS Mannheim|https://www.ids-mannheim.de/>
421
422Author: Marc Kupietz
423
424Contributors: Nils Diewald
425
426L<KorAP::XML::CoNNL-U> is developed as part of the L<KorAP|https://korap.ids-mannheim.de/>
427Corpus Analysis Platform at the
428L<Leibniz Institute for the German Language (IDS)|http://ids-mannheim.de/>,
429member of the
430L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/>.
431
432This program is free software published under the
433L<BSD-2 License|https://opensource.org/licenses/BSD-2-Clause>.