* Clean up unnecessary try/except block

This commit is contained in:
Matthew Honnibal 2015-10-08 14:34:11 +11:00
parent 4513bed175
commit b3a70e6375

View File

@ -31,10 +31,7 @@ cdef class Morphology:
cdef int assign_tag(self, TokenC* token, tag) except -1:
cdef int tag_id
if isinstance(tag, basestring):
try:
tag_id = self.reverse_index[self.strings[tag]]
except KeyError:
raise
tag_id = self.reverse_index[self.strings[tag]]
else:
tag_id = tag
analysis = <MorphAnalysisC*>self._cache.get(tag_id, token.lex.orth)