We use WordListCorpusReader to read a corpus, that was created in the last program. We import that Reader as WLCR.
We have to give the list of the files as the second parameter of WLCR.
The LazyCorpusLoader, and not WordListCorpusReader, is the main Reader used for corpus loading, and which we will go over that later.
from __future__ import print_function
from nltk.data import path
from nltk.corpus.reader import WordListCorpusReader as WLCR
path = path + '/MyTestCorpus'
fileids = ['Test1','Test2']
reader = WLCR(path, fileids)
word1 = reader.words(fileids)
word2 = reader.words(fileids)
# words1 =
# [u'One', u'Two', u'Five']
# words2 =
# [u'Three', u'Four', u'Seven']