Skip to content

Commit 5c244be

Browse files
committed
Download extra nltk resource.
1 parent 9ee6521 commit 5c244be

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

tests/unitary/with_extras/ads_string/test_ads_string.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ def setup_class(self):
4848
"averaged_perceptron_tagger",
4949
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
5050
)
51+
nltk.download(
52+
"averaged_perceptron_tagger_eng",
53+
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
54+
)
55+
nltk.download(
56+
"punkt_tab",
57+
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
58+
)
5159

5260
def test_basic_string_methods(self):
5361
s = ADSString("HELLO WORLD")
@@ -62,10 +70,6 @@ def test_basic_string_methods(self):
6270
assert s3 == s and isinstance(s3, ADSString)
6371

6472
def test_nlp_methods(self):
65-
import nltk
66-
67-
nltk.download("punkt_tab")
68-
6973
ADSString.nlp_backend("nltk")
7074
s = ADSString("Walking my dog on a breezy day is the best way to recharge.")
7175
assert list(s.adjective) == ["breezy", "best"]

tests/unitary/with_extras/feature_types/test_feature_types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ def setup_class(self):
4545
"averaged_perceptron_tagger",
4646
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
4747
)
48+
nltk.download(
49+
"averaged_perceptron_tagger_eng",
50+
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
51+
)
52+
nltk.download(
53+
"punkt_tab",
54+
download_dir=os.environ["CONDA_PREFIX"] + "/nltk",
55+
)
4856

4957
def test_datatime_type(self):
5058
assert (

0 commit comments

Comments
 (0)