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