def __init__(self, config): # parse config file parser = SafeConfigParser() parser.read(config) self.Aligner_object = Aligner_IBM1(parser) self.Extractor_object = Extractor_Moses(parser) self.Annotator_object = Annotator_onlinecache(parser) self.logger = logging.getLogger('translation_log.updater')
elif aligner_type == "onlineGIZA": Aligner_object = Aligner_onlineGIZA(parser) elif aligner_type == "Constrained_Search": Aligner_object = Aligner_Constrained_Search(parser) if not decoder_type == "Moses": logging.info("This alignment tool requires Moses as decoder") sys.exit(1) elif aligner_type == "Dummy": Aligner_object = Aligner_Dummy(parser) else: logging.info("This alignment tool is UNKNOWN") sys.exit(1) if extractor_type == "Moses": Extractor_object = Extractor_Moses(parser) elif extractor_type == "Constrained_Search": Extractor_object = Extractor_Constrained_Search(parser) elif extractor_type == "Dummy": Extractor_object = Extractor_Dummy(parser) else: logging.info("This extractor tool is UNKNOWN") sys.exit(1) if annotator_type == "onlinexml": Annotator_object = Annotator_onlinexml(parser) elif annotator_type == "onlinecache": Annotator_object = Annotator_onlinecache(parser) else: logging.info("This annotation tool is UNKNOWN:") sys.exit(1)