From d65ef41d08194bbdda3934a2570d6895645da8af Mon Sep 17 00:00:00 2001 From: Wolfgang Seeker Date: Thu, 24 Mar 2016 11:47:09 +0100 Subject: [PATCH] make error messages language independent --- spacy/lexeme.pyx | 4 ++-- spacy/tokens/doc.pyx | 8 ++++---- spacy/tokens/token.pyx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spacy/lexeme.pyx b/spacy/lexeme.pyx index 4e0f2cf2e..bae1eab39 100644 --- a/spacy/lexeme.pyx +++ b/spacy/lexeme.pyx @@ -74,8 +74,8 @@ cdef class Lexeme: raise ValueError( "Word vectors set to length 0. This may be because the " "data is not installed. If you haven't already, run" - "\npython -m spacy.en.download all\n" - "to install the data." + "\npython -m spacy.%s.download all\n" + "to install the data." % self.vocab.lang ) vector_view = self.c.vector diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index faed51e23..f46c1fe5e 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -240,8 +240,8 @@ cdef class Doc: raise ValueError( "noun_chunks requires the dependency parse, which " "requires data to be installed. If you haven't done so, run: " - "\npython -m spacy.en.download all\n" - "to install the data") + "\npython -m spacy.%s.download all\n" + "to install the data" % self.vocab.lang) yield from self.noun_chunks_iterator @@ -258,8 +258,8 @@ cdef class Doc: raise ValueError( "sentence boundary detection requires the dependency parse, which " "requires data to be installed. If you haven't done so, run: " - "\npython -m spacy.en.download all\n" - "to install the data") + "\npython -m spacy.%s.download all\n" + "to install the data" % self.vocab.lang) cdef int i start = 0 for i in range(1, self.length): diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 68ce2ffb5..52d6f05e7 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -163,8 +163,8 @@ cdef class Token: raise ValueError( "Word vectors set to length 0. This may be because the " "data is not installed. If you haven't already, run" - "\npython -m spacy.en.download all\n" - "to install the data." + "\npython -m spacy.%s.download all\n" + "to install the data." % self.vocab.lang ) vector_view = self.c.lex.vector return numpy.asarray(vector_view)