Group
Extension

Matches 9

PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Parser/JSON.pm ( view source; MetaCPAN )
package PICA::Parser::JSON;
use v5.14.1;

our $VERSION = '2.12';

use JSON::PP;
our $JSON = JSON::PP->new;

use parent 'PICA::Parser::Base';

sub _next_record {
    my ($self) = @_;

    if (my $line 
= $self->{reader}->getline) {
        my $record = $JSON->decode($line);
        $record = $record->{record} if ref $record eq 'HASH';

        return $record;

        # TODO: cleanup occurrence and 
   }
}

1;
__END__

=head1 NAME

PICA::Parser::JSON - PICA JSON parser

=head2 DESCRIPTION

This parser parses L<PICA JSON|http://format.gbv.de/pica/json> format. The
current implementation expects re
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Writer/JSON.pm ( view source; MetaCPAN )
package PICA::Writer::JSON;
use v5.14.1;

our $VERSION = '2.12';

use Scalar::Util qw(reftype);
use JSON::PP;
use PICA::Data;

use parent 'PICA::Writer::Base';

sub write_record {
    my ($self, $reco
rd) = @_;

    my $json = $self->{json};
    unless ($json) {
        $json = JSON::PP->new(%$self);
        $json->$_($self->{$_})
            for grep {exists $self->{$_}}
            qw(pretty asci
f->{json} = $json;
    }

    print {$self->{fh}} $json->encode(PICA::Data::TO_JSON($record));
    print {$self->{fh}} "\n" unless $json->get_indent;
}

1;
__END__

=head1 NAME

PICA::Writer::JSON - P
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Data.pm ( view source; MetaCPAN )
rt;
use PICA::Parser::Binary;
use PICA::Parser::PPXML;
use PICA::Parser::PIXML;
use PICA::Parser::JSON;
use PICA::Writer::XML;
use PICA::Writer::Plus;
use PICA::Writer::Plain;
use PICA::Writer::Patch;
rt;
use PICA::Writer::Binary;
use PICA::Writer::PPXML;
use PICA::Writer::PIXML;
use PICA::Writer::JSON;
use PICA::Writer::Generic;

sub pica_parser {
    _pica_module('PICA::Parser', @_);
}

sub pica_
$//),
        'Binary' => ($pica =~ tr/\x{1F}//),
        'XML'    => ($pica =~ tr/<//),
        'JSON'   => ($pica =~ tr/[{[]//),
        'NL'     => ($pica =~ tr/[\r\n]//),
        'IS3'    => ($pic
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Schema/Builder.pm ( view source; MetaCPAN )
>{$_}{required};
    }

    $self->{records}++;
}

sub schema {
    my $schema = dclone($_[0]->TO_JSON);
    my $fields = $schema->{fields};

    delete $fields->{$_} for grep {!$fields->{$_}{total}} 
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Schema.pm ( view source; MetaCPAN )
cc" : $tag;
}

sub TO_JSON {
    my ($self) = @_;
    return {map {$_ => $self->{$_}} keys %$self};
}

sub abbreviated {
    my ($self) = @_;
    my $abbr = dclone($self->TO_JSON);
    delete $abbr->{
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Parser/Base.pm ( view source; MetaCPAN )
:Parser::Import>

=item L<PICA::Parser::XML>

=item L<PICA::Parser::PPXML>

=item L<PICA::Parser::JSON>

=item L<PICA::Parser::Patch>

=back

=head2 CONFIGURATION

=over

=item strict

By default faul
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/App/picadata.pm ( view source; MetaCPAN )
Builder;
use Getopt::Long qw(:config bundling);
use Pod::Usage;
use Scalar::Util qw(reftype);
use JSON::PP;
use List::Util qw(any all);
use Text::Abbrev;
use Term::ANSIColor;

my %TYPES = (
    bin   
=> 'Plus',
    xml    => 'XML',
    ppxml  => 'PPXML',
    pixml  => 'PIXML',
    json   => 'JSON',
    ndjson => 'JSON',
    patch  => 'Patch',
);

my %COLORS = (
    tag        => 'magenta',
    occ
($command eq 'diff') {

            # only Plain and JSON support annotations
            $opt->{to} = 'plain' unless $TYPES{lc $opt->{to}} eq 'JSON';
        }
    }

    $opt->{input} = @argv ? \@ar
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Writer/Base.pm ( view source; MetaCPAN )
A::Writer::Plus>

=item L<PICA::Writer::XML>

=item L<PICA::Writer::PPXML>

=item L<PICA::Writer::JSON>

=item L<PICA::Writer::Generic>

=item L<PICA::Writer::Patch>

=back

=head1 METHODS

=head2 new
PICA-Data ( V/VO/VOJ/PICA-Data-2.12.tar.gz, VOJ, 2023; MetaCPAN )
PICA-Data/lib/PICA/Data/Field.pm ( view source; MetaCPAN )
ined first {$a->[$_] ne $b->[$_]} 0 .. $#{$b});
}

sub clone {
    bless TO_JSON($_[0]), 'PICA::Data::Field';
}

sub TO_JSON {
    [@{$_[0]}];
}

1;

=head1 NAME

PICA::Data::Field - PICA+ Field

=hea

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.