LibreCat / Catmandu-MARC

Catmandu modules for working with MARC data
https://metacpan.org/release/Catmandu-MARC
Other
8 stars 10 forks source link

Merge `marc_map` and `marc_spec` #109

Open nichtich opened 2 years ago

nichtich commented 2 years ago

Having both marc_map and marc_spec is confusing, why having both with slightly different functionality? Can we make marc_map an alias for marc_spec instead?

phochste commented 2 years ago

The difference is because of the history how these mappers were created . I made the marc_map and in a later phase @cKlee 's research on MARC Spec resulted in his marc_spec implementation in Perl.

There is overlap between marc_map and the marc_spec (Casten worked on that) but there is some syntax differences. E.g.:

The marc_map syntax is also used in other fixes such as marc_replace_all , marc_remove, marc_cut, marc_copy

These things can be tackled by mapping the MARC paths themselves to the MARCSpec version and using the MARC Spec tools. This seems doable for all the fixes above, but requires time and effort.

There is some overhead currently in using marc_spec which runs on my local tests about 11% slower for every included marc_spec instead of marc_map. This overhead is for my own local applications a reason to use marc_map over marc_spec in some use cases (with lots of data and little time slots available for processing)

nichtich commented 2 years ago

Thank's for clarification. To summarize: