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}

```
Let's invert your code and loop over elements in `string_array` and check for inclusion in `dict`.

Also using `#each_with_object` to build up the hash, and `Hash.new(0)` creates a hash where the default value for a key is `0`.

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

def substringer(string, dict)
  string_array = string.split(/\W+/)

  final_hash = string_array.each_with_object(Hash.new(0)) do |word, hsh|
    hsh[word] += 1 if dict.include?(word)
  end

  p final_hash
end

```

Testing this:

```
substringer("below, below, how's it goin?", dictionary)
# {"below"=>2, "how"=>1, "it"=>1}

```