diff --git a/spacy/tests/regression/test_issue3869.py b/spacy/tests/regression/test_issue3869.py index d76da6989..42584b133 100644 --- a/spacy/tests/regression/test_issue3869.py +++ b/spacy/tests/regression/test_issue3869.py @@ -20,8 +20,6 @@ from spacy.lang.en import English def test_issue3869(sentence): """Test that the Doc's count_by function works consistently""" nlp = English() - - print() doc = nlp(sentence) count = 0 diff --git a/spacy/tokens/doc.pxd b/spacy/tokens/doc.pxd index 4b8578fe0..62665fcc5 100644 --- a/spacy/tokens/doc.pxd +++ b/spacy/tokens/doc.pxd @@ -7,7 +7,6 @@ from ..typedefs cimport attr_t from ..attrs cimport attr_id_t - cdef attr_t get_token_attr(const TokenC* token, attr_id_t feat_name) nogil diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index 3b0c2425c..c1883f9c0 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -14,7 +14,6 @@ from collections import Counter import numpy import numpy.linalg import struct -from libc.stdint cimport int64_t import srsly from thinc.neural.util import get_array_module, copy_array @@ -712,7 +711,6 @@ cdef class Doc: cdef int i cdef attr_t attr cdef size_t count - cdef int64_t this_value if counts is None: counts = Counter() @@ -722,13 +720,11 @@ cdef class Doc: # Take this check out of the loop, for a bit of extra speed if exclude is None: for i in range(self.length): - this_value = get_token_attr(&self.c[i], attr_id) - counts[this_value] += 1 + counts[get_token_attr(&self.c[i], attr_id)] += 1 else: for i in range(self.length): if not exclude(self[i]): - attr = get_token_attr(&self.c[i], attr_id) - counts[attr] += 1 + counts[get_token_attr(&self.c[i], attr_id)] += 1 if output_dict: return dict(counts)