2016-03-26 13:44:53 +03:00
|
|
|
from .util import set_lang_class, get_lang_class, get_package, get_package_by_name
|
2016-01-15 20:01:02 +03:00
|
|
|
|
2016-04-12 17:31:16 +03:00
|
|
|
from . import en
|
|
|
|
from . import de
|
2016-01-15 20:01:02 +03:00
|
|
|
|
2016-03-24 13:19:43 +03:00
|
|
|
|
2016-04-12 17:31:16 +03:00
|
|
|
set_lang_class(en.English.lang, en.English)
|
|
|
|
set_lang_class(de.German.lang, de.German)
|
2016-03-25 20:54:45 +03:00
|
|
|
|
|
|
|
|
2016-04-17 22:31:50 +03:00
|
|
|
def load(name, vocab=None, tokenizer=None, parser=None, tagger=None, entity=None,
|
|
|
|
matcher=None, serializer=None, vectors=None, via=None):
|
2016-03-26 13:44:53 +03:00
|
|
|
package = get_package_by_name(name, via=via)
|
|
|
|
vectors_package = get_package_by_name(vectors, via=via)
|
|
|
|
cls = get_lang_class(name)
|
2016-04-17 22:31:50 +03:00
|
|
|
return cls(
|
|
|
|
package=package,
|
|
|
|
vectors_package=vectors_package,
|
|
|
|
vocab=vocab,
|
|
|
|
tokenizer=tokenizer,
|
|
|
|
tagger=tagger,
|
|
|
|
parser=parser,
|
|
|
|
entity=entity,
|
|
|
|
matcher=matcher,
|
|
|
|
serializer=serializer)
|