2 to_entries[] | .key as $ty | .value |
3 to_entries[] | .key as $list | .value as $m | .value |
4 ("\($list): \($m|length) size" | debug) as $_ |
5 to_entries[] | .key as $ngram | .value |
6 select(.root) | debug |
7 select( # We keep only records with errors
8 .root and # We need .root
10 $m[.root].root != null or # A root should have no root itself
11 .parent != .root and # We need .parent different .root
12 $m[.parent].root != .root # The parent's root should the same root.
15 {$ty, $list, $ngram, data: .}