A corpus may be known as a collection of documents. A corpora is the collection of multiple corpus.
Let's see the following code, which will generate a data
directory inside the home
directory:
>>> import nltk >>> import os,os.path >>> create = os.path.expanduser('~/nltkdoc') >>> if not os.path.exists(create): os.mkdir(create) >>> os.path.exists(create) True >>> import nltk.data >>> create in nltk.data.path True
This code will create a data directory named ~/nltkdoc
inside the home
directory. The last line of this code will return True
and will ensure that the data
directory has been created. If the last line of the code returns False
, then it means that the data
directory has not been created and we need to create it manually. After creating the data
directory manually, we can test the last line and it will then return True
. Within this directory, we can create another directory named nltkcorpora...