title: List of index out of range in file handling
body: <p>I am new at making a program for a Natural Language. I am having an error using Chunk Reader. The error that I am getting is list of index out of range. This my written code:</p>
  <pre><code>import nltk
  from nltk.corpus.reader import ConllChunkCorpusReader
  num_string = []
  sen = int(input(&quot;Enter how many lines of text: &quot;)) 
  f = open(&quot;D:/VB/QUIZ NLTK/conll.iob&quot;, &quot;w&quot;)
  for i in range (0,sen):
      element = str(input(str(i + 1) + &quot;. &quot;))
      (num_string.append(element))
  for name in num_string:
      f.write(&quot;%s\n&quot; %(name))
  f = open(&quot;D:/VB/QUIZ NLTK/conll.iob&quot;, &quot;r&quot;)
  conllreader = ConllChunkCorpusReader('D:/VB/QUIZ NLTK/conll.iob', r'.*\.iob', ('NP','VP', 'PP'))
  print (&quot;CONLLREADER CHUNKED WORDS&quot;)
  print(conllreader.chunked_words('D:/VB/QUIZ NLTK/conll.iob'))
  print (&quot;==================================&quot;)
  print (&quot;CONLLREADER CHUNKED SENTS&quot;)
  print(conllreader.chunked_sents('D:/VB/QUIZ NLTK/conll.iob'))
  print (&quot;==================================&quot;)
  print (&quot;CONLLREADER IOB WORDS&quot;)
  print(conllreader.iob_words('D:/VB/QUIZ NLTK/conll.iob'))
  print (&quot;==================================&quot;)
  print (&quot;CONLLREADER IOB SENTS&quot;)
  print(conllreader.iob_words('D:/VB/QUIZ NLTK/conll.iob'))
  print (&quot;==================================&quot;)
  </code></pre>
  <p>So, when I want 10 lines, I should input 10 times but after inputting, I am having an error that says list of index out of range and obviously, the conllreader is not working and that's where the error started. I am also using a file handling.</p>
  <p>conll.iob file:</p>
  <p>Mr. NNP B-NP</p>
  <p>Meador NNP I-NP</p>
  <p>had VBD B-VP</p>
  <p>been VBN I-VP</p>
  <p>executive JJ B-NP</p>
  <p>vice NN I-NP</p>
  <p>president NN I-NP</p>
  <p>of IN B-PP</p>
  <p>Balcor NNP B-NP</p>
  <p>. . O</p>
  <p>(NOTE: There is no space between the text, I just made a space so it will be clearer).
  The file text is my sample. So in my input for lines is 10. And again, I am having an error about having list index out of range.</p>