make error messages language independent

This commit is contained in:
Wolfgang Seeker 2016-03-24 11:47:09 +01:00
parent 5080077097
commit d65ef41d08
3 changed files with 8 additions and 8 deletions

View File

@ -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 = <float[:length,]>self.c.vector

View File

@ -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):

View File

@ -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 = <float[:length,]>self.c.lex.vector
return numpy.asarray(vector_view)