Introduce exclusivity for inline token handling

Change-Id: Ia34ec87b2c55aabd94c65ec1e0d63d0cadb27d75
diff --git a/script/tei2korapxml b/script/tei2korapxml
index 10a2787..0d196a5 100755
--- a/script/tei2korapxml
+++ b/script/tei2korapxml
@@ -42,6 +42,9 @@
   warn 'KORAPXMLTEI_INLINE is deprecated in favor of --skip-inline-token-annotations';
 };
 
+# Inline tokens won't be stored in the structure file
+my $inline_tokens_exclusive = 0;
+
 # Parse options from the command line
 GetOptions(
   'root|r=s'              => \(my $root_dir    = '.'),
@@ -136,6 +139,11 @@
 # i.e. tokens of the $_TOKENS_TAG, if $_TOKENS_PROC is set
 my ($_tokens_dir, $_tokens_file) = split '#', $inline_tokens . '#morpho';
 
+if (index($_tokens_dir, '!') == 0) {
+  $_tokens_dir = substr($_tokens_dir, 1);
+  $inline_tokens_exclusive = 1;
+};
+
 # Initialize zipper
 my $zipper = KorAP::XML::TEI::Zipper->new($root_dir);
 
@@ -168,7 +176,8 @@
 # Create inline parser object
 my $inline = KorAP::XML::TEI::Inline->new(
   $skip_inline_tokens,
-  \%skip_inline_tags
+  \%skip_inline_tags,
+  $inline_tokens_exclusive
 );
 
 
@@ -532,6 +541,17 @@
 this will contain annotations as well.
 Defaults to C<tokens> and C<morpho>.
 
+The inline token data will also be stored in the
+inline structures file (see I<--inline-structures>),
+unless the inline token foundry is prepended
+by an B<!> exclamation mark, indicating that inline
+tokens are stored exclusively in the inline tokens
+file.
+
+Example:
+
+  tei2korapxml --inline-tokens '!gingko#morpho' < data.i5.xml > korapxml.zip
+
 =item B<--inline-structures> <foundry>#[<file>]
 
 Define the foundry and file (without extension)