123456789101112131415161718 |
- import pytest
- import spacy
- from spacy import displacy
- from src.strategies.leaf_strategy import leaf_strategy
- nlp = spacy.load("en_core_web_trf")
- @pytest.mark.parametrize('text, expected', [
- ('Regex for redacted phone numbers with extra info for PlayStation', ['PhoneNumberRegex', 'RedactedPhoneNumberRegex'])
- ])
- def test_leaf_strategy(text, expected):
- doc = nlp(text)
- result = leaf_strategy(doc)
- # assert result == expected
|