<commit_before>var request = require('request'),
    readline = require('readline');

exports.configure = function (campfire) {

    return  {
        open: function (roomId) {
            var messageBuffer = "",
                sendingTimeoutId,
                rl = readline.createInterface({
                    input: process.stdin,
                    output: process.stdout,
                    terminal: true
                });

            process.stdin.on('keypress', function (ch, key) {
                if (key && key.ctrl && key.name == 'c') {
                    process.exit();
                }
            });

            return rl.on('line', function (line) {
                function sendMessage() {
                    campfire.postMessage(roomId, {
                        type: messageBuffer.indexOf("\n") > -1 ? "PasteMessage" : "TextMessage",
                        body: messageBuffer
                    });

                    messageBuffer = "";
                }

                if (sendingTimeoutId) {
                    // Building up a paste.
                    clearTimeout(sendingTimeoutId);
                }

                messageBuffer = messageBuffer +
                    (messageBuffer.length > 0 ? "\n" : "") +
                    line;
                
                sendingTimeoutId = setTimeout(function () {
                    sendMessage();
                }, 100);
            });
        }
    };
};

<commit_msg>Added help under F1. Closes #8.<commit_after>var request = require('request'),
    readline = require('readline'),
    colors = require('colors');

exports.configure = function (campfire) {

    function displayHelp() {
        console.log(
                "Ctrl-C".green + " - Exit; " +
                "F1".green + " - Help;");
    }

    return  {
        open: function (roomId) {
            var messageBuffer = "",
                sendingTimeoutId,
                rl = readline.createInterface({
                    input: process.stdin,
                    output: process.stdout,
                    terminal: true
                });

            process.stdin.on('keypress', function (ch, key) {
                if (key) {
                    if (key.ctrl && (key.name === 'c')) {
                        process.exit();
                    }

                    if (key.name === "f1") {
                        displayHelp();
                    }
                }
            });

            return rl.on('line', function (line) {
                function sendMessage() {
                    if (messageBuffer.length > 0) {
                        campfire.postMessage(roomId, {
                            type: messageBuffer.indexOf("\n") > -1 ? "PasteMessage" : "TextMessage",
                            body: messageBuffer
                        });
                    }

                    messageBuffer = "";
                }

                if (sendingTimeoutId) {
                    // Building up a paste.
                    clearTimeout(sendingTimeoutId);
                }

                messageBuffer = messageBuffer +
                    (messageBuffer.length > 0 ? "\n" : "") +
                    line;
                
                sendingTimeoutId = setTimeout(function () {
                    sendMessage();
                }, 100);
            });
        }
    };
};


{'fraction_non_alphanumeric': 0.11179941002949853, 'fraction_numerical': 0.004424778761061947, 'mean_word_length': 0.9772594752186589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '199787', 'n_tokens_mistral': 836, 'n_tokens_neox': 755, 'n_words': 152}