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 | |
| 348 | # Test will be skipped |
| 349 | |
| 350 | # Iterate over all given sigles and extract |
| 351 | foreach (@sigle) { |
| 352 | print "$_ "; |
| 353 | print '' . ($archive->extract('./'. $_, $output) ? '' : 'not '); |
| 354 | print "extracted.\n"; |
| 355 | }; |
| 356 | |
| 357 | print "\n"; |
| 358 | exit(1); |
| 359 | }; |
| 360 | } |
| 361 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 362 | # Process an archive |
| 363 | elsif ($cmd eq 'archive') { |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 364 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 365 | # TODO: Support sigles |
| 366 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 367 | pod2usage(%ERROR_HASH) unless $output; |
| 368 | |
| 369 | if ($output && (!-e $output || !-d $output)) { |
| 370 | print "Directory '$output' does not exist.\n\n"; |
| 371 | exit(0); |
| 372 | }; |
| 373 | |
| 374 | # Zero means: everything runs in the parent process |
| 375 | my $pool = Parallel::ForkManager->new($jobs); |
| 376 | |
| 377 | my $count = 0; # Texts to process |
| 378 | my $iter = 1; # Current text in process |
| 379 | |
| 380 | # Report on fork message |
| 381 | $pool->run_on_finish ( |
| 382 | sub { |
| 383 | my ($pid, $code) = shift; |
| 384 | my $data = pop; |
| 385 | print 'Convert ['. ($jobs > 0 ? "$pid:" : '') . |
| 386 | ($iter++) . "/$count]" . |
| 387 | ($code ? " $code" : '') . |
| 388 | " $$data\n"; |
| 389 | } |
| 390 | ); |
| 391 | |
| 392 | my $t; |
| 393 | print "Reading data ...\n"; |
| 394 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame^] | 395 | unless (Cache::FastMmap->new( |
| 396 | share_file => $cache_file, |
| 397 | cache_size => $cache_size, |
| 398 | init_file => $cache_init |
| 399 | )) { |
| 400 | print "Unable to intialize cache '$cache_file'\n\n"; |
| 401 | exit(1); |
| 402 | }; |
| 403 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 404 | # Input is a directory |
| 405 | if (-d $input) { |
| 406 | my $it = Directory::Iterator->new($input); |
| 407 | my @dirs; |
| 408 | my $dir; |
| 409 | |
| 410 | while (1) { |
| 411 | if (!$it->is_directory && ($dir = $it->get) && $dir =~ s{/data\.xml$}{}) { |
| 412 | push @dirs, $dir; |
| 413 | $it->prune; |
| 414 | }; |
| 415 | last unless $it->next; |
| 416 | }; |
| 417 | |
| 418 | print "Start processing ...\n"; |
| 419 | $t = Benchmark->new; |
| 420 | $count = scalar @dirs; |
| 421 | |
| 422 | DIRECTORY_LOOP: |
| 423 | for (my $i = 0; $i < $count; $i++) { |
| 424 | |
| 425 | unless ($overwrite) { |
| 426 | my $filename = catfile( |
| 427 | $output, |
| 428 | get_file_name($dirs[$i]) . '.json' . ($gzip ? '.gz' : '') |
| 429 | ); |
| 430 | |
| 431 | if (-e $filename) { |
| 432 | $iter++; |
| 433 | print "Skip $filename\n"; |
| 434 | next; |
| 435 | }; |
| 436 | }; |
| 437 | |
| 438 | # Get the next fork |
| 439 | my $pid = $pool->start and next DIRECTORY_LOOP; |
| 440 | my $msg; |
| 441 | |
| 442 | $msg = write_file($dirs[$i]); |
| 443 | $pool->finish(0, \$msg); |
| 444 | }; |
| 445 | } |
| 446 | |
| 447 | # Input is a file |
| 448 | elsif (-f($input) && (my $archive = KorAP::XML::Archive->new($input))) { |
| 449 | unless ($archive->test_unzip) { |
| 450 | print "Unzip is not installed or incompatible.\n\n"; |
| 451 | exit(1); |
| 452 | }; |
| 453 | |
| 454 | unless ($archive->test) { |
| 455 | print "Zip archive not compatible.\n\n"; |
| 456 | exit(1); |
| 457 | }; |
| 458 | |
| 459 | print "Start processing ...\n"; |
| 460 | $t = Benchmark->new; |
| 461 | my @dirs = $archive->list_texts; |
| 462 | $count = scalar @dirs; |
| 463 | |
| 464 | ARCHIVE_LOOP: |
| 465 | for (my $i = 0; $i < $count; $i++) { |
| 466 | |
| 467 | # Split path information |
| 468 | my ($prefix, $corpus, $doc, $text) = $archive->split_path($dirs[$i]); |
| 469 | |
| 470 | unless ($overwrite) { |
| 471 | my $filename = catfile( |
| 472 | $output, |
| 473 | get_file_name(catdir($doc, $text)) . '.json' . ($gzip ? '.gz' : '') |
| 474 | ); |
| 475 | |
| 476 | if (-e $filename) { |
| 477 | $iter++; |
| 478 | print "Skip $filename\n"; |
| 479 | next; |
| 480 | }; |
| 481 | }; |
| 482 | |
| 483 | # Get the next fork |
| 484 | my $pid = $pool->start and next ARCHIVE_LOOP; |
| 485 | |
| 486 | # Create temporary file |
| 487 | my $temp = File::Temp->newdir; |
| 488 | |
| 489 | my $msg; |
| 490 | |
| 491 | # Extract from archive |
| 492 | if ($archive->extract($dirs[$i], $temp)) { |
| 493 | |
| 494 | # Create corpus directory |
| 495 | $input = catdir("$temp", $corpus); |
| 496 | |
| 497 | # Temporary directory |
| 498 | my $dir = catdir($input, $doc, $text); |
| 499 | |
| 500 | # Write file |
| 501 | $msg = write_file($dir); |
| 502 | |
| 503 | $temp = undef; |
| 504 | $pool->finish(0, \$msg); |
| 505 | } |
| 506 | else { |
| 507 | |
| 508 | $temp = undef; |
| 509 | $msg = "Unable to extract " . $dirs[$i] . "\n"; |
| 510 | $pool->finish(1, \$msg); |
| 511 | }; |
| 512 | }; |
| 513 | } |
| 514 | |
| 515 | else { |
| 516 | print "Input is neither a directory nor an archive.\n\n"; |
| 517 | }; |
| 518 | |
| 519 | $pool->wait_all_children; |
| 520 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame^] | 521 | # Delete cache file |
| 522 | unlink($cache_file) if $cache_delete; |
| 523 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 524 | print "Done.\n"; |
| 525 | print timestr(timediff(Benchmark->new, $t))."\n\n"; |
| 526 | } |
| 527 | |
| 528 | # Unknown command |
| 529 | else { |
| 530 | warn "Unknown command '$cmd'.\n\n"; |
| 531 | pod2usage(%ERROR_HASH); |
| 532 | } |
Nils Diewald | 2db9ad0 | 2013-10-29 19:26:43 +0000 | [diff] [blame] | 533 | |
| 534 | __END__ |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 535 | |
| 536 | =pod |
| 537 | |
| 538 | =encoding utf8 |
| 539 | |
| 540 | =head1 NAME |
| 541 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 542 | korapxml2krill - Merge KorapXML data and create Krill documents |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 543 | |
| 544 | |
| 545 | =head1 SYNOPSIS |
| 546 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 547 | $ korapxml2krill -z --input <directory> --output <filename> |
| 548 | $ korapxml2krill archive -z --input <directory> --output <directory> |
| 549 | $ korapxml2krill extract --input <directory> --output <filename> --sigle <SIGLE> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 550 | |
| 551 | |
| 552 | =head1 DESCRIPTION |
| 553 | |
| 554 | L<KorAP::XML::Krill> is a library to convert KorAP-XML documents to files |
| 555 | compatible with the L<Krill|https://github.com/KorAP/Krill> indexer. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 556 | The C<korapxml2krill> command line tool is a simple wrapper to the library. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 557 | |
| 558 | |
| 559 | =head1 INSTALLATION |
| 560 | |
| 561 | The preferred way to install L<KorAP::XML::Krill> is to use L<cpanm|App::cpanminus>. |
| 562 | |
| 563 | $ cpanm https://github.com/KorAP/KorAP-XML-Krill |
| 564 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 565 | In case everything went well, the C<korapxml2krill> tool will |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 566 | be available on your command line immediately. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 567 | |
| 568 | |
| 569 | =head1 ARGUMENTS |
| 570 | |
| 571 | =over 2 |
| 572 | |
| 573 | =item B<archive> |
| 574 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 575 | Process an archive as a Zip-file or a folder of KorAP-XML documents. |
| 576 | |
| 577 | =item B<extract> |
| 578 | |
| 579 | Extract KorAP-XML files from a Zip-file. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 580 | |
| 581 | =back |
| 582 | |
| 583 | |
| 584 | =head1 OPTIONS |
| 585 | |
| 586 | =over 2 |
| 587 | |
| 588 | =item B<--input|-i> <directory|file> |
| 589 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 590 | Directory or archive file of documents to convert. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 591 | |
| 592 | =item B<--output|-o> <directory|file> |
| 593 | |
| 594 | Output folder for archive processing or |
| 595 | document name for single output (optional), |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 596 | writes to C<STDOUT> by default |
| 597 | (in case C<output> is not mandatory due to further options). |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 598 | |
| 599 | =item B<--overwrite|-w> |
| 600 | |
| 601 | Overwrite files that already exist. |
| 602 | |
| 603 | =item B<--token|-t> <foundry>[#<file>] |
| 604 | |
| 605 | Define the default tokenization by specifying |
| 606 | the name of the foundry and optionally the name |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 607 | of the layer-file. Defaults to C<OpenNLP#tokens>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 608 | |
| 609 | =item B<--skip|-s> <foundry>[#<layer>] |
| 610 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 611 | Skip specific annotations by specifying the foundry |
| 612 | (and optionally the layer with a C<#>-prefix), |
| 613 | 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] | 614 | Can be set multiple times. |
| 615 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 616 | =item B<--anno|-a> <foundry>#<layer> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 617 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 618 | Convert specific annotations by specifying the foundry |
| 619 | (and optionally the layer with a C<#>-prefix), |
| 620 | e.g. C<Mate> or C<Mate#Morpho>. |
| 621 | Can be set multiple times. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 622 | |
| 623 | =item B<--primary|-p> |
| 624 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 625 | Output primary data or not. Defaults to C<true>. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 626 | Can be flagged using C<--no-primary> as well. |
| 627 | This is I<deprecated>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 628 | |
| 629 | =item B<--jobs|-j> |
| 630 | |
| 631 | Define the number of concurrent jobs in seperated forks |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 632 | for archive processing. |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame^] | 633 | Defaults to C<0> (everything runs in a single process). |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 634 | This is I<experimental>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 635 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 636 | =item B<--meta|-m> |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 637 | |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 638 | Define the metadata parser to use. Defaults to C<I5>. |
| 639 | Metadata parsers can be defined in the C<KorAP::XML::Meta> namespace. |
| 640 | This is I<experimental>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 641 | |
| 642 | =item B<--pretty|-y> |
| 643 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 644 | Pretty print JSON output. Defaults to C<false>. |
Akron | 35db6e3 | 2016-03-17 22:42:22 +0100 | [diff] [blame] | 645 | This is I<deprecated>. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 646 | |
| 647 | =item B<--gzip|-z> |
| 648 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 649 | Compress the output. |
| 650 | Expects a defined C<output> file in single processing. |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 651 | |
Akron | 11c8030 | 2016-03-18 19:44:43 +0100 | [diff] [blame^] | 652 | =item B<--cache|-c> |
| 653 | |
| 654 | File to mmap a cache (using L<Cache::FastMmap>). |
| 655 | Defaults to C<korapxml2krill.cache> in the calling directory. |
| 656 | |
| 657 | =item B<--cache-size|-cs> |
| 658 | |
| 659 | Size of the cache. Defaults to C<50m>. |
| 660 | |
| 661 | =item B<--cache-init|-ci> |
| 662 | |
| 663 | Initialize cache file. |
| 664 | Can be flagged using C<--no-cache-init> as well. |
| 665 | Defaults to C<true>. |
| 666 | |
| 667 | =item B<--cache-delete|-cd> |
| 668 | |
| 669 | Delete cache file after processing. |
| 670 | Can be flagged using C<--no-cache-delete> as well. |
| 671 | Defaults to C<true>. |
| 672 | |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 673 | =item B<--sigle|-sg> |
| 674 | |
| 675 | Extract the given text sigles. |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 676 | Can be set multiple times. |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 677 | I<Currently only supported on C<extract>.> |
Akron | e10ad32 | 2016-02-27 10:54:26 +0100 | [diff] [blame] | 678 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 679 | =item B<--log|-l> |
| 680 | |
| 681 | The L<Log4perl> log level, defaults to C<ERROR>. |
| 682 | |
| 683 | =item B<--help|-h> |
| 684 | |
| 685 | Print this document. |
| 686 | |
| 687 | =item B<--version|-v> |
| 688 | |
| 689 | Print version information. |
| 690 | |
| 691 | =back |
| 692 | |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 693 | =head1 ANNOTATION SUPPORT |
| 694 | |
| 695 | L<KorAP::XML::Krill> has built-in importer for some annotation foundries and layers |
| 696 | developed in the KorAP project that are part of the KorAP preprocessing pipeline. |
| 697 | The base foundry with paragraphs, sentences, and the text element are mandatory for |
| 698 | L<Krill|https://github.com/KorAP/Krill>. |
| 699 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 700 | =over 2 |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 701 | |
| 702 | =item B<Base> |
| 703 | |
| 704 | =over 4 |
| 705 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 706 | =item #Paragraphs |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 707 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 708 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 709 | |
| 710 | =back |
| 711 | |
| 712 | =item B<Connexor> |
| 713 | |
| 714 | =over 4 |
| 715 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 716 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 717 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 718 | =item #Phrase |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 719 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 720 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 721 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 722 | =item #Syntax |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 723 | |
| 724 | =back |
| 725 | |
| 726 | =item B<CoreNLP> |
| 727 | |
| 728 | =over 4 |
| 729 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 730 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 731 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 732 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 733 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 734 | =item #NamedEntities |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 735 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 736 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 737 | |
| 738 | =back |
| 739 | |
| 740 | =item B<DeReKo> |
| 741 | |
| 742 | =over 4 |
| 743 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 744 | =item #Structure |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 745 | |
| 746 | =back |
| 747 | |
| 748 | =item B<Glemm> |
| 749 | |
| 750 | =over 4 |
| 751 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 752 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 753 | |
| 754 | =back |
| 755 | |
| 756 | =item B<Mate> |
| 757 | |
| 758 | =over 4 |
| 759 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 760 | =item #Dependency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 761 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 762 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 763 | |
| 764 | =back |
| 765 | |
| 766 | =item B<OpenNLP> |
| 767 | |
| 768 | =over 4 |
| 769 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 770 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 771 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 772 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 773 | |
| 774 | =back |
| 775 | |
| 776 | =item B<Sgbr> |
| 777 | |
| 778 | =over 4 |
| 779 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 780 | =item #Lemma |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 781 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 782 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 783 | |
| 784 | =back |
| 785 | |
| 786 | =item B<TreeTagger> |
| 787 | |
| 788 | =over 4 |
| 789 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 790 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 791 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 792 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 793 | |
| 794 | =back |
| 795 | |
| 796 | =item B<XIP> |
| 797 | |
| 798 | =over 4 |
| 799 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 800 | =item #Constituency |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 801 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 802 | =item #Morpho |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 803 | |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 804 | =item #Sentences |
Akron | c13a170 | 2016-03-15 19:33:14 +0100 | [diff] [blame] | 805 | |
| 806 | =back |
| 807 | |
| 808 | =back |
| 809 | |
| 810 | More importers are in preparation. |
| 811 | New annotation importers can be defined in the C<KorAP::XML::Annotation> namespace. |
| 812 | See the built-in annotation importers as examples. |
| 813 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 814 | =head1 AVAILABILITY |
| 815 | |
| 816 | https://github.com/KorAP/KorAP-XML-Krill |
| 817 | |
| 818 | |
| 819 | =head1 COPYRIGHT AND LICENSE |
| 820 | |
| 821 | Copyright (C) 2015-2016, L<IDS Mannheim|http://www.ids-mannheim.de/> |
Akron | f7ad89e | 2016-03-16 18:22:47 +0100 | [diff] [blame] | 822 | |
Akron | 941c1a6 | 2016-02-23 17:41:41 +0100 | [diff] [blame] | 823 | Author: L<Nils Diewald|http://nils-diewald.de/> |
| 824 | |
| 825 | L<KorAP::XML::Krill> is developed as part of the L<KorAP|http://korap.ids-mannheim.de/> |
| 826 | Corpus Analysis Platform at the |
| 827 | L<Institute for the German Language (IDS)|http://ids-mannheim.de/>, |
| 828 | member of the |
| 829 | L<Leibniz-Gemeinschaft|http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/>. |
| 830 | |
| 831 | This program is free software published under the |
| 832 | L<BSD-2 License|https://raw.githubusercontent.com/KorAP/KorAP-XML-Krill/master/LICENSE>. |
| 833 | |
| 834 | =cut |