Removed deprecated 'pretty' flag
Change-Id: I63272027a955d85574fe24be18ba64ec56200959
diff --git a/Changes b/Changes
index beb5043..ed2e8ff 100644
--- a/Changes
+++ b/Changes
@@ -11,6 +11,7 @@
- Optimization by reducing calls to _offset().
- Introduced add_span() method to MultiTermToken.
- Removed deprecated 'primary' flag.
+ - Removed deprecated 'pretty' flag.
0.40 2020-03-03
- Fixed XIP parser.
diff --git a/lib/KorAP/XML/Batch/File.pm b/lib/KorAP/XML/Batch/File.pm
index 6dc5d7b..5c1bea9 100644
--- a/lib/KorAP/XML/Batch/File.pm
+++ b/lib/KorAP/XML/Batch/File.pm
@@ -22,7 +22,6 @@
koral => $param{koral},
non_word_tokens => $param{non_word_tokens},
non_verbal_tokens => $param{non_verbal_tokens},
- pretty => $param{pretty},
gzip => $param{gzip} // 0
}, $class;
};
@@ -73,11 +72,7 @@
};
my $file;
- my $print_text = (
- $self->{pretty} ?
- $tokens->to_pretty_json($self->{koral}) :
- $tokens->to_json($self->{koral})
- );
+ my $print_text = $tokens->to_json($self->{koral});
# There is an output file given
if ($output) {
@@ -200,11 +195,6 @@
A L<Mojo::Log> compatible log object.
-=item pretty
-
-Pretty print the output JSON.
-Defaults to C<false>.
-
=item gzip
Compress the output using Gzip.
diff --git a/lib/KorAP/XML/Tokenizer.pm b/lib/KorAP/XML/Tokenizer.pm
index ffd9f80..7e72968 100644
--- a/lib/KorAP/XML/Tokenizer.pm
+++ b/lib/KorAP/XML/Tokenizer.pm
@@ -608,13 +608,6 @@
encode_json($self->to_data($version));
};
-
-sub to_pretty_json {
- my ($self, $version) = @_;
- JSON::XS->new->pretty->encode($self->to_data($version));
-};
-
-
# Remove diacritics from a unicode string
sub remove_diacritics {
use utf8;
diff --git a/script/korapxml2krill b/script/korapxml2krill
index 791d115..b42c793 100644
--- a/script/korapxml2krill
+++ b/script/korapxml2krill
@@ -196,7 +196,9 @@
'primary|p!' => sub {
warn 'Primary flag no longer supported!';
},
- 'pretty|y' => \(my $pretty),
+ 'pretty|y' => sub {
+ warn 'Pretty flag no longer supported!';
+ },
'jobs|j=i' => \($cfg{jobs}),
'koral|k=f' => \($cfg{koral}),
'to-tar' => \($cfg{to_tar}),
@@ -502,7 +504,6 @@
gzip => $gzip,
log => $log,
koral => ($cfg{koral} // $KORAL_VERSION),
- pretty => $pretty,
anno => \@filtered_anno,
non_word_tokens => ($cfg{non_word_tokens} // 0),
non_verbal_tokens => ($cfg{non_verbal_tokens} // 0)
@@ -1211,12 +1212,6 @@
This is I<experimental>.
-=item B<--pretty|-y>
-
-Pretty print JSON output. Defaults to C<false>.
-This is I<deprecated>.
-
-
=item B<--gzip|-z>
Compress the output.
diff --git a/t/batch_file.t b/t/batch_file.t
index 12f7e12..55f4631 100644
--- a/t/batch_file.t
+++ b/t/batch_file.t
@@ -105,13 +105,6 @@
like($file, qr/^\{"/, 'No pretty printing');
-# Check pretty printing
-$bf->{pretty} = 1;
-ok($bf->process($path => $output), 'Process file');
-ok(-f $output, 'File exists');
-ok($file = Mojo::File->new($output)->slurp, 'Slurp data');
-like($file, qr/^\{[\n\s]+"/, 'No pretty printing');
-
# Check overwriting
$bf->{overwrite} = 0;