Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: New perl module MARC::File::MiJ -- marc-in-json for perl

2 views
Skip to first unread message

Marc Chantreux

unread,
Sep 24, 2013, 7:26:59 AM9/24/13
to Bill Dueber, perl...@perl.org
hello

> It's currently supported across several implementations:
> * ruby's marc gem
> * php's File_MARC
> * java's marc4j
> * python's pymarc

just for the record: i was aware of MIJ when i wrote MARC::MIR. I just
ignored it because of the problems i just mention on code4lib.

yet, a converter would be easy:

sub mir2mij (_) {
my $mir = shift;
{ leader: $$mir[0]
, fields: [ map {
my ( $tag, $data ) = %$_;
if ( ref $data ) {
# data field
[ $tag
, [ map [%$_], @{$$data{subfields}} ]
, [ @{$data}{qw< ind1 ind2 >} ] ]
}
else {
# control field
[ $tag, $data ]
}
} @{$$mir[1]} ] }
}

regards
--
Marc Chantreux
Université de Strasbourg, Direction Informatique
14 Rue René Descartes,
67084 STRASBOURG CEDEX
☎: 03.68.85.57.40
http://unistra.fr
"Don't believe everything you read on the Internet"
-- Abraham Lincoln
0 new messages