| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 1 | =pod | 
|  | 2 |  | 
|  | 3 | =encoding utf8 | 
|  | 4 |  | 
|  | 5 | =head1 NAME | 
|  | 6 |  | 
|  | 7 | tei2korapxml - Conversion of TEI P5 based formats to KorAP-XML | 
|  | 8 |  | 
|  | 9 | =head1 SYNOPSIS | 
|  | 10 |  | 
|  | 11 | cat corpus.i5.xml | tei2korapxml > corpus.korapxml.zip | 
|  | 12 |  | 
|  | 13 | =head1 DESCRIPTION | 
|  | 14 |  | 
|  | 15 | C<tei2korapxml> is a script to convert TEI P5 and | 
|  | 16 | L<I5|https://www1.ids-mannheim.de/kl/projekte/korpora/textmodell.html> | 
|  | 17 | based documents to the | 
|  | 18 | L<KorAP-XML format|https://github.com/KorAP/KorAP-XML-Krill#about-korap-xml>. | 
|  | 19 | If no specific input is defined, data is | 
|  | 20 | read from C<STDIN>. If no specific output is defined, data is written | 
|  | 21 | to C<STDOUT>. | 
|  | 22 |  | 
|  | 23 | This program is usually called from inside another script. | 
|  | 24 |  | 
|  | 25 | =head1 FORMATS | 
|  | 26 |  | 
|  | 27 | =head2 Input restrictions | 
|  | 28 |  | 
|  | 29 | =over 2 | 
|  | 30 |  | 
|  | 31 | =item | 
|  | 32 |  | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 33 | TEI P5 formatted input with certain restrictions: | 
|  | 34 |  | 
|  | 35 | =over 4 | 
|  | 36 |  | 
|  | 37 | =item | 
|  | 38 |  | 
|  | 39 | B<mandatory>: text-header with integrated textsigle, text-body | 
|  | 40 |  | 
|  | 41 | =item | 
|  | 42 |  | 
|  | 43 | B<optional>: corp-header with integrated corpsigle, | 
|  | 44 | doc-header with integrated docsigle | 
|  | 45 |  | 
|  | 46 | =back | 
|  | 47 |  | 
|  | 48 | =item | 
|  | 49 |  | 
|  | 50 | All tokens inside the primary text may not be | 
|  | 51 | newline seperated, because newlines are removed | 
|  | 52 | (see L<KorAP::XML::TEI::Data>) and a conversion of newlines | 
|  | 53 | into blanks between 2 tokens could lead to additional blanks, | 
|  | 54 | where there should be none (e.g.: punctuation characters like C<,> or | 
|  | 55 | C<.> should not be seperated from their predecessor token). | 
|  | 56 | (see also code section C<~ whitespace handling ~>). | 
|  | 57 |  | 
|  | 58 | =back | 
|  | 59 |  | 
|  | 60 | =head2 Notes on the output | 
|  | 61 |  | 
|  | 62 | =over 2 | 
|  | 63 |  | 
|  | 64 | =item | 
|  | 65 |  | 
|  | 66 | zip file output (default on C<stdout>) with utf8 encoded entries | 
|  | 67 | (which together form the KorAP-XML format) | 
|  | 68 |  | 
|  | 69 | =back | 
|  | 70 |  | 
|  | 71 | =head1 INSTALLATION | 
|  | 72 |  | 
|  | 73 | C<tei2korapxml> requires L<libxml2-dev> bindings to build. When | 
|  | 74 | these bindings are available, the preferred way to install the script is | 
|  | 75 | to use L<cpanm|App::cpanminus>. | 
|  | 76 |  | 
|  | 77 | $ cpanm https://github.com/KorAP/KorAP-XML-TEI.git | 
|  | 78 |  | 
|  | 79 | In case everything went well, the C<tei2korapxml> tool will | 
|  | 80 | be available on your command line immediately. | 
|  | 81 |  | 
|  | 82 | Minimum requirement for L<KorAP::XML::TEI> is Perl 5.16. | 
|  | 83 |  | 
|  | 84 | =head1 OPTIONS | 
|  | 85 |  | 
|  | 86 | =over 2 | 
|  | 87 |  | 
|  | 88 | =item B<--root|-r> | 
|  | 89 |  | 
|  | 90 | The root directory for output. Defaults to C<.>. | 
|  | 91 |  | 
|  | 92 | =item B<--help|-h> | 
|  | 93 |  | 
|  | 94 | Print help information. | 
|  | 95 |  | 
|  | 96 | =item B<--version|-v> | 
|  | 97 |  | 
|  | 98 | Print version information. | 
|  | 99 |  | 
|  | 100 | =item B<--tokenizer-call|-tc> | 
|  | 101 |  | 
|  | 102 | Call an external tokenizer process, that will tokenize | 
|  | 103 | a single line from STDIN and outputs one token per line. | 
|  | 104 |  | 
|  | 105 | =item B<--tokenizer-korap|-tk> | 
|  | 106 |  | 
|  | 107 | Use the standard KorAP/DeReKo tokenizer. | 
|  | 108 |  | 
| Akron | 6d7b8e4 | 2020-09-29 07:37:41 +0200 | [diff] [blame] | 109 | =item B<--tokenizer-internal|-ti> | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 110 |  | 
|  | 111 | Tokenize the data using two embedded tokenizers, | 
|  | 112 | that will take an I<Aggressive> and a I<conservative> | 
|  | 113 | approach. | 
|  | 114 |  | 
| Akron | 75d6314 | 2021-02-23 18:40:56 +0100 | [diff] [blame] | 115 | =item B<--skip-inline-tokens> | 
|  | 116 |  | 
|  | 117 | Boolean flag indicating that inline tokens should not | 
|  | 118 | be processed. Defaults to false (meaning inline tokens will be processed). | 
|  | 119 |  | 
| Akron | 1a5271a | 2021-02-18 13:18:15 +0100 | [diff] [blame] | 120 | =item B<--inline-tokens> <foundry>#[<file>] | 
|  | 121 |  | 
|  | 122 | Define the foundry and file (without extension) | 
|  | 123 | to store inline token information in. | 
|  | 124 | If L</KORAPXMLTEI_INLINE> is set, this will contain | 
|  | 125 | annotations as well. | 
|  | 126 | Defaults to C<tokens> and C<morpho>. | 
|  | 127 |  | 
| Akron | dd0be8f | 2021-02-18 19:29:41 +0100 | [diff] [blame] | 128 | =item B<--inline-structures> <foundry>#[<file>] | 
|  | 129 |  | 
|  | 130 | Define the foundry and file (without extension) | 
|  | 131 | to store inline structure information in. | 
|  | 132 | Defaults to C<struct> and C<structures>. | 
| Akron | 75d6314 | 2021-02-23 18:40:56 +0100 | [diff] [blame] | 133 |  | 
| Akron | 26a7152 | 2021-02-19 10:27:37 +0100 | [diff] [blame] | 134 | =item B<--base-foundry> <foundry> | 
|  | 135 |  | 
|  | 136 | Define the base foundry to store newly generated | 
|  | 137 | token information in. | 
|  | 138 | Defaults to C<base>. | 
|  | 139 |  | 
|  | 140 | =item B<--data-file> <file> | 
|  | 141 |  | 
|  | 142 | Define the file (without extension) | 
|  | 143 | to store primary data information in. | 
|  | 144 | Defaults to C<data>. | 
|  | 145 |  | 
|  | 146 | =item B<--header-file> <file> | 
|  | 147 |  | 
|  | 148 | Define the file name (without extension) | 
|  | 149 | to store header information on | 
|  | 150 | the corpus, document, and text level in. | 
|  | 151 | Defaults to C<header>. | 
| Akron | dd0be8f | 2021-02-18 19:29:41 +0100 | [diff] [blame] | 152 |  | 
| Marc Kupietz | 985da0c | 2021-02-15 19:29:50 +0100 | [diff] [blame] | 153 | =item B<--use-tokenizer-sentence-splits|-s> | 
|  | 154 |  | 
|  | 155 | Replace existing with, or add new, sentence boundary information | 
|  | 156 | provided by the KorAP tokenizer (currently supported only). | 
|  | 157 |  | 
| Akron | 91705d7 | 2021-02-19 10:59:45 +0100 | [diff] [blame] | 158 | =item B<--tokens-file> <file> | 
|  | 159 |  | 
|  | 160 | Define the file (without extension) | 
|  | 161 | to store generated token information in | 
|  | 162 | (either from the KorAP tokenizer or an externally called tokenizer). | 
|  | 163 | Defaults to C<tokens>. | 
|  | 164 |  | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 165 | =item B<--log|-l> | 
|  | 166 |  | 
|  | 167 | Loglevel for I<Log::Any>. Defaults to C<notice>. | 
|  | 168 |  | 
|  | 169 | =back | 
|  | 170 |  | 
| Akron | b364947 | 2020-09-29 08:24:46 +0200 | [diff] [blame] | 171 | =head1 ENVIRONMENT VARIABLES | 
|  | 172 |  | 
|  | 173 | =over 2 | 
|  | 174 |  | 
|  | 175 | =item B<KORAPXMLTEI_DEBUG> | 
|  | 176 |  | 
|  | 177 | Activate minimal debugging. | 
|  | 178 | Defaults to C<false>. | 
|  | 179 |  | 
|  | 180 | =item B<KORAPXMLTEI_INLINE> | 
|  | 181 |  | 
|  | 182 | Process inline annotations, if present. | 
|  | 183 | Defaults to C<false>. | 
|  | 184 |  | 
|  | 185 | =back | 
|  | 186 |  | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 187 | =head1 COPYRIGHT AND LICENSE | 
|  | 188 |  | 
| Marc Kupietz | 985da0c | 2021-02-15 19:29:50 +0100 | [diff] [blame] | 189 | Copyright (C) 2021, L<IDS Mannheim|https://www.ids-mannheim.de/> | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 190 |  | 
|  | 191 | Author: Peter Harders | 
|  | 192 |  | 
| Akron | aabd095 | 2020-09-29 07:35:08 +0200 | [diff] [blame] | 193 | Contributors: Nils Diewald, Marc Kupietz, Carsten Schnober | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 194 |  | 
|  | 195 | L<KorAP::XML::TEI> is developed as part of the L<KorAP|https://korap.ids-mannheim.de/> | 
|  | 196 | Corpus Analysis Platform at the | 
|  | 197 | L<Leibniz Institute for the German Language (IDS)|http://ids-mannheim.de/>, | 
|  | 198 | member of the | 
|  | 199 | L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/>. | 
|  | 200 |  | 
|  | 201 | This program is free software published under the | 
| Marc Kupietz | e955ecc | 2021-02-17 17:42:01 +0100 | [diff] [blame] | 202 | L<BSD-2 License|https://opensource.org/licenses/BSD-2-Clause>. | 
| Akron | 0c41ab3 | 2020-09-29 07:33:33 +0200 | [diff] [blame] | 203 |  | 
| Akron | 75d6314 | 2021-02-23 18:40:56 +0100 | [diff] [blame] | 204 | =cut |