Removed mapStr

This commit is contained in:
Em 2017-03-11 16:23:26 -08:00
parent 1bb364a3b5
commit 9c809efc25
2 changed files with 0 additions and 12 deletions

View File

@ -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'

View File

@ -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 \