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 | 2080758 | 2016-10-26 17:11:34 +0200 | [diff] [blame^] | 13 | $ korapxml2krill extract --input <archive> --output <directory> --sigle <SIGLE> |
Akron | 7606afa | 2016-10-25 16:23:49 +0200 | [diff] [blame] | 14 | $ korapxml2krill archive -z --input <directory|archive> --output <directory> |
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 | |
Akron | 2080758 | 2016-10-26 17:11:34 +0200 | [diff] [blame^] | 164 | Extract the given texts. |
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 | 2080758 | 2016-10-26 17:11:34 +0200 | [diff] [blame^] | 168 | In case the C<Text> path is omitted, the whole document will be extracted. |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 169 | |
| 170 | =item B<--log|-l> |
| 171 | |
| 172 | The L<Log4perl> log level, defaults to C<ERROR>. |
| 173 | |
| 174 | =item B<--help|-h> |
| 175 | |
| 176 | Print this document. |
| 177 | |
| 178 | =item B<--version|-v> |
| 179 | |
| 180 | Print version information. |
| 181 | |
| 182 | =back |
| 183 | |
| 184 | =head1 ANNOTATION SUPPORT |
| 185 | |
| 186 | L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers |
| 187 | developed in the KorAP project that are part of the KorAP preprocessing pipeline. |
| 188 | The base foundry with paragraphs, sentences, and the text element are mandatory for |
| 189 | L<Krill|https://github.com/KorAP/Krill>. |
| 190 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 191 | =over 2 |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 192 | |
| 193 | =item B<Base> |
| 194 | |
| 195 | =over 4 |
| 196 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 197 | =item #Paragraphs |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 198 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 199 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 200 | |
| 201 | =back |
| 202 | |
| 203 | =item B<Connexor> |
| 204 | |
| 205 | =over 4 |
| 206 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 207 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 208 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 209 | =item #Phrase |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 210 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 211 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 212 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 213 | =item #Syntax |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 214 | |
| 215 | =back |
| 216 | |
| 217 | =item B<CoreNLP> |
| 218 | |
| 219 | =over 4 |
| 220 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 221 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 222 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 223 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 224 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 225 | =item #NamedEntities |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 226 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 227 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 228 | |
| 229 | =back |
| 230 | |
| 231 | =item B<DeReKo> |
| 232 | |
| 233 | =over 4 |
| 234 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 235 | =item #Structure |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 236 | |
| 237 | =back |
| 238 | |
| 239 | =item B<Glemm> |
| 240 | |
| 241 | =over 4 |
| 242 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 243 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 244 | |
| 245 | =back |
| 246 | |
| 247 | =item B<Mate> |
| 248 | |
| 249 | =over 4 |
| 250 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 251 | =item #Dependency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 252 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 253 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 254 | |
| 255 | =back |
| 256 | |
| 257 | =item B<OpenNLP> |
| 258 | |
| 259 | =over 4 |
| 260 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 261 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 262 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 263 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 264 | |
| 265 | =back |
| 266 | |
| 267 | =item B<Sgbr> |
| 268 | |
| 269 | =over 4 |
| 270 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 271 | =item #Lemma |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 272 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 273 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 274 | |
| 275 | =back |
| 276 | |
| 277 | =item B<TreeTagger> |
| 278 | |
| 279 | =over 4 |
| 280 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 281 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 282 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 283 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 284 | |
| 285 | =back |
| 286 | |
| 287 | =item B<XIP> |
| 288 | |
| 289 | =over 4 |
| 290 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 291 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 292 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 293 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 294 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 295 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 296 | |
| 297 | =back |
| 298 | |
| 299 | =back |
| 300 | |
| 301 | More importers are in preparation. |
| 302 | New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace. |
| 303 | See the built-in annotation importers as examples. |
| 304 | |
| 305 | =head1 AVAILABILITY |
| 306 | |
| 307 | https://github.com/KorAP/KorAP-XML-Krill |
| 308 | |
| 309 | |
| 310 | =head1 COPYRIGHT AND LICENSE |
| 311 | |
| 312 | Copyright (C) 2015-2016, L<IDS Mannheim|http://www.ids-mannheim.de/> |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 313 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 314 | Author: L<Nils Diewald|http://nils-diewald.de/> |
| 315 | |
| 316 | L<KorAP::XML::Krill> is developed as part of the L<KorAP|http://korap.ids-mannheim.de/> |
| 317 | Corpus Analysis Platform at the |
| 318 | L<Institute for the German Language (IDS)|http://ids-mannheim.de/>, |
| 319 | member of the |
| 320 | L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/>. |
| 321 | |
| 322 | This program is free software published under the |
| 323 | L<BSD-2 License|https://raw.githubusercontent.com/KorAP/KorAP-XML-Krill/master/LICENSE>. |
| 324 | |
| 325 | =cut |