mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 13:17:06 +03:00
Tidy up tests
This commit is contained in:
parent
2982f82934
commit
723e27cb8c
|
@ -1,7 +1,6 @@
|
||||||
# coding: utf8
|
# coding: utf8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import pytest
|
|
||||||
from spacy.matcher import Matcher
|
from spacy.matcher import Matcher
|
||||||
from spacy.tokens import Token, Doc
|
from spacy.tokens import Token, Doc
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ def test_issue1971(en_vocab):
|
||||||
def test_issue_1971_2(en_vocab):
|
def test_issue_1971_2(en_vocab):
|
||||||
matcher = Matcher(en_vocab)
|
matcher = Matcher(en_vocab)
|
||||||
pattern1 = [{"ORTH": "EUR", "LOWER": {"IN": ["eur"]}}, {"LIKE_NUM": True}]
|
pattern1 = [{"ORTH": "EUR", "LOWER": {"IN": ["eur"]}}, {"LIKE_NUM": True}]
|
||||||
pattern2 = [{"LIKE_NUM": True}, {"ORTH": "EUR"}] #{"IN": ["EUR"]}}]
|
pattern2 = [{"LIKE_NUM": True}, {"ORTH": "EUR"}] # {"IN": ["EUR"]}}]
|
||||||
doc = Doc(en_vocab, words=["EUR", "10", "is", "10", "EUR"])
|
doc = Doc(en_vocab, words=["EUR", "10", "is", "10", "EUR"])
|
||||||
matcher.add("TEST1", None, pattern1, pattern2)
|
matcher.add("TEST1", None, pattern1, pattern2)
|
||||||
matches = matcher(doc)
|
matches = matcher(doc)
|
||||||
|
@ -59,6 +58,5 @@ def test_issue_1971_4(en_vocab):
|
||||||
pattern = [{"_": {"ext_a": "str_a", "ext_b": "str_b"}}] * 3
|
pattern = [{"_": {"ext_a": "str_a", "ext_b": "str_b"}}] * 3
|
||||||
matcher.add("TEST", None, pattern)
|
matcher.add("TEST", None, pattern)
|
||||||
matches = matcher(doc)
|
matches = matcher(doc)
|
||||||
# Interesting: uncommenting this causes a segmentation fault, so there's
|
# Uncommenting this caused a segmentation fault
|
||||||
# definitely something going on here
|
assert len(matches) == 1
|
||||||
# assert len(matches) == 1
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import pytest
|
|
||||||
import numpy
|
import numpy
|
||||||
from spacy import displacy
|
from spacy import displacy
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import pytest
|
|
||||||
from spacy.lang.en import English
|
from spacy.lang.en import English
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user