mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 21:50:35 +03:00
* Add ParserFactory convenience function
This commit is contained in:
parent
4e4fac452b
commit
ff885e8511
|
@ -63,6 +63,10 @@ def get_templates(name):
|
||||||
pf.tree_shape + pf.trigrams)
|
pf.tree_shape + pf.trigrams)
|
||||||
|
|
||||||
|
|
||||||
|
def ParserFactory(transition_system):
|
||||||
|
return lambda strings, dir_: Parser(strings, dir_, transition_system)
|
||||||
|
|
||||||
|
|
||||||
cdef class Parser:
|
cdef class Parser:
|
||||||
def __init__(self, StringStore strings, model_dir, transition_system):
|
def __init__(self, StringStore strings, model_dir, transition_system):
|
||||||
assert os.path.exists(model_dir) and os.path.isdir(model_dir)
|
assert os.path.exists(model_dir) and os.path.isdir(model_dir)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user