#!/usr/bin/python
# -*- coding: utf-8 -*-

from nlp_service import Service, create_service_option_parser
from wosedon import wosedon_plugin
from shutil import copyfile


class Wsd2Service(Service):
	
	model = None

	def __init__(self, *args, **kwargs):
		super(Wsd2Service, self).__init__(*args, **kwargs)
		pass

	def init_process(self):
		Wsd2Service.model  = wosedon_plugin.WoSeDonPlugin(
			self.config['wosedon_cfg_file'],
			self.config['wosedon_model_dir'])

	def process(self, inputFile, taskOptions, outputFile):
		Wsd2Service.model.run_wosedon(inputFile, outputFile, "")

if __name__ == '__main__':
	parser = create_service_option_parser()
	args = parser.parse_args()
	config_path = args.config_path
	logfile_path = args.log_file
	logging_lvl = args.logging_lvl
	run_as_daemon = args.daemon

	service = Wsd2Service(config_path, logfile_path, logging_lvl, run_as_daemon)
	service.run()
