* Add ParserFactory convenience function

This commit is contained in:
Matthew Honnibal 2015-07-08 12:35:46 +02:00
parent 4e4fac452b
commit ff885e8511
1 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,10 @@ def get_templates(name):
pf.tree_shape + pf.trigrams)
def ParserFactory(transition_system):
return lambda strings, dir_: Parser(strings, dir_, transition_system)
cdef class Parser:
def __init__(self, StringStore strings, model_dir, transition_system):
assert os.path.exists(model_dir) and os.path.isdir(model_dir)