From f00afe12c4af10d49f64d3bbc32734b94eb09df1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 7 Dec 2014 22:05:57 +1100 Subject: [PATCH] * Load POS tagger in load() function if path exists --- spacy/lang.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/lang.pyx b/spacy/lang.pyx index 0ca5f08d2..d0f5e6944 100644 --- a/spacy/lang.pyx +++ b/spacy/lang.pyx @@ -44,7 +44,8 @@ cdef class Language: def load(self): self.lexicon.load(path.join(util.DATA_DIR, self.name, 'lexemes')) self.lexicon.strings.load(path.join(util.DATA_DIR, self.name, 'strings')) - self.pos_tagger = Tagger(path.join(util.DATA_DIR, self.name, 'pos')) + if path.exists(path.join(util.DATA_DIR, self.name, 'pos')): + self.pos_tagger = Tagger(path.join(util.DATA_DIR, self.name, 'pos')) cpdef Tokens tokens_from_list(self, list strings): cdef int length = sum([len(s) for s in strings])