ensure_nltk

ensure_nltk(resource: str = 'stopwords') tuple[Path, bool][source]

Ensure NLTK data is downloaded in a standard way.

Parameters:

resource – Name of the resource to download, e.g., stopwords

Returns:

A pair of the NLTK cache directory and a boolean that says if download was successful

This function also appends the standard PyStow location for NLTK data to the nltk.data.path list so any downstream users of NLTK will know how to find it automatically.