示例#1
0
def build_parser(options):
    parser_option = options.parser if len(PARSERS) > 1 else "camxes-ilmen"
    if parser_option == 'camxes-ilmen':
        from parsers import camxes_ilmen
        return camxes_ilmen.Parser(options.rule)
    else:
        bad_parser()
示例#2
0
文件: test.py 项目: denjiry/camxes-py
def process_input(input_json):
    input_specs = input_json["specs"]
    parser = camxes_ilmen.Parser()
    json_transformer = camxes_json.Transformer()
    morph_transformer = camxes_morphology.Transformer()
    return [
        process_spec(spec, parser, json_transformer, morph_transformer) \
            for spec in input_specs
    ]
示例#3
0
def process_input(input_json):
    input_specs = input_json["specs"]
    parser = camxes_ilmen.Parser()
    transformer = node_coverage.Transformer(parser)
    for spec in input_specs:
        if spec["out"] != "ERROR":
            parsed = parser.parse(spec["txt"])
            transformer.visit(parsed)
    return transformer.visits()
示例#4
0
 def __init__(self, client):
     super(Dispatcher, self).__init__(client)
     self.parser = camxes_ilmen.Parser('vlatai')
     self.transformer = vlatai.Transformer()