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 | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 77 | Input may also be defined using BSD glob wildcards. |
| 78 | |
| 79 | -i 'file/news*.zip' |
| 80 | |
| 81 | The extended input array will be sorted in length order, so the shortest |
| 82 | path needs to contain all primary data files and all meta data files. |
| 83 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 84 | (The directory structure follows the base directory format, |
| 85 | that may include a C<.> root folder. |
| 86 | In this case further archives lacking a C<.> root folder |
| 87 | need to be passed with a hash sign in front of the archive's name. |
| 88 | This may require to quote the parameter.) |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 89 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 90 | To support zip files, a version of C<unzip> needs to be installed that is |
| 91 | compatible with the archive file. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 92 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 93 | B<The root folder switch using the hash sign is experimental and |
| 94 | may vanish in future versions.> |
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<--output|-o> <directory|file> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 97 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 98 | Output folder for archive processing or |
| 99 | document name for single output (optional), |
| 100 | writes to C<STDOUT> by default |
| 101 | (in case C<output> is not mandatory due to further options). |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 102 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 103 | =item B<--overwrite|-w> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 104 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 105 | Overwrite files that already exist. |
Akron | 7606afa | 2016-10-25 16:23:49 +0200 | [diff] [blame] | 106 | |
Akron | 3741f8b | 2016-12-21 19:55:21 +0100 | [diff] [blame] | 107 | =item B<--token|-t> <foundry>#<file> |
Akron | a5920b1 | 2016-06-29 18:51:21 +0200 | [diff] [blame] | 108 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 109 | Define the default tokenization by specifying |
| 110 | the name of the foundry and optionally the name |
| 111 | of the layer-file. Defaults to C<OpenNLP#tokens>. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 112 | |
Akron | 3741f8b | 2016-12-21 19:55:21 +0100 | [diff] [blame] | 113 | |
| 114 | =item B<--base-sentences|-bs> <foundry>#<layer> |
| 115 | |
| 116 | Define the layer for base sentences. |
| 117 | If given, this will be used instead of using C<Base#Sentences>. |
| 118 | Currently C<DeReKo#Structure> is the only additional layer supported. |
| 119 | |
| 120 | Defaults to unset. |
| 121 | |
| 122 | |
| 123 | =item B<--base-paragraphs|-bp> <foundry>#<layer> |
| 124 | |
| 125 | Define the layer for base paragraphs. |
| 126 | If given, this will be used instead of using C<Base#Paragraphs>. |
| 127 | Currently C<DeReKo#Structure> is the only additional layer supported. |
| 128 | |
| 129 | Defaults to unset. |
| 130 | |
| 131 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 132 | =item B<--base-pagebreaks|-bpb> <foundry>#<layer> |
| 133 | |
| 134 | Define the layer for base pagebreaks. |
| 135 | Currently C<DeReKo#Structure> is the only layer supported. |
| 136 | |
| 137 | Defaults to unset. |
| 138 | |
| 139 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 140 | =item B<--skip|-s> <foundry>[#<layer>] |
| 141 | |
| 142 | Skip specific annotations by specifying the foundry |
| 143 | (and optionally the layer with a C<#>-prefix), |
| 144 | e.g. C<Mate> or C<Mate#Morpho>. Alternatively you can skip C<#ALL>. |
| 145 | Can be set multiple times. |
| 146 | |
| 147 | =item B<--anno|-a> <foundry>#<layer> |
| 148 | |
| 149 | Convert specific annotations by specifying the foundry |
| 150 | (and optionally the layer with a C<#>-prefix), |
| 151 | e.g. C<Mate> or C<Mate#Morpho>. |
| 152 | Can be set multiple times. |
| 153 | |
| 154 | =item B<--primary|-p> |
| 155 | |
| 156 | Output primary data or not. Defaults to C<true>. |
| 157 | Can be flagged using C<--no-primary> as well. |
| 158 | This is I<deprecated>. |
| 159 | |
| 160 | =item B<--jobs|-j> |
| 161 | |
| 162 | Define the number of concurrent jobs in seperated forks |
| 163 | for archive processing. |
| 164 | Defaults to C<0> (everything runs in a single process). |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 165 | Pass -1, and the value will be set automatically to 5 |
| 166 | times the number of available cores. |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 167 | This is I<experimental>. |
| 168 | |
| 169 | =item B<--meta|-m> |
| 170 | |
| 171 | Define the metadata parser to use. Defaults to C<I5>. |
| 172 | Metadata parsers can be defined in the C<KorAP::XML::Meta> namespace. |
| 173 | This is I<experimental>. |
| 174 | |
| 175 | =item B<--pretty|-y> |
| 176 | |
| 177 | Pretty print JSON output. Defaults to C<false>. |
| 178 | This is I<deprecated>. |
| 179 | |
| 180 | =item B<--gzip|-z> |
| 181 | |
| 182 | Compress the output. |
| 183 | Expects a defined C<output> file in single processing. |
| 184 | |
| 185 | =item B<--cache|-c> |
| 186 | |
| 187 | File to mmap a cache (using L<Cache::FastMmap>). |
| 188 | Defaults to C<korapxml2krill.cache> in the calling directory. |
| 189 | |
| 190 | =item B<--cache-size|-cs> |
| 191 | |
| 192 | Size of the cache. Defaults to C<50m>. |
| 193 | |
| 194 | =item B<--cache-init|-ci> |
| 195 | |
| 196 | Initialize cache file. |
| 197 | Can be flagged using C<--no-cache-init> as well. |
| 198 | Defaults to C<true>. |
| 199 | |
| 200 | =item B<--cache-delete|-cd> |
| 201 | |
| 202 | Delete cache file after processing. |
| 203 | Can be flagged using C<--no-cache-delete> as well. |
| 204 | Defaults to C<true>. |
| 205 | |
Akron | 636aa11 | 2017-04-07 18:48:56 +0200 | [diff] [blame] | 206 | =item B<--config|-cfg> |
| 207 | |
| 208 | Configure the parameters of your call in a file |
| 209 | of key-value pairs with whitespace separator |
| 210 | |
| 211 | overwrite 1 |
| 212 | token DeReKo#Structure |
| 213 | ... |
| 214 | |
| 215 | Supported parameters are: |
| 216 | C<overwrite>, C<gzip>, C<jobs>, |
| 217 | C<token>, C<log>, C<cache>, C<cache-size>, C<cache-delete>, C<meta>, |
Akron | 8150010 | 2017-04-07 20:45:44 +0200 | [diff] [blame] | 218 | C<output>, C<base-sentences>, C<temp-extract>, C<base-paragraphs>, |
Akron | 636aa11 | 2017-04-07 18:48:56 +0200 | [diff] [blame] | 219 | C<base-pagebreaks>, C<skip> (semicolon separated), C<sigle> |
| 220 | (semicolon separated), C<anno> (semicolon separated). |
| 221 | |
Akron | 8150010 | 2017-04-07 20:45:44 +0200 | [diff] [blame] | 222 | =item B<--temporary-extract|-te> |
| 223 | |
| 224 | Only valid for the C<archive> command. |
| 225 | |
| 226 | This will first extract all files into a |
| 227 | directory and then will archive. |
| 228 | If the directory is given as C<:temp:>, |
| 229 | a temporary directory is used. |
| 230 | This is especially useful to avoid |
| 231 | massive unzipping and potential |
| 232 | network latency. |
Akron | 636aa11 | 2017-04-07 18:48:56 +0200 | [diff] [blame] | 233 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 234 | =item B<--sigle|-sg> |
| 235 | |
| 236 | Extract the given texts. |
| 237 | Can be set multiple times. |
| 238 | I<Currently only supported on C<extract>.> |
| 239 | Sigles have the structure C<Corpus>/C<Document>/C<Text>. |
| 240 | In case the C<Text> path is omitted, the whole document will be extracted. |
| 241 | On the document level, the postfix wildcard C<*> is supported. |
| 242 | |
| 243 | =item B<--log|-l> |
| 244 | |
| 245 | The L<Log4perl> log level, defaults to C<ERROR>. |
| 246 | |
| 247 | =item B<--help|-h> |
| 248 | |
| 249 | Print this document. |
| 250 | |
| 251 | =item B<--version|-v> |
| 252 | |
| 253 | Print version information. |
| 254 | |
| 255 | =back |
| 256 | |
| 257 | =head1 ANNOTATION SUPPORT |
| 258 | |
| 259 | L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers |
| 260 | developed in the KorAP project that are part of the KorAP preprocessing pipeline. |
| 261 | The base foundry with paragraphs, sentences, and the text element are mandatory for |
| 262 | L<Krill|https://github.com/KorAP/Krill>. |
| 263 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 264 | Base |
| 265 | #Paragraphs |
| 266 | #Sentences |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 267 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 268 | Connexor |
| 269 | #Morpho |
| 270 | #Phrase |
| 271 | #Sentences |
| 272 | #Syntax |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 273 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 274 | CoreNLP |
| 275 | #Constituency |
| 276 | #Morpho |
| 277 | #NamedEntities |
| 278 | #Sentences |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 279 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 280 | DeReKo |
| 281 | #Structure |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 282 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 283 | DRuKoLa |
| 284 | #Morpho |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 285 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 286 | Glemm |
| 287 | #Morpho |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 288 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 289 | Malt |
| 290 | #Dependency |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 291 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 292 | MarMoT |
| 293 | #Morpho |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 294 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 295 | Mate |
| 296 | #Dependency |
| 297 | #Morpho |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 298 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 299 | MDParser |
| 300 | #Dependency |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 301 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 302 | OpenNLP |
| 303 | #Morpho |
| 304 | #Sentences |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 305 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 306 | Sgbr |
| 307 | #Lemma |
| 308 | #Morpho |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 309 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 310 | TreeTagger |
| 311 | #Morpho |
| 312 | #Sentences |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 313 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 314 | XIP |
| 315 | #Constituency |
| 316 | #Morpho |
| 317 | #Sentences |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 318 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 319 | |
| 320 | More importers are in preparation. |
| 321 | New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace. |
| 322 | See the built-in annotation importers as examples. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 323 | |
| 324 | =head1 AVAILABILITY |
| 325 | |
| 326 | https://github.com/KorAP/KorAP-XML-Krill |
| 327 | |
| 328 | |
| 329 | =head1 COPYRIGHT AND LICENSE |
| 330 | |
Akron | 821db3d | 2017-04-06 21:19:31 +0200 | [diff] [blame] | 331 | Copyright (C) 2015-2017, L<IDS Mannheim|http://www.ids-mannheim.de/> |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 332 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 333 | Author: L<Nils Diewald|http://nils-diewald.de/> |
Akron | 8150010 | 2017-04-07 20:45:44 +0200 | [diff] [blame] | 334 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 335 | Contributor: Eliza Margaretha |
| 336 | |
| 337 | 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] | 338 | Corpus Analysis Platform at the |
| 339 | L<Institute for the German Language (IDS)|http://ids-mannheim.de/>, |
| 340 | member of the |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 341 | 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] | 342 | |
Akron | 5c71a85 | 2016-10-31 16:00:33 +0100 | [diff] [blame] | 343 | This program is free software published under the |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 344 | L<BSD-2 License|https://raw.githubusercontent.com/KorAP/KorAP-XML-Krill/master/LICENSE>. |
| 345 | |
| 346 | =cut |