def get_tagger(name): """ Returns the tagger class for the tagger with the given name. """ from . import TAGGERS if name not in TAGGERS: from .tagger import TaggerLoadError raise TaggerLoadError, "The tagger '%s' does not exist" % name path = 'jazzparser.taggers.%s.%s' % TAGGERS[name] return load_class(path)
def get_formalism(name): """ Returns the Formalism structure for the formalism with the given name. """ from . import FORMALISMS if name not in FORMALISMS: raise FormalismLoadError, "The formalism '%s' does not exist" % name path = 'jazzparser.formalisms.%s.Formalism' % name return load_class(path)
def get_backoff_builder(name): """ Returns the backoff builder class with the given name. """ from . import BUILDERS if name not in BUILDERS: raise BackoffLoadError, "The backoff builder '%s' does not exist" \ % name path = 'jazzparser.backoff.%s.%s' % BUILDERS[name] return load_class(path)
def get_tagger(name): """ Returns the tagger class for the tagger with the given name. """ from . import TAGGERS if name not in TAGGERS: from .tagger import TaggerLoadError raise TaggerLoadError, "The tagger '%s' does not exist" % name path = "jazzparser.taggers.%s.%s" % TAGGERS[name] return load_class(path)
def get_parser(name): from . import PARSERS if name not in PARSERS: raise ParserLoadError, "The parser '%s' does not exist." % name path = 'jazzparser.parsers.%s.Parser' % name return load_class(path)