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

from nlp_service import Service, create_service_option_parser
from fextorbis import process as fextor_process


class FextorService(Service):
	def __init__(self, *args, **kwargs):
		super(FextorService, self).__init__(*args, **kwargs)
		
	def process(self, inputFile, taskOptions, outputFile):
		#print inputFile
		taskOptions['features']+=' tok_count ';
		fextor_process(inputFile,taskOptions,outputFile)
		#print "finihed" + inputFile

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 = FextorService(config_path, logfile_path, logging_lvl, run_as_daemon)
	service.run()
