<commit_before>package com.github.otbproject.otbproject.eventlistener;

import com.github.otbproject.otbproject.App;
import com.github.otbproject.otbproject.channels.Channel;
import com.github.otbproject.otbproject.messages.send.MessageOut;
import com.github.otbproject.otbproject.messages.send.MessageSendQueue;
import com.github.otbproject.otbproject.proc.MessageProcessor;
import com.github.otbproject.otbproject.proc.ProcessedMessage;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.events.DisconnectEvent;
import org.pircbotx.hooks.events.JoinEvent;
import org.pircbotx.hooks.events.MessageEvent;
import org.pircbotx.hooks.events.PartEvent;

/**
 * Created by justin on 29/01/2015.
 */
public class IrcListener extends ListenerAdapter {

    @Override
    public void onMessage(MessageEvent event) throws Exception {
        //TODO replace booleans with lookups
        ProcessedMessage processedMessage = MessageProcessor.process(App.bot.channels.get(event.getChannel().getName()).getDatabaseWrapper(),event.getMessage(),event.getChannel().getName(),event.getUser().getNick(),false, false);
            String message = processedMessage.getResponse();
            if (message.isEmpty()) {
                MessageOut messageOut = new MessageOut(message);
                MessageSendQueue.add(event.getChannel().getName(), messageOut);
            }
    }

    @Override
    public void onJoin(JoinEvent event){
        Channel channel = new Channel(event.getChannel().getName());
        channel.join();
        App.bot.channels.put(channel.getName(),channel);
    }

    @Override<commit_msg>Will now send full strings instead of empty ones.<commit_after>package com.github.otbproject.otbproject.eventlistener;

import com.github.otbproject.otbproject.App;
import com.github.otbproject.otbproject.channels.Channel;
import com.github.otbproject.otbproject.messages.send.MessageOut;
import com.github.otbproject.otbproject.messages.send.MessageSendQueue;
import com.github.otbproject.otbproject.proc.MessageProcessor;
import com.github.otbproject.otbproject.proc.ProcessedMessage;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.events.DisconnectEvent;
import org.pircbotx.hooks.events.JoinEvent;
import org.pircbotx.hooks.events.MessageEvent;
import org.pircbotx.hooks.events.PartEvent;

/**
 * Created by justin on 29/01/2015.
 */
public class IrcListener extends ListenerAdapter {

    @Override
    public void onMessage(MessageEvent event) throws Exception {
        //TODO replace booleans with lookups
        ProcessedMessage processedMessage = MessageProcessor.process(App.bot.channels.get(event.getChannel().getName()).getDatabaseWrapper(),event.getMessage(),event.getChannel().getName(),event.getUser().getNick(),false, false);
            String message = processedMessage.getResponse();
            if (!message.isEmpty()) {
                MessageOut messageOut = new MessageOut(message);
                MessageSendQueue.add(event.getChannel().getName(), messageOut);
            }
    }

    @Override
    public void onJoin(JoinEvent event){
        Channel channel = new Channel(event.getChannel().getName());
        channel.join();
        App.bot.channels.put(channel.getName(),channel);
    }

    @Override
{'fraction_non_alphanumeric': 0.11175572519083969, 'fraction_numerical': 0.004885496183206107, 'mean_word_length': 4.150943396226415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2407585', 'n_tokens_mistral': 943, 'n_tokens_neox': 920, 'n_words': 153}