Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | use strict; |
| 3 | use warnings; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 4 | use FindBin; |
| 5 | BEGIN { unshift @INC, "$FindBin::Bin/../lib" }; |
| 6 | use File::Spec::Functions qw/catfile catdir/; |
| 7 | use Getopt::Long qw/GetOptions :config no_auto_abbrev/; |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 8 | use Benchmark qw/:hireswallclock/; |
| 9 | use IO::Compress::Gzip qw/$GzipError/; |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 10 | use Log::Log4perl; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 11 | use Pod::Usage; |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 12 | use Cache::FastMmap; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 13 | use Directory::Iterator; |
Akron | 93d620e | 2016-02-05 19:40:05 +0100 | [diff] [blame] | 14 | use KorAP::XML::Krill; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 15 | use KorAP::XML::Archive; |
Akron | 93d620e | 2016-02-05 19:40:05 +0100 | [diff] [blame] | 16 | use KorAP::XML::Tokenizer; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 17 | use Parallel::ForkManager; |
Akron | 75ba57d | 2016-03-07 23:36:27 +0100 | [diff] [blame] | 18 | # TODO: use Parallel::Loops |
Akron | 93d620e | 2016-02-05 19:40:05 +0100 | [diff] [blame] | 19 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 20 | # CHANGES: |
| 21 | # ---------------------------------------------------------- |
| 22 | # 2013/11/25 |
| 23 | # - Initial release |
| 24 | # |
| 25 | # 2014/10/29 |
| 26 | # - Merges foundry data to create indexer friendly documents |
| 27 | # |
Akron | 93d620e | 2016-02-05 19:40:05 +0100 | [diff] [blame] | 28 | # 2016/02/04 |
| 29 | # - renamed to korapxml2krill |
| 30 | # - added Schreibgebrauch support |
Akron | 069bd71 | 2016-02-12 19:09:06 +0100 | [diff] [blame] | 31 | # |
| 32 | # 2016/02/12 |
| 33 | # - fixed foundry skipping |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 34 | # - Support overwrite in archive processing |
Akron | 150b29e | 2016-02-14 23:06:48 +0100 | [diff] [blame] | 35 | # |
| 36 | # 2016/02/14 |
| 37 | # - Added version information |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 38 | # - Added support for archive files |
| 39 | # |
| 40 | # 2016/02/15 |
| 41 | # - Fixed temporary directory bug |
| 42 | # - Improved skipping before unzipping |
| 43 | # - Added EXPERIMENTAL concurrency support |
| 44 | # |
| 45 | # 2016/02/23 |
| 46 | # - Merge korapxml2krill and korapxml2krill_dir |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 47 | # |
| 48 | # 2016/02/27 |
| 49 | # - Added extract function |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 50 | # |
| 51 | # 2016/03/17 |
| 52 | # - Added meta switch |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 53 | # |
| 54 | # 2016/03/18 |
| 55 | # - Added meta data caching |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 56 | # ---------------------------------------------------------- |
Akron | 069bd71 | 2016-02-12 19:09:06 +0100 | [diff] [blame] | 57 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 58 | our $LAST_CHANGE = '2016/03/17'; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 59 | our $LOCAL = $FindBin::Bin; |
| 60 | our $VERSION_MSG = <<"VERSION"; |
| 61 | Version $KorAP::XML::Krill::VERSION - diewald\@ids-mannheim.de - $LAST_CHANGE |
| 62 | VERSION |
| 63 | |
| 64 | |
| 65 | # Parse comand |
| 66 | my $cmd; |
| 67 | our @ARGV; |
| 68 | if ($ARGV[0] && index($ARGV[0], '-') != 0) { |
| 69 | $cmd = shift @ARGV; |
Akron | 150b29e | 2016-02-14 23:06:48 +0100 | [diff] [blame] | 70 | }; |
Akron | 93d620e | 2016-02-05 19:40:05 +0100 | [diff] [blame] | 71 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 72 | my (@skip, @sigle); |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 73 | my $text; |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 74 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 75 | # Parse options from the command line |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 76 | GetOptions( |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 77 | 'input|i=s' => \(my $input), |
| 78 | 'output|o=s' => \(my $output), |
| 79 | 'overwrite|w' => \(my $overwrite), |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 80 | 'meta|m=s' => \(my $meta), |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 81 | 'token|t=s' => \(my $token_base), |
| 82 | 'gzip|z' => \(my $gzip), |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 83 | 'skip|s=s' => \@skip, |
| 84 | 'sigle|sg=s' => \@sigle, |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 85 | 'cache|c=s' => \(my $cache_file = 'korapxml2krill.cache'), |
| 86 | 'cache-size|cs=s' => \(my $cache_size = '50m'), |
| 87 | 'cache-delete|cd!' => \(my $cache_delete = 1), |
| 88 | 'cache-init|ci!' => \(my $cache_init = 1), |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 89 | 'log|l=s' => \(my $log_level = 'ERROR'), |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 90 | 'anno|a=s' => \(my @anno), |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 91 | 'primary|p!' => \(my $primary), |
| 92 | 'pretty|y' => \(my $pretty), |
| 93 | 'jobs|j=i' => \(my $jobs = 0), |
| 94 | 'help|h' => sub { |
| 95 | pod2usage( |
| 96 | -sections => 'NAME|SYNOPSIS|ARGUMENTS|OPTIONS', |
| 97 | -verbose => 99, |
| 98 | -msg => $VERSION_MSG, |
| 99 | ); |
| 100 | }, |
| 101 | 'version|v' => sub { |
| 102 | pod2usage( |
| 103 | -verbose => 0, |
| 104 | -msg => $VERSION_MSG |
| 105 | ) |
| 106 | } |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 107 | ); |
| 108 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 109 | my %ERROR_HASH = ( |
| 110 | -sections => 'NAME|SYNOPSIS|ARGUMENTS|OPTIONS', |
| 111 | -verbose => 99, |
| 112 | -msg => $VERSION_MSG, |
| 113 | -exit => 1 |
| 114 | ); |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 115 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 116 | # Input has to be defined |
| 117 | pod2usage(%ERROR_HASH) unless $input; |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 118 | |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 119 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 120 | # Initialize log4perl object |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 121 | Log::Log4perl->init({ |
| 122 | 'log4perl.rootLogger' => uc($log_level) . ', STDERR', |
| 123 | 'log4perl.appender.STDERR' => 'Log::Log4perl::Appender::ScreenColoredLevels', |
| 124 | 'log4perl.appender.STDERR.layout' => 'PatternLayout', |
| 125 | 'log4perl.appender.STDERR.layout.ConversionPattern' => '[%r] %F %L %c - %m%n' |
| 126 | }); |
| 127 | |
| 128 | my $log = Log::Log4perl->get_logger('main'); |
| 129 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 130 | |
| 131 | # Get file name based on path information |
| 132 | sub get_file_name ($) { |
| 133 | my $file = shift; |
| 134 | $file =~ s/^?\/?$input//; |
| 135 | $file =~ tr/\//-/; |
| 136 | $file =~ s{^-+}{}; |
| 137 | return $file; |
Nils Diewald | 59094f2 | 2014-11-05 18:20:50 +0000 | [diff] [blame] | 138 | }; |
| 139 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 140 | |
| 141 | # Write file |
| 142 | sub write_file { |
| 143 | my $anno = shift; |
| 144 | my $file = get_file_name $anno; |
| 145 | |
| 146 | # TODO: This should be done directly with a data structure! KorAP::XML::Wrap |
| 147 | |
| 148 | my $call = 'perl ' . $LOCAL . '/korapxml2krill -i ' . |
| 149 | $anno . ' -o ' . $output . '/' . $file . '.json'; |
| 150 | $call .= '.gz -z' if $gzip; |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 151 | $call .= ' -m ' . $meta if $meta; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 152 | $call .= ' -w' if $overwrite; |
| 153 | $call .= ' -t ' . $token_base if $token_base; |
| 154 | $call .= ' -l ' . $log_level if $log_level; |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 155 | $call .= ' -c ' . $cache_file; |
| 156 | $call .= ' -cs ' . $cache_size; |
| 157 | $call .= ' --no-cache-delete'; # Don't delete the cache |
| 158 | $call .= ' --no-cache-init'; # Don't initialize the cache |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 159 | $call .= ' --no-primary ' if $primary; |
| 160 | $call .= ' -y ' . $pretty if $pretty; |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 161 | $call .= ' -a ' . $_ foreach @anno; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 162 | $call .= ' -s ' . $_ foreach @skip; |
| 163 | system($call); |
| 164 | return "$file"; |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 165 | }; |
| 166 | |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 167 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 168 | # Convert sigle to path construct |
| 169 | s!^\s*([^_]+?)_([^\.]+?)\.(.+?)\s*$!$1/$2/$3! foreach @sigle; |
| 170 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 171 | # Process a single file |
| 172 | unless ($cmd) { |
Nils Diewald | 59094f2 | 2014-11-05 18:20:50 +0000 | [diff] [blame] | 173 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 174 | # Can't print gzip to STDOUT |
| 175 | pod2usage(%ERROR_HASH) if $gzip && !$output; |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 176 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 177 | my %skip; |
| 178 | $skip{lc($_)} = 1 foreach @skip; |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 179 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 180 | # Ignore processing |
| 181 | if (!$overwrite && $output && -e $output) { |
| 182 | $log->trace($output . ' already exists'); |
| 183 | exit(0); |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 184 | }; |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 185 | |
| 186 | BEGIN { |
| 187 | $main::TIME = Benchmark->new; |
| 188 | $main::LAST_STOP = Benchmark->new; |
| 189 | }; |
| 190 | |
| 191 | sub stop_time { |
| 192 | my $new = Benchmark->new; |
| 193 | $log->trace( |
| 194 | 'The code took: '. |
| 195 | timestr(timediff($new, $main::LAST_STOP)) . |
| 196 | ' (overall: ' . timestr(timediff($new, $main::TIME)) . ')' |
| 197 | ); |
| 198 | $main::LAST_STOP = $new; |
| 199 | }; |
| 200 | |
| 201 | # Create and parse new document |
| 202 | $input =~ s{([^/])$}{$1/}; |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 203 | my $doc = KorAP::XML::Krill->new( |
| 204 | path => $input, |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 205 | meta_type => ($meta // 'I5'), |
| 206 | cache => Cache::FastMmap->new( |
| 207 | share_file => $cache_file, |
| 208 | cache_size => $cache_size, |
| 209 | init_file => $cache_init |
| 210 | ) |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 211 | ); |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 212 | |
| 213 | unless ($doc->parse) { |
| 214 | $log->warn($output . " can't be processed - no document data"); |
| 215 | exit(0); |
| 216 | }; |
| 217 | |
| 218 | my ($token_base_foundry, $token_base_layer) = (qw/OpenNLP Tokens/); |
| 219 | if ($token_base) { |
| 220 | ($token_base_foundry, $token_base_layer) = split /#/, $token_base; |
| 221 | }; |
| 222 | |
| 223 | # Get tokenization |
| 224 | my $tokens = KorAP::XML::Tokenizer->new( |
| 225 | path => $doc->path, |
| 226 | doc => $doc, |
| 227 | foundry => $token_base_foundry, |
| 228 | layer => $token_base_layer, |
| 229 | name => 'tokens' |
| 230 | ); |
| 231 | |
| 232 | # Unable to process base tokenization |
| 233 | unless ($tokens->parse) { |
| 234 | $log->error($output . " can't be processed - no base tokenization"); |
| 235 | exit(0); |
| 236 | }; |
| 237 | |
| 238 | my @layers; |
| 239 | push(@layers, ['Base', 'Sentences']); |
| 240 | push(@layers, ['Base', 'Paragraphs']); |
| 241 | |
| 242 | # Connexor |
| 243 | push(@layers, ['Connexor', 'Morpho']); |
| 244 | push(@layers, ['Connexor', 'Syntax']); |
| 245 | push(@layers, ['Connexor', 'Phrase']); |
| 246 | push(@layers, ['Connexor', 'Sentences']); |
| 247 | |
| 248 | # CoreNLP |
| 249 | push(@layers, ['CoreNLP', 'NamedEntities']); |
| 250 | push(@layers, ['CoreNLP', 'Sentences']); |
| 251 | push(@layers, ['CoreNLP', 'Morpho']); |
| 252 | push(@layers, ['CoreNLP', 'Constituency']); |
| 253 | |
| 254 | # DeReKo |
| 255 | push(@layers, ['DeReKo', 'Structure']); |
| 256 | |
| 257 | # Glemm |
| 258 | push(@layers, ['Glemm', 'Morpho']); |
| 259 | |
| 260 | # Malt |
| 261 | # push(@layers, ['Malt', 'Dependency']); |
| 262 | |
| 263 | # Mate |
| 264 | push(@layers, ['Mate', 'Morpho']); |
| 265 | push(@layers, ['Mate', 'Dependency']); |
| 266 | |
| 267 | # OpenNLP |
| 268 | push(@layers, ['OpenNLP', 'Morpho']); |
| 269 | push(@layers, ['OpenNLP', 'Sentences']); |
| 270 | |
| 271 | # Schreibgebrauch |
| 272 | push(@layers, ['Sgbr', 'Lemma']); |
| 273 | push(@layers, ['Sgbr', 'Morpho']); |
| 274 | |
| 275 | # TreeTagger |
| 276 | push(@layers, ['TreeTagger', 'Morpho']); |
| 277 | push(@layers, ['TreeTagger', 'Sentences']); |
| 278 | |
| 279 | # XIP |
| 280 | push(@layers, ['XIP', 'Morpho']); |
| 281 | push(@layers, ['XIP', 'Constituency']); |
| 282 | push(@layers, ['XIP', 'Sentences']); |
| 283 | push(@layers, ['XIP', 'Dependency']); |
| 284 | |
| 285 | |
| 286 | if ($skip{'#all'}) { |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 287 | foreach (@anno) { |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 288 | $tokens->add(split('#', $_)); |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 289 | stop_time; |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 290 | }; |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 291 | } |
| 292 | else { |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 293 | # Add to index file - respect skipping |
| 294 | foreach my $info (@layers) { |
| 295 | # Skip if Foundry or Foundry#Layer should be skipped |
| 296 | unless ($skip{lc($info->[0])} || $skip{lc($info->[0]) . '#' . lc($info->[1])}) { |
| 297 | $tokens->add(@$info); |
| 298 | stop_time; |
| 299 | }; |
| 300 | }; |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 301 | }; |
| 302 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 303 | my $file; |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 304 | my $print_text = ($pretty ? $tokens->to_pretty_json($primary) : $tokens->to_json($primary)); |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 305 | |
| 306 | if ($output) { |
| 307 | |
| 308 | if ($gzip) { |
| 309 | $file = IO::Compress::Gzip->new($output, Minimal => 1); |
| 310 | } |
| 311 | else { |
| 312 | $file = IO::File->new($output, "w"); |
| 313 | }; |
| 314 | |
| 315 | $file->print($print_text); |
| 316 | $file->close; |
| 317 | } |
| 318 | |
| 319 | else { |
| 320 | print $print_text . "\n"; |
| 321 | }; |
| 322 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 323 | # Delete cache file |
| 324 | unlink($cache_file) if $cache_delete; |
| 325 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 326 | stop_time; |
Nils Diewald | 7364d1f | 2013-11-05 19:26:35 +0000 | [diff] [blame] | 327 | } |
Nils Diewald | 59094f2 | 2014-11-05 18:20:50 +0000 | [diff] [blame] | 328 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 329 | # Extract XML files |
| 330 | elsif ($cmd eq 'extract') { |
| 331 | |
| 332 | pod2usage(%ERROR_HASH) unless $output; |
| 333 | |
| 334 | # TODO: Support sigles and full archives |
| 335 | |
| 336 | if ($output && (!-e $output || !-d $output)) { |
| 337 | print "Directory '$output' does not exist.\n\n"; |
| 338 | exit(0); |
| 339 | }; |
| 340 | |
| 341 | if (-f($input) && (my $archive = KorAP::XML::Archive->new($input))) { |
| 342 | |
| 343 | unless ($archive->test_unzip) { |
| 344 | print "Unzip is not installed or incompatible.\n\n"; |
| 345 | exit(1); |
| 346 | }; |
| 347 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 348 | # Iterate over all given sigles and extract |
| 349 | foreach (@sigle) { |
| 350 | print "$_ "; |
| 351 | print '' . ($archive->extract('./'. $_, $output) ? '' : 'not '); |
| 352 | print "extracted.\n"; |
| 353 | }; |
| 354 | |
| 355 | print "\n"; |
| 356 | exit(1); |
| 357 | }; |
| 358 | } |
| 359 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 360 | # Process an archive |
| 361 | elsif ($cmd eq 'archive') { |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 362 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 363 | # TODO: Support sigles |
| 364 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 365 | pod2usage(%ERROR_HASH) unless $output; |
| 366 | |
| 367 | if ($output && (!-e $output || !-d $output)) { |
| 368 | print "Directory '$output' does not exist.\n\n"; |
| 369 | exit(0); |
| 370 | }; |
| 371 | |
| 372 | # Zero means: everything runs in the parent process |
| 373 | my $pool = Parallel::ForkManager->new($jobs); |
| 374 | |
| 375 | my $count = 0; # Texts to process |
| 376 | my $iter = 1; # Current text in process |
| 377 | |
| 378 | # Report on fork message |
| 379 | $pool->run_on_finish ( |
| 380 | sub { |
| 381 | my ($pid, $code) = shift; |
| 382 | my $data = pop; |
| 383 | print 'Convert ['. ($jobs > 0 ? "$pid:" : '') . |
| 384 | ($iter++) . "/$count]" . |
| 385 | ($code ? " $code" : '') . |
| 386 | " $$data\n"; |
| 387 | } |
| 388 | ); |
| 389 | |
| 390 | my $t; |
| 391 | print "Reading data ...\n"; |
| 392 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 393 | unless (Cache::FastMmap->new( |
| 394 | share_file => $cache_file, |
| 395 | cache_size => $cache_size, |
| 396 | init_file => $cache_init |
| 397 | )) { |
| 398 | print "Unable to intialize cache '$cache_file'\n\n"; |
| 399 | exit(1); |
| 400 | }; |
| 401 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 402 | # Input is a directory |
| 403 | if (-d $input) { |
| 404 | my $it = Directory::Iterator->new($input); |
| 405 | my @dirs; |
| 406 | my $dir; |
| 407 | |
| 408 | while (1) { |
| 409 | if (!$it->is_directory && ($dir = $it->get) && $dir =~ s{/data\.xml$}{}) { |
| 410 | push @dirs, $dir; |
| 411 | $it->prune; |
| 412 | }; |
| 413 | last unless $it->next; |
| 414 | }; |
| 415 | |
| 416 | print "Start processing ...\n"; |
| 417 | $t = Benchmark->new; |
| 418 | $count = scalar @dirs; |
| 419 | |
| 420 | DIRECTORY_LOOP: |
| 421 | for (my $i = 0; $i < $count; $i++) { |
| 422 | |
| 423 | unless ($overwrite) { |
| 424 | my $filename = catfile( |
| 425 | $output, |
| 426 | get_file_name($dirs[$i]) . '.json' . ($gzip ? '.gz' : '') |
| 427 | ); |
| 428 | |
| 429 | if (-e $filename) { |
| 430 | $iter++; |
| 431 | print "Skip $filename\n"; |
| 432 | next; |
| 433 | }; |
| 434 | }; |
| 435 | |
| 436 | # Get the next fork |
| 437 | my $pid = $pool->start and next DIRECTORY_LOOP; |
| 438 | my $msg; |
| 439 | |
| 440 | $msg = write_file($dirs[$i]); |
| 441 | $pool->finish(0, \$msg); |
| 442 | }; |
| 443 | } |
| 444 | |
| 445 | # Input is a file |
| 446 | elsif (-f($input) && (my $archive = KorAP::XML::Archive->new($input))) { |
| 447 | unless ($archive->test_unzip) { |
| 448 | print "Unzip is not installed or incompatible.\n\n"; |
| 449 | exit(1); |
| 450 | }; |
| 451 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 452 | print "Start processing ...\n"; |
| 453 | $t = Benchmark->new; |
| 454 | my @dirs = $archive->list_texts; |
| 455 | $count = scalar @dirs; |
| 456 | |
| 457 | ARCHIVE_LOOP: |
| 458 | for (my $i = 0; $i < $count; $i++) { |
| 459 | |
| 460 | # Split path information |
| 461 | my ($prefix, $corpus, $doc, $text) = $archive->split_path($dirs[$i]); |
| 462 | |
| 463 | unless ($overwrite) { |
| 464 | my $filename = catfile( |
| 465 | $output, |
| 466 | get_file_name(catdir($doc, $text)) . '.json' . ($gzip ? '.gz' : '') |
| 467 | ); |
| 468 | |
| 469 | if (-e $filename) { |
| 470 | $iter++; |
| 471 | print "Skip $filename\n"; |
| 472 | next; |
| 473 | }; |
| 474 | }; |
| 475 | |
| 476 | # Get the next fork |
| 477 | my $pid = $pool->start and next ARCHIVE_LOOP; |
| 478 | |
| 479 | # Create temporary file |
| 480 | my $temp = File::Temp->newdir; |
| 481 | |
| 482 | my $msg; |
| 483 | |
| 484 | # Extract from archive |
| 485 | if ($archive->extract($dirs[$i], $temp)) { |
| 486 | |
| 487 | # Create corpus directory |
| 488 | $input = catdir("$temp", $corpus); |
| 489 | |
| 490 | # Temporary directory |
| 491 | my $dir = catdir($input, $doc, $text); |
| 492 | |
| 493 | # Write file |
| 494 | $msg = write_file($dir); |
| 495 | |
| 496 | $temp = undef; |
| 497 | $pool->finish(0, \$msg); |
| 498 | } |
| 499 | else { |
| 500 | |
| 501 | $temp = undef; |
| 502 | $msg = "Unable to extract " . $dirs[$i] . "\n"; |
| 503 | $pool->finish(1, \$msg); |
| 504 | }; |
| 505 | }; |
| 506 | } |
| 507 | |
| 508 | else { |
| 509 | print "Input is neither a directory nor an archive.\n\n"; |
| 510 | }; |
| 511 | |
| 512 | $pool->wait_all_children; |
| 513 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 514 | # Delete cache file |
| 515 | unlink($cache_file) if $cache_delete; |
| 516 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 517 | print "Done.\n"; |
| 518 | print timestr(timediff(Benchmark->new, $t))."\n\n"; |
| 519 | } |
| 520 | |
| 521 | # Unknown command |
| 522 | else { |
| 523 | warn "Unknown command '$cmd'.\n\n"; |
| 524 | pod2usage(%ERROR_HASH); |
| 525 | } |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 526 | |
| 527 | __END__ |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 528 | |
| 529 | =pod |
| 530 | |
| 531 | =encoding utf8 |
| 532 | |
| 533 | =head1 NAME |
| 534 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 535 | korapxml2krill - Merge KorapXML data and create Krill documents |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 536 | |
| 537 | |
| 538 | =head1 SYNOPSIS |
| 539 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 540 | $ korapxml2krill -z --input <directory> --output <filename> |
| 541 | $ korapxml2krill archive -z --input <directory> --output <directory> |
| 542 | $ korapxml2krill extract --input <directory> --output <filename> --sigle <SIGLE> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 543 | |
| 544 | |
| 545 | =head1 DESCRIPTION |
| 546 | |
| 547 | L<KorAP::XML::Krill> is a library to convert KorAP-XML documents to files |
| 548 | compatible with the L<Krill|https://github.com/KorAP/Krill> indexer. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 549 | The C<korapxml2krill> command line tool is a simple wrapper to the library. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 550 | |
| 551 | |
| 552 | =head1 INSTALLATION |
| 553 | |
| 554 | The preferred way to install L<KorAP::XML::Krill> is to use L<cpanm|App::cpanminus>. |
| 555 | |
| 556 | $ cpanm https://github.com/KorAP/KorAP-XML-Krill |
| 557 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 558 | In case everything went well, the C<korapxml2krill> tool will |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 559 | be available on your command line immediately. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 560 | |
| 561 | |
| 562 | =head1 ARGUMENTS |
| 563 | |
| 564 | =over 2 |
| 565 | |
| 566 | =item B<archive> |
| 567 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 568 | Process an archive as a Zip-file or a folder of KorAP-XML documents. |
| 569 | |
| 570 | =item B<extract> |
| 571 | |
| 572 | Extract KorAP-XML files from a Zip-file. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 573 | |
| 574 | =back |
| 575 | |
| 576 | |
| 577 | =head1 OPTIONS |
| 578 | |
| 579 | =over 2 |
| 580 | |
| 581 | =item B<--input|-i> <directory|file> |
| 582 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 583 | Directory or archive file of documents to convert. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 584 | |
| 585 | =item B<--output|-o> <directory|file> |
| 586 | |
| 587 | Output folder for archive processing or |
| 588 | document name for single output (optional), |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 589 | writes to C<STDOUT> by default |
| 590 | (in case C<output> is not mandatory due to further options). |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 591 | |
| 592 | =item B<--overwrite|-w> |
| 593 | |
| 594 | Overwrite files that already exist. |
| 595 | |
| 596 | =item B<--token|-t> <foundry>[#<file>] |
| 597 | |
| 598 | Define the default tokenization by specifying |
| 599 | the name of the foundry and optionally the name |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 600 | of the layer-file. Defaults to C<OpenNLP#tokens>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 601 | |
| 602 | =item B<--skip|-s> <foundry>[#<layer>] |
| 603 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 604 | Skip specific annotations by specifying the foundry |
| 605 | (and optionally the layer with a C<#>-prefix), |
| 606 | e.g. C<Mate> or C<Mate#Morpho>. Alternatively you can skip C<#ALL>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 607 | Can be set multiple times. |
| 608 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 609 | =item B<--anno|-a> <foundry>#<layer> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 610 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 611 | Convert specific annotations by specifying the foundry |
| 612 | (and optionally the layer with a C<#>-prefix), |
| 613 | e.g. C<Mate> or C<Mate#Morpho>. |
| 614 | Can be set multiple times. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 615 | |
| 616 | =item B<--primary|-p> |
| 617 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 618 | Output primary data or not. Defaults to C<true>. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 619 | Can be flagged using C<--no-primary> as well. |
| 620 | This is I<deprecated>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 621 | |
| 622 | =item B<--jobs|-j> |
| 623 | |
| 624 | Define the number of concurrent jobs in seperated forks |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 625 | for archive processing. |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 626 | Defaults to C<0> (everything runs in a single process). |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 627 | This is I<experimental>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 628 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 629 | =item B<--meta|-m> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 630 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 631 | Define the metadata parser to use. Defaults to C<I5>. |
| 632 | Metadata parsers can be defined in the C<KorAP::XML::Meta> namespace. |
| 633 | This is I<experimental>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 634 | |
| 635 | =item B<--pretty|-y> |
| 636 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 637 | Pretty print JSON output. Defaults to C<false>. |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 638 | This is I<deprecated>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 639 | |
| 640 | =item B<--gzip|-z> |
| 641 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 642 | Compress the output. |
| 643 | Expects a defined C<output> file in single processing. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 644 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame] | 645 | =item B<--cache|-c> |
| 646 | |
| 647 | File to mmap a cache (using L<Cache::FastMmap>). |
| 648 | Defaults to C<korapxml2krill.cache> in the calling directory. |
| 649 | |
| 650 | =item B<--cache-size|-cs> |
| 651 | |
| 652 | Size of the cache. Defaults to C<50m>. |
| 653 | |
| 654 | =item B<--cache-init|-ci> |
| 655 | |
| 656 | Initialize cache file. |
| 657 | Can be flagged using C<--no-cache-init> as well. |
| 658 | Defaults to C<true>. |
| 659 | |
| 660 | =item B<--cache-delete|-cd> |
| 661 | |
| 662 | Delete cache file after processing. |
| 663 | Can be flagged using C<--no-cache-delete> as well. |
| 664 | Defaults to C<true>. |
| 665 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 666 | =item B<--sigle|-sg> |
| 667 | |
| 668 | Extract the given text sigles. |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 669 | Can be set multiple times. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 670 | I<Currently only supported on C<extract>.> |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 671 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 672 | =item B<--log|-l> |
| 673 | |
| 674 | The L<Log4perl> log level, defaults to C<ERROR>. |
| 675 | |
| 676 | =item B<--help|-h> |
| 677 | |
| 678 | Print this document. |
| 679 | |
| 680 | =item B<--version|-v> |
| 681 | |
| 682 | Print version information. |
| 683 | |
| 684 | =back |
| 685 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 686 | =head1 ANNOTATION SUPPORT |
| 687 | |
| 688 | L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers |
| 689 | developed in the KorAP project that are part of the KorAP preprocessing pipeline. |
| 690 | The base foundry with paragraphs, sentences, and the text element are mandatory for |
| 691 | L<Krill|https://github.com/KorAP/Krill>. |
| 692 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 693 | =over 2 |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 694 | |
| 695 | =item B<Base> |
| 696 | |
| 697 | =over 4 |
| 698 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 699 | =item #Paragraphs |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 700 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 701 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 702 | |
| 703 | =back |
| 704 | |
| 705 | =item B<Connexor> |
| 706 | |
| 707 | =over 4 |
| 708 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 709 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 710 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 711 | =item #Phrase |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 712 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 713 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 714 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 715 | =item #Syntax |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 716 | |
| 717 | =back |
| 718 | |
| 719 | =item B<CoreNLP> |
| 720 | |
| 721 | =over 4 |
| 722 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 723 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 724 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 725 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 726 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 727 | =item #NamedEntities |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 728 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 729 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 730 | |
| 731 | =back |
| 732 | |
| 733 | =item B<DeReKo> |
| 734 | |
| 735 | =over 4 |
| 736 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 737 | =item #Structure |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 738 | |
| 739 | =back |
| 740 | |
| 741 | =item B<Glemm> |
| 742 | |
| 743 | =over 4 |
| 744 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 745 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 746 | |
| 747 | =back |
| 748 | |
| 749 | =item B<Mate> |
| 750 | |
| 751 | =over 4 |
| 752 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 753 | =item #Dependency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 754 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 755 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 756 | |
| 757 | =back |
| 758 | |
| 759 | =item B<OpenNLP> |
| 760 | |
| 761 | =over 4 |
| 762 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 763 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 764 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 765 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 766 | |
| 767 | =back |
| 768 | |
| 769 | =item B<Sgbr> |
| 770 | |
| 771 | =over 4 |
| 772 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 773 | =item #Lemma |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 774 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 775 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 776 | |
| 777 | =back |
| 778 | |
| 779 | =item B<TreeTagger> |
| 780 | |
| 781 | =over 4 |
| 782 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 783 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 784 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 785 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 786 | |
| 787 | =back |
| 788 | |
| 789 | =item B<XIP> |
| 790 | |
| 791 | =over 4 |
| 792 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 793 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 794 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 795 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 796 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 797 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 798 | |
| 799 | =back |
| 800 | |
| 801 | =back |
| 802 | |
| 803 | More importers are in preparation. |
| 804 | New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace. |
| 805 | See the built-in annotation importers as examples. |
| 806 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 807 | =head1 AVAILABILITY |
| 808 | |
| 809 | https://github.com/KorAP/KorAP-XML-Krill |
| 810 | |
| 811 | |
| 812 | =head1 COPYRIGHT AND LICENSE |
| 813 | |
| 814 | Copyright (C) 2015-2016, L<IDS Mannheim|http://www.ids-mannheim.de/> |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 815 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 816 | Author: L<Nils Diewald|http://nils-diewald.de/> |
| 817 | |
| 818 | L<KorAP::XML::Krill> is developed as part of the L<KorAP|http://korap.ids-mannheim.de/> |
| 819 | Corpus Analysis Platform at the |
| 820 | L<Institute for the German Language (IDS)|http://ids-mannheim.de/>, |
| 821 | member of the |
| 822 | L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/>. |
| 823 | |
| 824 | This program is free software published under the |
| 825 | L<BSD-2 License|https://raw.githubusercontent.com/KorAP/KorAP-XML-Krill/master/LICENSE>. |
| 826 | |
| 827 | =cut |