mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
Update adding languages workflow to reflect changes in __init__.py
This commit is contained in:
parent
4efd6fb9d6
commit
de5062711b
|
@ -63,14 +63,16 @@ p
|
|||
tag_map = TAG_MAP
|
||||
stop_words = STOP_WORDS
|
||||
|
||||
p Additionally, the new #[code Language] class needs to be registered in #[+src(gh("spaCy", "spacy/__init__.py")) spacy/__init__.py] using the #[code set_lang_class()] function, so that you can use #[code spacy.load()].
|
||||
p
|
||||
| Additionally, the new #[code Language] class needs to be added to the
|
||||
| list of available languages in #[+src(gh("spaCy", "spacy/__init__.py")) __init__.py].
|
||||
| The languages are then registered using the #[code set_lang_class()] function.
|
||||
|
||||
+code("spacy/__init__.py").
|
||||
from . import en
|
||||
from . import xx
|
||||
|
||||
set_lang_class(en.English.lang, en.English)
|
||||
set_lang_class(xx.Xxxxx.lang, xx.Xxxxx)
|
||||
_languages = (en.English, ..., xx.Xxxxx)
|
||||
|
||||
p You'll also need to list the new package in #[+src(gh("spaCy", "spacy/setup.py")) setup.py]:
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user