From b3a70e63754210b13086cd488970d2f2d57d0092 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 8 Oct 2015 14:34:11 +1100 Subject: [PATCH] * Clean up unnecessary try/except block --- spacy/morphology.pyx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index ddeca62d7..1a499aa0a 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -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 = self._cache.get(tag_id, token.lex.orth)