Log slimming now part of KorAP::XML::Krill
Change-Id: Iaa8bd33ddbc9ceb11dcc750e34aed5077a972e74
diff --git a/bin/slim_korapxml2krill_log b/bin/slim_korapxml2krill_log
deleted file mode 100644
index f0146cf..0000000
--- a/bin/slim_korapxml2krill_log
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env perl
-use Mojo::Base -strict;
-use Mojo::File qw'path';
-
-our @ARGV;
-my ($unable, $unable_substring, $unable_offsets) = (0,0,0);
-
-my $file = path($ARGV[0]);
-my $out_fh = path($file->dirname)->child(
- $file->basename('.log') . '-slim.log'
-)->open('>');
-
-my $fh = $file->open('<');
-
-# Iterate over file
-while (!eof($fh)){
- local $_ = <$fh>;
-
- if ($_ =~ qr!(?: Processed)! && $_ !~ qr!:1\/!) {
- next;
- };
-
- if ($_ =~ qr! Unable to process !) {
- $unable++;
- next;
- }
- elsif ($_ =~ qr! Tokenization with failing offsets !) {
- $unable_offsets++;
- next;
- }
- elsif ($_ =~ qr! Unable to find substring !) {
- $unable_substring++;
- next;
- }
- elsif ($_ =~ qr!^Done\.$!) {
- my $str = 'Done.';
- $str .= ' [!Process: ' . $unable . ']' if $unable;
- $str .= ' [!Offstes: ' . $unable_offsets . ']' if $unable_offsets;
- $str .= ' [!Substring: ' . $unable_substring . ']' if $unable_substring;
- $unable = 0;
- $unable_substring = 0;
- $unable_offsets = 0;
- print $out_fh "## $str\n";
- next;
- };
-
- if ($_ =~ qr! Unable to (?:process|find substring) !) {
- next;
- }
- elsif ($_ =~ qr!substr outside of string!) {
- next;
- }
- elsif ($_ =~ qr!with failing offsets!) {
- next;
- }
- elsif ($_ =~ qr! in \/opt\/korap!) {
- next;
- };
-
- print $out_fh $_;
-};
-
-$out_fh->close;
-$fh->close;
-
-__END__
-
-=pod
-
- $ slim_korapxml2krill mylog.log
-
-=cut