INJSON=exemple.jsonl

echo "-- source"
jq '.' $INJSON

echo "-- Les mots | The words"
jq '.word' $INJSON

echo "-- Les mots avec le champ basic | Words with the basic field"
jq 'select(.basic)|.word' $INJSON

echo '-- Objet dont la clé est mot, mais sans basic | Objects with word as key, ignoring basic'
jq -c '{(.word):.|del(.basic)}' $INJSON

echo '-- Valeurs de tous les champs tab | Values of all tab values'
jq '.. | .tab? | strings' $INJSON

echo '-- Liste des champs tab sans répétition | List of unique tab field values '
jq -s -c '[.[] | .. | .tab? | strings ] | unique' $INJSON

echo "-- Fréquences d'apparition des champs tab | Frequency of the tab field"
jq -s 'reduce (.. | .tab? | strings) as $w ({};.[$w]+=1)' $INJSON

echo "-- Re-création du fichier json | Re-create the json file"
jq -s 'reduce .[] as $elem ({}; .+ {($elem|.word) : $elem|del(.word) })' $INJSON

