def simple_conll_corpus_iterator(corpus_file):
 l = corpus_file.readline()
 while l:
  line = l.strip()
  if line:
   fields = line.split(' ')
   ne_tag = fields[(-1)]
   word = ' '.join(fields[:(-1)])
   (yield (word, ne_tag))
  else:
   (yield (None, None))
  l = corpus_file.readline()

def simple_conll_corpus_iterator ( corpus_file ) : l = corpus_file . readline ( ) while l : line = l . strip ( ) if line : fields = line . split ( ' ' ) ne_tag = fields [ ( - 1 ) ] word = ' ' . join ( fields [ : ( - 1 ) ] ) ( yield ( word , ne_tag ) ) else : ( yield ( None , None ) ) l = corpus_file . readline ( )
get an iterator object over the corpus file .