diff --git a/bin/steps/nltk b/bin/steps/nltk index 92f3fff7884feb00cc3010669b241db6dcae068b..b2ded51249840e55f2978e1bda6fe1113d09a6ed 100755 --- a/bin/steps/nltk +++ b/bin/steps/nltk @@ -21,10 +21,10 @@ if sp-grep -s nltk; then if [ -f "$nltk_packages_definition" ]; then - nltk_packages=$(tr "\n" " " < "$nltk_packages_definition") - puts-step "Downloading NLTK packages: $nltk_packages" + readarray -t nltk_packages < "$nltk_packages_definition" + puts-step "Downloading NLTK packages: ${nltk_packages[*]}" - python -m nltk.downloader -d "$BUILD_DIR/.heroku/python/nltk_data" "$nltk_packages" | indent + python -m nltk.downloader -d "$BUILD_DIR/.heroku/python/nltk_data" "${nltk_packages[@]}" | indent set_env NLTK_DATA "/app/.heroku/python/nltk_data" else @@ -32,4 +32,3 @@ if sp-grep -s nltk; then puts-warn "Learn more: https://devcenter.heroku.com/articles/python-nltk" fi fi - diff --git a/test/fixtures/nltk/nltk.txt b/test/fixtures/nltk/nltk.txt index c4f6bba89dc5bb908437d12b8b0727ae4e6ca5c1..1e578bfa6942f7d8c09f2b6381e9e954a8b4eb7e 100644 --- a/test/fixtures/nltk/nltk.txt +++ b/test/fixtures/nltk/nltk.txt @@ -1 +1,2 @@ -wordnet \ No newline at end of file +city_database +stopwords diff --git a/test/run b/test/run index 130b0e7bf5241d047474879d4cfa39af7a64ed2e..3064ef91c643e9a45a6eef8916aa9656c0480d27 100755 --- a/test/run +++ b/test/run @@ -24,7 +24,7 @@ testGEOS() { testNLTK() { compile "nltk" - assertCaptured "wordnet" + assertCaptured "Downloading NLTK packages: city_database stopwords" assertCapturedSuccess }