diff --git a/Makefile b/Makefile index 1939a7b..d5632f1 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ # See https://tech.davis-hansson.com/p/make/#change-some-make-defaults .DELETE_ON_ERROR: +data/corpus-simple-label-pascal.json: data/corpus-simple-pascal.json + npx ezs enrich-pascal.ini < $< > $@ + data/corpus-simple-pascal.json: data/corpus-simple-teeft-en.json npx ezs enrich-pascal.ini < $< > $@ diff --git a/README.md b/README.md index 7f90fb7..701a9af 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ "tasks": [ { "CronRule": "0 1 * * *", - "Target": "data/corpus-simple-pascal.json", + "Target": "data/corpus-simple-label-pascal.json", "RunOnStartup": true } ] diff --git a/extract-pascal-label.ini b/extract-pascal-label.ini new file mode 100644 index 0000000..6eb3d36 --- /dev/null +++ b/extract-pascal-label.ini @@ -0,0 +1,22 @@ +# Usage: npx ezs extract-pascal-label.ini < data/corpus-simple-pascal.json > data/corpus-simple-label-pascal.json + + +# To see the enriched notices: +# $ fx < data/corpus-simple-label-pascal.json '.filter(o => o.ws.rnsr[0]?.length)' + + +[use] +# JSONParse +plugin = basics + +[JSONParse] + +# Action! + +[assign] +path = ws.label +value = fix(_.get(self, "ws.pascal.1.code.value", "").replace("BGI / Prodig", "Géographie"), _.get(self, "ws.pascal.2.code.value")).join(" - ") + + +[dump] +indent = true