From 179b7eb0a7c851f5446c40345314c4bebdc34be8 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 22 Feb 2015 00:32:33 -0500 Subject: [PATCH] * Specify parser transition system in language --- spacy/en/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spacy/en/__init__.py b/spacy/en/__init__.py index 61ce58640..031d1806b 100644 --- a/spacy/en/__init__.py +++ b/spacy/en/__init__.py @@ -6,6 +6,7 @@ from .. import orth from ..vocab import Vocab from ..tokenizer import Tokenizer from ..syntax.parser import GreedyParser +from ..syntax.arc_eager import ArcEager from ..tokens import Tokens from .pos import EnPosTagger from .pos import POS_TAGS @@ -56,6 +57,8 @@ class English(object): is useful if you want to construct a lexicon, which you'll then save for later loading. """ + ParserTransitionSystem = ArcEager + def __init__(self, data_dir=''): if data_dir == '': data_dir = LOCAL_DATA_DIR @@ -87,7 +90,6 @@ class English(object): self._tagger = None self._parser = None - @property def tagger(self): if self._tagger is None: @@ -97,7 +99,8 @@ class English(object): @property def parser(self): if self._parser is None: - self._parser = GreedyParser(path.join(self._data_dir, 'deps')) + self._parser = GreedyParser(path.join(self._data_dir, 'deps'), + self.ParserTransitionSystem) return self._parser def __call__(self, text, tag=True, parse=parse_if_model_present):