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