Introduce --skip-inline-token-annotations parameter in favor of KORAPXMLTEI_INLINE
Change-Id: I6eec3873f872b07ab60de720e5a198c6e453d1d6
diff --git a/script/tei2korapxml b/script/tei2korapxml
index 5740407..e0b07ea 100755
--- a/script/tei2korapxml
+++ b/script/tei2korapxml
@@ -38,6 +38,10 @@
DEBUG => $ENV{KORAPXMLTEI_DEBUG} // 0
};
+if ($ENV{KORAPXMLTEI_INLINE}) {
+ warn 'KORAPXMLTEI_INLINE is deprecated in favor of --skip-inline-token-annotations';
+};
+
# Parse options from the command line
GetOptions(
'root|r=s' => \(my $root_dir = '.'),
@@ -49,6 +53,8 @@
'inline-tokens=s' => \(my $inline_tokens = 'tokens#morpho'),
'inline-structures=s' => \(my $inline_structures = 'struct#structure'),
'skip-inline-tokens' => \(my $skip_inline_tokens = 0),
+ 'skip-inline-token-annotations' => \(
+ my $skip_inline_token_annotations = ($ENV{KORAPXMLTEI_INLINE} ? 0 : 1)),
'skip-inline-tags=s' => \(my $skip_inline_tags_str = ''),
'base-foundry=s' => \(my $base_dir = 'base'),
'data-file=s' => \(my $data_file = 'data'),
@@ -130,9 +136,6 @@
# i.e. tokens of the $_TOKENS_TAG, if $_TOKENS_PROC is set
my ($_tokens_dir, $_tokens_file) = split '#', $inline_tokens . '#morpho';
-# Handling inline annotations (inside $_TOKENS_TAG)
-my $_INLINE_ANNOT = $ENV{KORAPXMLTEI_INLINE} ? 1 : 0;
-
# Initialize zipper
my $zipper = KorAP::XML::TEI::Zipper->new($root_dir);
@@ -282,7 +285,8 @@
$inline->tokens->to_zip(
$zipper->new_stream("$dir/$_tokens_dir/${_tokens_file}.xml"),
$text_id_esc,
- $_INLINE_ANNOT # Either 0 = tokens without inline or 1 = tokens with inline
+ # Either 0 = tokens without inline or 1 = tokens with inline
+ !$skip_inline_token_annotations
);
};
@@ -504,6 +508,12 @@
Boolean flag indicating that inline tokens should not
be processed. Defaults to false (meaning inline tokens will be processed).
+=item B<--skip-inline-token-annotations>
+
+Boolean flag indicating that inline token annotations should not
+be processed. Defaults to true (meaning inline token annotations
+won't be processed).
+
=item B<--skip-inline-tags> <tags>
Expects a comma-separated list of tags to be ignored when the structure
@@ -569,11 +579,6 @@
Activate minimal debugging.
Defaults to C<false>.
-=item B<KORAPXMLTEI_INLINE>
-
-Process inline annotations, if present.
-Defaults to C<false>.
-
=back
=head1 COPYRIGHT AND LICENSE