Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-09-07 19:48:42 +0300
committerJohn Bauer <horatio@gmail.com>2022-09-07 19:51:55 +0300
commitef617803b2cd5c124393e1468c6ad0e367c4fdc7 (patch)
treeb446ae385edf7f8e9b5b2c240344be5ac604b017
parentcdf18d8b19c92b0cfbbf987e82b0080ea7b4db32 (diff)
Add a test of small cache size in the multilingual pipeline
-rw-r--r--stanza/tests/langid/test_multilingual.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/stanza/tests/langid/test_multilingual.py b/stanza/tests/langid/test_multilingual.py
index 4ef93d07..29e5c442 100644
--- a/stanza/tests/langid/test_multilingual.py
+++ b/stanza/tests/langid/test_multilingual.py
@@ -10,10 +10,7 @@ from stanza.tests import TEST_MODELS_DIR
pytestmark = [pytest.mark.pipeline, pytest.mark.travis]
-def test_multilingual_pipeline():
- """
- Basic test of multilingual pipeline
- """
+def run_multilingual_pipeline(**kwargs):
english_text = "This is an English sentence."
english_deps_gold = "\n".join((
"('This', 5, 'nsubj')",
@@ -34,7 +31,7 @@ def test_multilingual_pipeline():
"('.', 4, 'punct')"
))
- nlp = MultilingualPipeline(model_dir=TEST_MODELS_DIR)
+ nlp = MultilingualPipeline(model_dir=TEST_MODELS_DIR, **kwargs)
docs = [english_text, french_text]
docs = nlp(docs)
@@ -43,3 +40,15 @@ def test_multilingual_pipeline():
assert docs[1].lang == "fr"
assert docs[1].sentences[0].dependencies_string() == french_deps_gold
+
+def test_multilingual_pipeline():
+ """
+ Basic test of multilingual pipeline
+ """
+ run_multilingual_pipeline()
+
+def test_multilingual_pipeline_small_cache():
+ """
+ Test with the cache size 1
+ """
+ run_multilingual_pipeline(max_cache_size=1)