Question: Given following json content ,

```
{

    "application": "grafana",
    "users": {
        "admin": {
             "display-name": "admin",
             "access": "admin"
        },
        "user1": {
             "display-name": "user1",
             "access": "read"
        },
        "user2": {
             "display-name": "user2",
             "access": "edit"
        }
    }
}

```

I want to produce tsv format like following :

```
Application  User   Access
grafana      admin  admin
             user1  read
             user2  edit

```

How can I use jq @tsv to achieve that ?

Answer: 
here's my "one-liner" solution:

```rb
dictionary = ["below", "down", "go", "going", "horn", "how", "howdy", "it", "i", "low", "own", "part", "partner", "sit"]

str = "below, below, how's it goin?"

str.split(/\W+/).tally.slice(*dictionary) #=> {"below"=>2, "how"=>1, "it"=>1}

```
If more than one string is to be evaluated we could write the following.

```
require 'set'

dictionary = %w|
  below down go going horn how howdy
  it i low own part partner sit
|

DICTIONARY = dictionary.to_set
  #=> #<Set: {"below", "down", "go", "going", "horn", "how", "howdy",
  #           "it", "i", "low", "own", "part", "partner", "sit"}>

```

```
def doit(str)
  str.scan(/\w+/).map(&:downcase).tally.select { |word| DICTIONARY.include?(word) }
end

```

```
doit "Below, below, how's it goin?"
  #=> {"below"=>2, "how"=>1, "it"=>1}

```

```
doit "The sub's skipper said 'howdy' before going below then the sub went down below"
  #=>{"howdy"=>1, "going"=>1, "below"=>2, "down"=>1}

```

See [String#scan](https://ruby-doc.org/core-2.7.0/String.html#method-i-scan), [Enumerable#tally](https://ruby-doc.org/core-2.7.0/Enumerable.html#method-i-tally) and [Hash#select](https://ruby-doc.org/core-2.7.0/Hash.html#method-i-select).

`Set` lookups are very fast, specifically the execution of the statement

```
DICTIONARY.include?(word)

```