|
@@ -1,11 +1,9 @@
|
|
-import json
|
|
|
|
-
|
|
|
|
import pytest
|
|
import pytest
|
|
|
|
|
|
import spacy
|
|
import spacy
|
|
|
|
+from word_processor.strategies.leaf_no_preps_strategy import leaf_no_prep_strategy
|
|
|
|
|
|
from word_processor.generators import Generator
|
|
from word_processor.generators import Generator
|
|
-from word_processor.strategies import leaf_strategy
|
|
|
|
|
|
|
|
nlp = spacy.load("en_core_web_trf")
|
|
nlp = spacy.load("en_core_web_trf")
|
|
|
|
|
|
@@ -14,8 +12,8 @@ nlp = spacy.load("en_core_web_trf")
|
|
('Regex for redacted phone numbers with extra info for PlayStation',
|
|
('Regex for redacted phone numbers with extra info for PlayStation',
|
|
['PhoneNumberRegex', 'RedactedPhoneNumberRegex'])
|
|
['PhoneNumberRegex', 'RedactedPhoneNumberRegex'])
|
|
])
|
|
])
|
|
-def test_leaf_strategy(snapshot, text, expected):
|
|
|
|
- generator = Generator(text=text, strategy=leaf_strategy)
|
|
|
|
|
|
+def test_leaf_no_prep_strategy(snapshot, text, expected):
|
|
|
|
+ generator = Generator(text=text, strategy=leaf_no_prep_strategy)
|
|
|
|
|
|
results = generator.suggest()
|
|
results = generator.suggest()
|
|
|
|
|