<commit_before>(function()
{
    "use strict";

    var R = require('ramda');
    var w = require('./get-word');
    var mail = require('./sendmail');


    // custom R functions
    var r = {};

    // make function that tests if a word contains a character
    r.strContains = R.curry(function(ch, word)
    {
        return R.strIndexOf(ch, word) >= 0;
    });

    // create random function
    r.random = function(n)
    {
        return Math.floor(Math.random() * n);
    };

    // load the words array
    var words = w.getWords();

    // make function to test if a word os a particular length
    var isLengthN = R.curry(function(n, w)
    {
        return w.length === n;
    });

    var isLength3 = isLengthN(3);

    // test for j,k, q & x
    var hasValuableChar = R.anyPredicates([r.strContains('j'), r.strContains('k'), r.strContains('q'), r.strContains('x') ]);

    // want 3-letter words with a valuable character
    var pick = R.and(isLength3, hasValuableChar);

    // get short valuable words
    var w3valuable = R.filter(pick, words);

    // dump all
    // console.log(w3valuable);
    // console.log(w3valuable.length);

    // pick one at random
    var word = w3valuable[r.random(w3valuable.length)];

    console.log(word);

    mail.send('<EMAIL>', '<EMAIL>', 'Word of the day: ' + word);


}());<commit_msg>Mail body cannot be undefined<commit_after>(function()
{
    "use strict";

    var R = require('ramda');
    var w = require('./get-word');
    var mail = require('./sendmail');


    // custom R functions
    var r = {};

    // make function that tests if a word contains a character
    r.strContains = R.curry(function(ch, word)
    {
        return R.strIndexOf(ch, word) >= 0;
    });

    // create random function
    r.random = function(n)
    {
        return Math.floor(Math.random() * n);
    };

    // load the words array
    var words = w.getWords();

    // make function to test if a word os a particular length
    var isLengthN = R.curry(function(n, w)
    {
        return w.length === n;
    });

    var isLength3 = isLengthN(3);

    // test for j,k, q & x
    var hasValuableChar = R.anyPredicates([r.strContains('j'), r.strContains('k'), r.strContains('q'), r.strContains('x') ]);

    // want 3-letter words with a valuable character
    var pick = R.and(isLength3, hasValuableChar);

    // get short valuable words
    var w3valuable = R.filter(pick, words);

    // dump all
    // console.log(w3valuable);
    // console.log(w3valuable.length);

    // pick one at random
    var word = w3valuable[r.random(w3valuable.length)];

    console.log(word);

    mail.send('<EMAIL>', '<EMAIL>', 'Word of the day: ' + word, word);

}());
{'fraction_non_alphanumeric': 0.15427302996670367, 'fraction_numerical': 0.007399186089530152, 'mean_word_length': 2.4533844189016603, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3896828', 'n_tokens_mistral': 906, 'n_tokens_neox': 870, 'n_words': 244}