def nltk_download_corpus(resource_path):
 from nltk.data import find
 from nltk import download
 from os.path import split
 (_, corpus_name) = split(resource_path)
 if (not resource_path.endswith('/')):
  resource_path = (resource_path + '/')
 downloaded = False
 try:
  find(resource_path)
 except LookupError:
  download(corpus_name)
  downloaded = True
 return downloaded

def nltk_download_corpus ( resource_path ) : from nltk . data import find from nltk import download from os . path import split ( _ , corpus_name ) = split ( resource_path ) if ( not resource_path . endswith ( '/' ) ) : resource_path = ( resource_path + '/' ) downloaded = False try : find ( resource_path ) except LookupError : download ( corpus_name ) downloaded = True return downloaded
download the specified nltk corpus file unless it has already been downloaded .