Skip to content

Commit

Permalink
Merge branch 'hotfix-0.1b1'
Browse files Browse the repository at this point in the history
Adding post-compile for nltk heroku support
  • Loading branch information
bbengfort committed Jul 19, 2016
2 parents 393211a + 775d769 commit 3105c80
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bin/install_nltk_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# bin/install_nltk_data
#!/usr/bin/env bash

source $BIN_DIR/utils

echo "-----> Starting nltk data installation"

# Assumes NLTK_DATA environment variable is already set
# $ heroku config:set NLTK_DATA='/app/nltk_data'

# Install the nltk data
# NOTE: The following command installs the wordnet corpora,
# so you may want to change for your specific needs.
# See http://www.nltk.org/data.html
python -m nltk.downloader wordnet
python -m nltk.downloader punkt
python -m nltk.downloader hmm_treebank_pos_tagger
python -m nltk.downloader maxent_treebank_pos_tagger
python -m nltk.downloader maxent_ne_chunker
python -m nltk.downloader stopwords

# If using Textblob, use this instead:
# python -m textblob.download_corpora lite

# Open the NLTK_DATA directory
cd ${NLTK_DATA}

# Delete all of the zip files
find . -name "*.zip" -type f -delete

echo "-----> Finished nltk data installation"
10 changes: 10 additions & 0 deletions bin/post_compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# bin/post_compile
#!/usr/bin/env bash

if [ -f bin/install_nltk_data ]; then
echo "-----> Running install_nltk_data"
chmod +x bin/install_nltk_data
bin/install_nltk_data
fi

echo "-----> Post-compile done"

0 comments on commit 3105c80

Please sign in to comment.