c369dea462f62b61a586c69953d99daea454a3e3,src/textacy/spacier/core.py,,_make_spacy_doc_from_doc,#Any#Any#,203
Before Change
elif isinstance(lang, spacy.language.Language):
// just want to make sure that doc and lang share the same vocabulary
if doc.vocab is not lang.vocab:
raise ValueError(
"`spacy.vocab.Vocab` used to process document ("{}") "
"must be the same as that used by the `lang` pipeline ("{}")".format(
doc.vocab, lang.vocab
)
)
elif callable(lang) is False:
// there"s nothing to be done with a callable lang, since we already have
// the doc, and checking the text lang is an unnecessary performance hit
raise TypeError(
After Change
elif callable(lang) is False:
// there"s nothing to be done with a callable lang, since we already have
// the doc, and checking the text lang is an unnecessary performance hit
raise TypeError(
errors.type_invalid_msg(
"lang", type(lang), Union[str, Callable[[str], str], Language]
)
)
return doc
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: chartbeat-labs/textacy
Commit Name: c369dea462f62b61a586c69953d99daea454a3e3
Time: 2020-08-16
Author: burtdewilde@gmail.com
File Name: src/textacy/spacier/core.py
Class Name:
Method Name: _make_spacy_doc_from_doc
Project Name: chartbeat-labs/textacy
Commit Name: 75a7321a8f1e096d8fdd118fd85b4259f3ff25dc
Time: 2020-08-16
Author: burtdewilde@gmail.com
File Name: src/textacy/io/spacy.py
Class Name:
Method Name: read_spacy_docs
Project Name: chartbeat-labs/textacy
Commit Name: c369dea462f62b61a586c69953d99daea454a3e3
Time: 2020-08-16
Author: burtdewilde@gmail.com
File Name: src/textacy/spacier/doc_extensions.py
Class Name:
Method Name: to_terms_list