From ff885e85113e0262cd0d7eebf4e16cda8b0ca7bc Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 8 Jul 2015 12:35:46 +0200 Subject: [PATCH] * Add ParserFactory convenience function --- spacy/syntax/parser.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index e36d10a38..e881fef7d 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -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)