Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =encoding utf8 |
| 4 | |
| 5 | =head1 NAME |
| 6 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 7 | korapxml2krill - Merge KorapXML data and create Krill documents |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 8 | |
| 9 | |
| 10 | =head1 SYNOPSIS |
| 11 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 12 | korapxml2krill [archive|extract] --input <directory|archive> [options] |
Akron | 2fd402b | 2016-10-27 21:26:48 +0200 | [diff] [blame] | 13 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 14 | |
| 15 | =head1 DESCRIPTION |
| 16 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 17 | L<KorAP::XML::Krill> is a library to convert KorAP-XML documents to files |
| 18 | compatible with the L<Krill|https://github.com/KorAP/Krill> indexer. |
| 19 | The C<korapxml2krill> command line tool is a simple wrapper to the library. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 20 | |
| 21 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 22 | =head1 INSTALLATION |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 23 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 24 | The preferred way to install L<KorAP::XML::Krill> is to use L<cpanm|App::cpanminus>. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 25 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 26 | $ cpanm https://github.com/KorAP/KorAP-XML-Krill.git |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 27 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 28 | In case everything went well, the C<korapxml2krill> tool will |
| 29 | be available on your command line immediately. |
| 30 | Minimum requirement for L<KorAP::XML::Krill> is Perl 5.14. |
| 31 | In addition to work with zip archives, the C<unzip> tool needs to be present. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 32 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 33 | =head1 ARGUMENTS |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 34 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 35 | $ korapxml2krill -z --input <directory> --output <filename> |
| 36 | |
| 37 | Without arguments, C<korapxml2krill> converts a directory of a single KorAP-XML document. |
| 38 | It expects the input to point to the text level folder. |
| 39 | |
| 40 | =over 2 |
| 41 | |
| 42 | =item B<archive> |
| 43 | |
| 44 | $ korapxml2krill archive -z --input <directory|archive> --output <directory> |
| 45 | |
| 46 | Converts an archive of KorAP-XML documents. It expects a directory |
| 47 | (pointing to the corpus level folder) or one or more zip files as input. |
| 48 | |
| 49 | =item B<extract> |
| 50 | |
| 51 | $ korapxml2krill extract --input <archive> --output <directory> --sigle <SIGLE> |
| 52 | |
| 53 | Extracts KorAP-XML documents from a zip file. |
| 54 | |
| 55 | =back |
Akron | a76d835 | 2016-10-27 16:27:32 +0200 | [diff] [blame] | 56 | |
Akron | 7606afa | 2016-10-25 16:23:49 +0200 | [diff] [blame] | 57 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 58 | =head1 OPTIONS |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 59 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 60 | =over 2 |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 61 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 62 | =item B<--input|-i> <directory|zip file> |
Akron | a76d835 | 2016-10-27 16:27:32 +0200 | [diff] [blame] | 63 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 64 | Directory or zip file(s) of documents to convert. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 65 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 66 | Without arguments, C<korapxml2krill> expects a folder of a single KorAP-XML |
Akron | f1a1de9 | 2016-11-02 17:32:12 +0100 | [diff] [blame^] | 67 | document, while C<archive> expects a KorAP-XML corpus folder or a zip |
| 68 | file to batch process multiple files. |
| 69 | C<extract> expects zip files only. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 70 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 71 | C<archive> supports multiple input zip files with the constraint, |
| 72 | that the first archive listed contains all primary data files |
| 73 | and all meta data files. |
Akron | a76d835 | 2016-10-27 16:27:32 +0200 | [diff] [blame] | 74 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 75 | -i file/news.zip -i file/news.malt.zip -i "#file/news.tt.zip" |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 76 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 77 | (The directory structure follows the base directory format, |
| 78 | that may include a C<.> root folder. |
| 79 | In this case further archives lacking a C<.> root folder |
| 80 | need to be passed with a hash sign in front of the archive's name. |
| 81 | This may require to quote the parameter.) |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 82 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 83 | To support zip files, a version of C<unzip> needs to be installed that is |
| 84 | compatible with the archive file. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 85 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 86 | B<The root folder switch using the hash sign is experimental and |
| 87 | may vanish in future versions.> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 88 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 89 | =item B<--output|-o> <directory|file> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 90 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 91 | Output folder for archive processing or |
| 92 | document name for single output (optional), |
| 93 | writes to C<STDOUT> by default |
| 94 | (in case C<output> is not mandatory due to further options). |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 95 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 96 | =item B<--overwrite|-w> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 97 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 98 | Overwrite files that already exist. |
Akron | 7606afa | 2016-10-25 16:23:49 +0200 | [diff] [blame] | 99 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 100 | =item B<--token|-t> <foundry>[#<file>] |
Akron | a5920b1 | 2016-06-29 18:51:21 +0200 | [diff] [blame] | 101 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 102 | Define the default tokenization by specifying |
| 103 | the name of the foundry and optionally the name |
| 104 | of the layer-file. Defaults to C<OpenNLP#tokens>. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 105 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 106 | =item B<--skip|-s> <foundry>[#<layer>] |
| 107 | |
| 108 | Skip specific annotations by specifying the foundry |
| 109 | (and optionally the layer with a C<#>-prefix), |
| 110 | e.g. C<Mate> or C<Mate#Morpho>. Alternatively you can skip C<#ALL>. |
| 111 | Can be set multiple times. |
| 112 | |
| 113 | =item B<--anno|-a> <foundry>#<layer> |
| 114 | |
| 115 | Convert specific annotations by specifying the foundry |
| 116 | (and optionally the layer with a C<#>-prefix), |
| 117 | e.g. C<Mate> or C<Mate#Morpho>. |
| 118 | Can be set multiple times. |
| 119 | |
| 120 | =item B<--primary|-p> |
| 121 | |
| 122 | Output primary data or not. Defaults to C<true>. |
| 123 | Can be flagged using C<--no-primary> as well. |
| 124 | This is I<deprecated>. |
| 125 | |
| 126 | =item B<--jobs|-j> |
| 127 | |
| 128 | Define the number of concurrent jobs in seperated forks |
| 129 | for archive processing. |
| 130 | Defaults to C<0> (everything runs in a single process). |
| 131 | This is I<experimental>. |
| 132 | |
| 133 | =item B<--meta|-m> |
| 134 | |
| 135 | Define the metadata parser to use. Defaults to C<I5>. |
| 136 | Metadata parsers can be defined in the C<KorAP::XML::Meta> namespace. |
| 137 | This is I<experimental>. |
| 138 | |
| 139 | =item B<--pretty|-y> |
| 140 | |
| 141 | Pretty print JSON output. Defaults to C<false>. |
| 142 | This is I<deprecated>. |
| 143 | |
| 144 | =item B<--gzip|-z> |
| 145 | |
| 146 | Compress the output. |
| 147 | Expects a defined C<output> file in single processing. |
| 148 | |
| 149 | =item B<--cache|-c> |
| 150 | |
| 151 | File to mmap a cache (using L<Cache::FastMmap>). |
| 152 | Defaults to C<korapxml2krill.cache> in the calling directory. |
| 153 | |
| 154 | =item B<--cache-size|-cs> |
| 155 | |
| 156 | Size of the cache. Defaults to C<50m>. |
| 157 | |
| 158 | =item B<--cache-init|-ci> |
| 159 | |
| 160 | Initialize cache file. |
| 161 | Can be flagged using C<--no-cache-init> as well. |
| 162 | Defaults to C<true>. |
| 163 | |
| 164 | =item B<--cache-delete|-cd> |
| 165 | |
| 166 | Delete cache file after processing. |
| 167 | Can be flagged using C<--no-cache-delete> as well. |
| 168 | Defaults to C<true>. |
| 169 | |
| 170 | =item B<--sigle|-sg> |
| 171 | |
| 172 | Extract the given texts. |
| 173 | Can be set multiple times. |
| 174 | I<Currently only supported on C<extract>.> |
| 175 | Sigles have the structure C<Corpus>/C<Document>/C<Text>. |
| 176 | In case the C<Text> path is omitted, the whole document will be extracted. |
| 177 | On the document level, the postfix wildcard C<*> is supported. |
| 178 | |
| 179 | =item B<--log|-l> |
| 180 | |
| 181 | The L<Log4perl> log level, defaults to C<ERROR>. |
| 182 | |
| 183 | =item B<--help|-h> |
| 184 | |
| 185 | Print this document. |
| 186 | |
| 187 | =item B<--version|-v> |
| 188 | |
| 189 | Print version information. |
| 190 | |
| 191 | =back |
| 192 | |
| 193 | =head1 ANNOTATION SUPPORT |
| 194 | |
| 195 | L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers |
| 196 | developed in the KorAP project that are part of the KorAP preprocessing pipeline. |
| 197 | The base foundry with paragraphs, sentences, and the text element are mandatory for |
| 198 | L<Krill|https://github.com/KorAP/Krill>. |
| 199 | |
| 200 | =over 2 |
| 201 | |
| 202 | =item B<Base> |
| 203 | |
| 204 | =over 4 |
| 205 | |
| 206 | =item #Paragraphs |
| 207 | |
| 208 | =item #Sentences |
| 209 | |
| 210 | =back |
| 211 | |
| 212 | =item B<Connexor> |
| 213 | |
| 214 | =over 4 |
| 215 | |
| 216 | =item #Morpho |
| 217 | |
| 218 | =item #Phrase |
| 219 | |
| 220 | =item #Sentences |
| 221 | |
| 222 | =item #Syntax |
| 223 | |
| 224 | =back |
| 225 | |
| 226 | =item B<CoreNLP> |
| 227 | |
| 228 | =over 4 |
| 229 | |
| 230 | =item #Constituency |
| 231 | |
| 232 | =item #Morpho |
| 233 | |
| 234 | =item #NamedEntities |
| 235 | |
| 236 | =item #Sentences |
| 237 | |
| 238 | =back |
| 239 | |
| 240 | =item B<DeReKo> |
| 241 | |
| 242 | =over 4 |
| 243 | |
| 244 | =item #Structure |
| 245 | |
| 246 | =back |
| 247 | |
| 248 | =item B<Glemm> |
| 249 | |
| 250 | =over 4 |
| 251 | |
| 252 | =item #Morpho |
| 253 | |
| 254 | =back |
| 255 | |
| 256 | =item B<Mate> |
| 257 | |
| 258 | =over 4 |
| 259 | |
| 260 | =item #Dependency |
| 261 | |
| 262 | =item #Morpho |
| 263 | |
| 264 | =back |
| 265 | |
| 266 | =item B<OpenNLP> |
| 267 | |
| 268 | =over 4 |
| 269 | |
| 270 | =item #Morpho |
| 271 | |
| 272 | =item #Sentences |
| 273 | |
| 274 | =back |
| 275 | |
| 276 | =item B<Sgbr> |
| 277 | |
| 278 | =over 4 |
| 279 | |
| 280 | =item #Lemma |
| 281 | |
| 282 | =item #Morpho |
| 283 | |
| 284 | =back |
| 285 | |
| 286 | =item B<TreeTagger> |
| 287 | |
| 288 | =over 4 |
| 289 | |
| 290 | =item #Morpho |
| 291 | |
| 292 | =item #Sentences |
| 293 | |
| 294 | =back |
| 295 | |
| 296 | =item B<XIP> |
| 297 | |
| 298 | =over 4 |
| 299 | |
| 300 | =item #Constituency |
| 301 | |
| 302 | =item #Morpho |
| 303 | |
| 304 | =item #Sentences |
| 305 | |
| 306 | =back |
| 307 | |
| 308 | =back |
| 309 | |
| 310 | More importers are in preparation. |
| 311 | New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace. |
| 312 | See the built-in annotation importers as examples. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 313 | |
| 314 | =head1 AVAILABILITY |
| 315 | |
| 316 | https://github.com/KorAP/KorAP-XML-Krill |
| 317 | |
| 318 | |
| 319 | =head1 COPYRIGHT AND LICENSE |
| 320 | |
| 321 | Copyright (C) 2015-2016, L<IDS Mannheim|http://www.ids-mannheim.de/> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 322 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 323 | Author: L<Nils Diewald|http://nils-diewald.de/> |
| 324 | Contributor: Eliza Margaretha |
| 325 | |
| 326 | L<KorAP::XML::Krill> is developed as part of the L<KorAP|http://korap.ids-mannheim.de/> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 327 | Corpus Analysis Platform at the |
| 328 | L<Institute for the German Language (IDS)|http://ids-mannheim.de/>, |
| 329 | member of the |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 330 | L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/>. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 331 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 332 | This program is free software published under the |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 333 | L<BSD-2 License|https://raw.githubusercontent.com/KorAP/KorAP-XML-Krill/master/LICENSE>. |
| 334 | |
| 335 | =cut |