Source code for graphbrain.parsers.__init__

from .nlp import print_tree
from .parser_en import ParserEN

[docs]def create_parser(name, lemmas=False): """Creates and returns a parser (as an instanceof a subclass of Parser) for the language specified in the parameter. Throws exception if language is not implemented. Available parsers: 'en' -- English Keyword argument: lemmas -- if True, lemma edges are generated by the parser. (default: False) """ if name == 'en': return ParserEN(lemmas=lemmas) else: raise RuntimeError('Unknown parser: {}'.format(name))