From c07ef75c5561274c85f432be6d7f37f8087655f9 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Fri, 12 Aug 2022 11:50:35 +0200 Subject: [PATCH] Make use of `flatten()` Fix function. See metafacture/metafacture-fix#244. --- src/main/resources/transformation/alma.fix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/resources/transformation/alma.fix b/src/main/resources/transformation/alma.fix index 2eaf1fc4..94765d43 100644 --- a/src/main/resources/transformation/alma.fix +++ b/src/main/resources/transformation/alma.fix @@ -888,10 +888,8 @@ do list(path: "264[ 23]1.c", "var": "$i") end copy_field("@date[12]", "@date") split_field("@date", "[,-]") +flatten("@date") do list(path: "@date", "var": "$i") - copy_field("$i", "@date_flat") -end -do list(path: "@date_flat", "var": "$i") replace_all("$i", ".*?(\\d{4}).*", "$1") if any_match("$i", "\\d{4}") unless any_equal("$i", "9999") @@ -1538,10 +1536,8 @@ do list(path: "982 ", "var": "$i") copy_field("$i.b", "@subjectHeadings") copy_field("$i.a", "@subjectTopicName") split_field("@subjectTopicName", ";|\\*") - do list(path: "@subjectTopicName", "var": "$j") - copy_field("$j", "@subjectHeadings") - end - remove_field("@subjectTopicName") + flatten("@subjectTopicName") + move_field("@subjectTopicName", "@subjectHeadings") end end # MARC/689