<commit_before>var debug = require('debug')('wol:leaderboard');

/* brings ra1 gameres up to par */
exports.normalize = function(match) {
    (match.players || []).forEach(function(player) {

        /* properties from Iran's RA patch */
        player.cmp = 256;
        if (player.ded) {
            player.cmp = 528;
        } else if (player.rsg) {
            player.cmp = 512;
        } else if (player.con) {
            player.cmp = 2;
        }
    });

    match.settings.plrs = match.players.length;
    delete match.settings.nump;
    debug('ra game, idno: %d normalized!', match.idno);
<commit_msg>use sdfx to determine if player disconnected<commit_after>var debug = require('debug')('wol:leaderboard');

/* brings ra1 gameres up to par */
exports.normalize = function(match) {
    var client = match.client || {};

    (match.players || []).forEach(function(player) {

        /* properties from Iran's RA patch */
        player.cmp = 256;
        if (player.ded) {
            player.cmp = 528;
        } else if (player.rsg) {
            player.cmp = 512;
        } else if (player.con) {
            player.cmp = 2;
        }

        /* property hack from Funky's RA client */
        if (client.nick == player.name && client.sdfx) {
            player.cmp = 2;
        }
    });

    match.settings.plrs = match.players.length;
    delete match.settings.nump;

    debug('ra game, idno: %d normalized!', match.idno);

{'fraction_non_alphanumeric': 0.14315496872828354, 'fraction_numerical': 0.015983321751216122, 'mean_word_length': 2.076923076923077, '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': '4601958', 'n_tokens_mistral': 479, 'n_tokens_neox': 438, 'n_words': 109}