<commit_before>package com.dstsystems.hackathon.autotempo.main;

import com.dstsystems.hackathon.autotempo.models.*;
import com.dstsystems.hackathon.autotempo.service.*;
import com.dstsystems.hackathon.autotempo.tempo.TempoSubmitter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * Created by user on 06/11/2015.
 */
public class AutoTempoApp {

    public static final String DEFAULT_USER_PROFILE_PATH = "/user.profile";

    private static Date generateDateFromString(String dateInString) {
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        Date date = new Date();
        try {
            date = sdf.parse(dateInString);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }

    public static void main(String[] args) {

        //JsonAppointmentService appointmentService = new JsonAppointmentService();
        AppointmentService appointmentService = new AppointmentServiceImpl();
        UserProfileServiceImpl userProfileService = new UserProfileServiceImpl();

        String userProfilePath = "src/test/resources/" + DEFAULT_USER_PROFILE_PATH;

        if (args.length > 0 && args[0] != null) {
            userProfilePath = args[0];
        }

        ExchangeUserProfileModel exchangeUserProfile = userProfileService.getExchangeUserProfile(userProfilePath);
        System.out.println("ExchangeUserProfile loaded");
        TempoUserProfileModel tempoUserProfileModel = userProfileService.getTempoUserProfile(userProfilePath);
        System.out.println("TempoUserProfile loaded");
        Date startDate = generateDateFromString("11/07/2015 00:00:01");
        Date endDate = generateDateFromString("11/07/2015 23:59:59");

        try {
            List<AppointmentModel> appointmentList = appointmentService.downloadExchangeAppointments(exchangeUserProfile, startDate, endDate);
            System.out.println(appointmentList.size() + " Appointments Loaded");
            System.out.println(appointmentList);

            AcceptedAppointmentListFilter acceptedAppointmentListFilter = new AcceptedAppointmentListFilter();
            acceptedAppointmentListFilter.filter(appointmentList);
            System.out.println("Appointment filtered: " + appointmentList.size() + " Appointments remaining");

            ConflictAppointmentListFilter conflictAppointmentListFilter = new ConflictAppointmentListFilter();
            conflictAppointmentListFilter.filter(appointmentList);
            System.out.println("No conflicts found");

            RuleSetLoader ruleSetLoader = new RuleSetLoader();
            RuleSet ruleSet = ruleSetLoader.getRuleSet("src/main/resources/Rules.xml");
            System.out.println("SimpleRule set");

            for (AppointmentModel appointmentModel : appointmentList) {
                WorklogModel worklogModel = new WorklogModel();
                if (new FirstMatchRuleSetProcessor().process(worklogModel, appointmentModel, ruleSet)) {
                    System.out.println(appointmentModel.getSubject() + " matches the rule set");
                    WorklogHelper.populateCommon(worklogModel, appointmentModel);
                    worklogModel.setComment(appointmentModel.getSubject());

                    System.out.println(worklogModel);

                    new TempoSubmitter(tempoUserProfileModel).submitWorklog(worklogModel);
                    System.out.println(worklogModel.getIssueKey() + " has been logged on " + worklogModel.getDate().toString() + " with time = " + worklogModel.getTimeSpent() + ".");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
<commit_msg>Get rulePath from argument if exist<commit_after>package com.dstsystems.hackathon.autotempo.main;

import com.dstsystems.hackathon.autotempo.models.*;
import com.dstsystems.hackathon.autotempo.service.*;
import com.dstsystems.hackathon.autotempo.tempo.TempoSubmitter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * Created by user on 06/11/2015.
 */
public class AutoTempoApp {

    public static final String DEFAULT_USER_PROFILE_PATH = "/user.profile";

    private static Date generateDateFromString(String dateInString) {
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        Date date = new Date();
        try {
            date = sdf.parse(dateInString);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }

    public static void main(String[] args) {

        //JsonAppointmentService appointmentService = new JsonAppointmentService();
        AppointmentService appointmentService = new AppointmentServiceImpl();
        UserProfileServiceImpl userProfileService = new UserProfileServiceImpl();

        String userProfilePath = "src/test/resources/" + DEFAULT_USER_PROFILE_PATH;

        if (args.length > 0 && args[0] != null) {
            userProfilePath = args[0];
        }

        ExchangeUserProfileModel exchangeUserProfile = userProfileService.getExchangeUserProfile(userProfilePath);
        System.out.println("ExchangeUserProfile loaded");
        TempoUserProfileModel tempoUserProfileModel = userProfileService.getTempoUserProfile(userProfilePath);
        System.out.println("TempoUserProfile loaded");
        Date startDate = generateDateFromString("11/07/2015 00:00:01");
        Date endDate = generateDateFromString("11/07/2015 23:59:59");

        try {
            List<AppointmentModel> appointmentList = appointmentService.downloadExchangeAppointments(exchangeUserProfile, startDate, endDate);
            System.out.println(appointmentList.size() + " Appointments Loaded");
            System.out.println(appointmentList);

            AcceptedAppointmentListFilter acceptedAppointmentListFilter = new AcceptedAppointmentListFilter();
            acceptedAppointmentListFilter.filter(appointmentList);
            System.out.println("Appointment filtered: " + appointmentList.size() + " Appointments remaining");

            ConflictAppointmentListFilter conflictAppointmentListFilter = new ConflictAppointmentListFilter();
            conflictAppointmentListFilter.filter(appointmentList);
            System.out.println("No conflicts found");
            
            String rulePath = "src/main/resources/Rules.xml";
            if (args.length > 1 && args[1] != null) {
                rulePath = args[1];
            }

            RuleSetLoader ruleSetLoader = new RuleSetLoader();

            RuleSet ruleSet = ruleSetLoader.getRuleSet(rulePath);
            System.out.println("SimpleRule set");

            for (AppointmentModel appointmentModel : appointmentList) {
                WorklogModel worklogModel = new WorklogModel();
                if (new FirstMatchRuleSetProcessor().process(worklogModel, appointmentModel, ruleSet)) {
                    System.out.println(appointmentModel.getSubject() + " matches the rule set");
                    WorklogHelper.populateCommon(worklogModel, appointmentModel);
                    worklogModel.setComment(appointmentModel.getSubject());

                    System.out.println(worklogModel);

                    new TempoSubmitter(tempoUserProfileModel).submitWorklog(worklogModel);
                    System.out.println(worklogModel.getIssueKey() + " has been logged on " + worklogModel.getDate().toString() + " with time = " + worklogModel.getTimeSpent() + ".");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}

{'fraction_non_alphanumeric': 0.09528714911151172, 'fraction_numerical': 0.010430079835178985, 'mean_word_length': 2.9912641315519015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '983621', 'n_tokens_mistral': 2116, 'n_tokens_neox': 1988, 'n_words': 365}