title: Reading doc with nested dictionary inside array and returning value
body: <p>This is my .txt file</p>
  <pre><code>{'word1': {'doc1': 2}}
  {'word2': {'doc2': 5}}
  {'word3': {'doc3': 4}}
  {'word4': {'doc4': 2}}
  {'word5': {'doc5': 1}}
  </code></pre>
  <p>The .txt file means: { word : {doc in which word appears : position on that doc} }</p>
  <p>What I want to do is to read the text file and give me the position of a specific word on that doc.
  An example of what I was trying to do:</p>
  <pre><code>def search(word, doc):
      with open('extras/file.txt', 'r') as fp:
          for line in fp:
              if word and doc in line:
                 print(word, &quot;|&quot;, doc, &quot;|&quot;, line)
      
  search(&quot;word2&quot;, &quot;doc2&quot;)
  </code></pre>
  <p>In this example I want the retrieve the &quot;5&quot;, but I don't know on how to access the position.
  Any tips?</p>