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