mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
make error messages language independent
This commit is contained in:
parent
5080077097
commit
d65ef41d08
|
@ -74,8 +74,8 @@ cdef class Lexeme:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Word vectors set to length 0. This may be because the "
|
"Word vectors set to length 0. This may be because the "
|
||||||
"data is not installed. If you haven't already, run"
|
"data is not installed. If you haven't already, run"
|
||||||
"\npython -m spacy.en.download all\n"
|
"\npython -m spacy.%s.download all\n"
|
||||||
"to install the data."
|
"to install the data." % self.vocab.lang
|
||||||
)
|
)
|
||||||
|
|
||||||
vector_view = <float[:length,]>self.c.vector
|
vector_view = <float[:length,]>self.c.vector
|
||||||
|
|
|
@ -240,8 +240,8 @@ cdef class Doc:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"noun_chunks requires the dependency parse, which "
|
"noun_chunks requires the dependency parse, which "
|
||||||
"requires data to be installed. If you haven't done so, run: "
|
"requires data to be installed. If you haven't done so, run: "
|
||||||
"\npython -m spacy.en.download all\n"
|
"\npython -m spacy.%s.download all\n"
|
||||||
"to install the data")
|
"to install the data" % self.vocab.lang)
|
||||||
|
|
||||||
yield from self.noun_chunks_iterator
|
yield from self.noun_chunks_iterator
|
||||||
|
|
||||||
|
@ -258,8 +258,8 @@ cdef class Doc:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"sentence boundary detection requires the dependency parse, which "
|
"sentence boundary detection requires the dependency parse, which "
|
||||||
"requires data to be installed. If you haven't done so, run: "
|
"requires data to be installed. If you haven't done so, run: "
|
||||||
"\npython -m spacy.en.download all\n"
|
"\npython -m spacy.%s.download all\n"
|
||||||
"to install the data")
|
"to install the data" % self.vocab.lang)
|
||||||
cdef int i
|
cdef int i
|
||||||
start = 0
|
start = 0
|
||||||
for i in range(1, self.length):
|
for i in range(1, self.length):
|
||||||
|
|
|
@ -163,8 +163,8 @@ cdef class Token:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Word vectors set to length 0. This may be because the "
|
"Word vectors set to length 0. This may be because the "
|
||||||
"data is not installed. If you haven't already, run"
|
"data is not installed. If you haven't already, run"
|
||||||
"\npython -m spacy.en.download all\n"
|
"\npython -m spacy.%s.download all\n"
|
||||||
"to install the data."
|
"to install the data." % self.vocab.lang
|
||||||
)
|
)
|
||||||
vector_view = <float[:length,]>self.c.lex.vector
|
vector_view = <float[:length,]>self.c.lex.vector
|
||||||
return numpy.asarray(vector_view)
|
return numpy.asarray(vector_view)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user