blob: 9d7b7d55175ca74be1448281ee94b2aefa6cf12a [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 Kupietz1db65e52021-07-31 23:38:07 +0200281 $log->debug("Already got $target_id");
Marc Kupietzd8455832021-02-11 17:30:29 +0100282 return 1;
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100283 }
284 while(<PLAINTEXTPIPE>) {
285 if(/<raw_text[^>]+docid="([^"]*)/) {
286 $docid=$1;
Marc Kupietz1db65e52021-07-31 23:38:07 +0200287 $log->debug("Getting plain text for $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100288 $text_started=0;
Marc Kupietzd8455832021-02-11 17:30:29 +0100289 } elsif(/<layer[^>]+docid="([^"]*)/) {
290 $docid=$1;
291 $sentence_ends{$docid}{-1}=1;
292 } elsif(m@<span @) {
293 ($current_id) = /id="[^0-9]*([^\"]*)"/;
294 ($current_from) = /from="([^\"]*)"/;
295 ($current_to) = /to="([^\"]*)"/;
296 } elsif(m@<f\s[^>]*>s</f>@) {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100297 $log->debug("Found sentence end for $docid \@$current_to");
Marc Kupietzd8455832021-02-11 17:30:29 +0100298 $sentence_ends{$docid}{$current_to}=1;
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100299 } elsif($extract_attributes_regex && m@<f\sname="name"[^>]*>([^<]+)</f>@) {
300 my $current_element = $1;
Marc Kupietz1db65e52021-07-31 23:38:07 +0200301 $log->debug("Looking for matching attributes in $docid");
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100302 while(<PLAINTEXTPIPE>) {
303 last if(m@</fs>@);
304 if(m@<f\sname="([^"]+)"[^>]*>([^<]+)</f>@) {
305 my $current_node = "$current_element/$1";
306 my $value = $2;
307 if ($current_node =~ /$extract_attributes_regex/) {
Marc Kupietz1db65e52021-07-31 23:38:07 +0200308 $log->debug("Found matching attribute: $docid - $current_node = $value");
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100309 $extras{$docid}{$current_from} .= "# $current_node = $value\n";
310 }
311 }
312 }
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100313 } elsif (m@<text>(.*)</text>@) {
314 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
315 s/&lt;/</go;
316 s/&gt;/>/go;
317 s/&amp;/&/go;
318 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
319 $plain_texts{$docid} = $_;
Marc Kupietz093b21c2021-07-31 23:39:51 +0200320 last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100321 } elsif (m@<text>(.*)@) {
322 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
323 s/&lt;/</go;
324 s/&gt;/>/go;
325 s/&amp;/&/go;
326 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
327 $plain_texts{$docid} = "$_ ";
328 $text_started=1;
329 } elsif ($text_started && m@(.*)</text>@) {
330 $_= decode("utf-8", $1, Encode::FB_DEFAULT);
331 s/&lt;/</go;
332 s/&gt;/>/go;
333 s/&amp;/&/go;
334 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
335 $plain_texts{$docid} .= $_;
336 $text_started=0;
Marc Kupietz093b21c2021-07-31 23:39:51 +0200337 last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100338 } elsif ($text_started) {
339 chomp;
340 $_ = decode("utf-8", $_, Encode::FB_DEFAULT) . ' ';
341 s/&lt;/</go;
342 s/&gt;/>/go;
343 s/&amp;/&/go;
344 tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
345 $plain_texts{$docid} .= $_;
346 }
347 }
Marc Kupietz1db65e52021-07-31 23:38:07 +0200348 $log->debug("Got plain text for $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100349 if(defined($ENV{PLAINTEXTFILTER})) {
350 if ($plain_texts{$docid} !~ $ENV{PLAINTEXTFILTER}) {
351 $plain_texts{$docid} = undef;
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100352 $log->info("Skipping $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100353 return(undef);
354 } else {
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100355 $log->debug("Using $docid");
Marc Kupietz5e7f20a2020-02-17 18:17:11 +0100356 }
357 }
358 return(1);
359}
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100360
361=pod
362
363=encoding utf8
364
365=head1 NAME
366
367korapxml2conllu - Conversion of KorAP-XML zips to CoNLL-U
368
369=head1 SYNOPSIS
370
371 korapxml2conllu zca15.tree_tagger.zip > zca15.conllu
372
373=head1 DESCRIPTION
374
375C<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
376 for reconstruction in comment lines.
377
378=head1 INSTALLATION
379
380 $ cpanm https://github.com/KorAP/KorAP-XML-CoNLL-U.git
381
382=head1 OPTIONS
383
384=over 2
385
386=item B<--sigle-pattern|-p>
387
388Convert 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 +0100389
390=item B<--extract-attribute-pattern|-e>
391
392Extract element/attribute regular expressions to comments.
393
Marc Kupietzd7d5d6a2021-10-11 17:52:58 +0200394=item B<--columns>=I<int> | B<-c> I<int>
395
396Print n columns (default: 10). If n=1, only the token itself is printed.
397
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100398=item B<--help|-h>
399
400Print help information.
401
402=item B<--version|-v>
403
404Print version information.
405
406
407=item B<--log|-l>
408
409Loglevel for I<Log::Any>. Defaults to C<warn>.
410
411=back
412
413=head1 EXAMPLES
Marc Kupietzeb7d06a2021-03-19 16:29:16 +0100414
415 korapxml2conllu -e '(posting/id|div/id)' t/data/wdf19.zip
416
Marc Kupietz6a79cad2021-03-19 16:26:58 +0100417=head1 COPYRIGHT AND LICENSE
418
419Copyright (C) 2021, L<IDS Mannheim|https://www.ids-mannheim.de/>
420
421Author: Marc Kupietz
422
423Contributors: Nils Diewald
424
425L<KorAP::XML::CoNNL-U> is developed as part of the L<KorAP|https://korap.ids-mannheim.de/>
426Corpus Analysis Platform at the
427L<Leibniz Institute for the German Language (IDS)|http://ids-mannheim.de/>,
428member of the
429L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/>.
430
431This program is free software published under the
432L<BSD-2 License|https://opensource.org/licenses/BSD-2-Clause>.