From c07cd773dbedfe8f4a76b43dd9ec37f841d09432 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 22 Mar 2020 09:00:06 +0100 Subject: JQ script for extracting first definitions --- first-def.jq | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 first-def.jq diff --git a/first-def.jq b/first-def.jq new file mode 100644 index 0000000..13bc221 --- /dev/null +++ b/first-def.jq @@ -0,0 +1,6 @@ +.[] | +{romaji: .romaji, text: .alternatives[0].text} + ( + .alternatives[0] | + (select(has("definitions")) | {def: .definitions[0]}), + (select(has("conjugations")) | .conjugations[0] | {form: .form} + (.alternatives[0] | {text, def: .definitions[0]})) +) -- cgit v1.2.3-70-g09d2