diff --git a/spacy/tests/spans/test_span.py b/spacy/tests/spans/test_span.py index 6e8114ad4..14c176edc 100644 --- a/spacy/tests/spans/test_span.py +++ b/spacy/tests/spans/test_span.py @@ -35,7 +35,6 @@ def test_spans_string_fn(doc): span = doc[0:4] assert len(span) == 4 assert span.text == 'This is a sentence' - assert span.mapStr((lambda x, i, arg="_": x + i + arg), "y", "z") == 'This yzis yza yzsentence yz' assert span.upper_ == 'THIS IS A SENTENCE' assert span.lower_ == 'this is a sentence' diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index 08f8aea62..fc5d26174 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -118,17 +118,6 @@ cdef class Span: return 0.0 return numpy.dot(self.vector, other.vector) / (self.vector_norm * other.vector_norm) - def mapStr(self, fn, *argv, **kargs): - '''Perform a function on the string representation of each token in this span. - - Arguments: - fn (function): First argument will always be string of a token. Additional arguments - will be defined according to *argv and **kargs passed to this mapStr() method. - *argv (unpacked tuple): Arguments to be passed to fn - **kargs (unpacked dict): Arguments to be passed to fn - ''' - return ''.join([fn(t.string, *argv, **kargs) for t in self]).strip() - cpdef int _recalculate_indices(self) except -1: if self.end > self.doc.length \ or self.doc.c[self.start].idx != self.start_char \