test_adverbial_strategy.py 675 B

1234567891011121314151617181920212223242526
  1. import json
  2. import pytest
  3. import spacy
  4. from word_processor.generators import Generator
  5. from word_processor.strategies import leaf_strategy, adverbial_strategy
  6. nlp = spacy.load("en_core_web_trf")
  7. @pytest.mark.parametrize('text', [
  8. # 'Regex for redacted phone numbers with extra info for PlayStation',
  9. 'Stick element after scroll has passed the element',
  10. ])
  11. def test_adverbial_strategy(snapshot, text):
  12. generator = Generator(text=text, strategy=adverbial_strategy)
  13. results = generator.suggest()
  14. text_results = []
  15. for suggestion in results:
  16. text_results.append([token.lemma_ for token in suggestion])
  17. assert text_results == snapshot