<commit_before>'use strict';

const payloadTypes = [
    require('./payload/message_private'),
    require('./payload/message_group')
];

/**
 *
 */
class Payload {
    /**
     *
     */
    constructor(payload) {
        this.payload = payload;
    }


    /**
     *
     */
    get() {
        return this.normalizer();
    }


    /**
     *
     */
    normalizer() {
        let payload = this.findMatch(this.payload);

        if (null === payload)
            return payload;

        return payload.getMessageModel();
    }


    /**
     *
     */
    findMatch(message) {
        for (let i = 0, len = payloadTypes.length; i < len; i++) {
            let type = new payloadTypes[i](message);

            if (false !== type.isItMe())
                return type;
        }

        return null;
    }

}

module.exports = Payload;<commit_msg>default to blank message set<commit_after>'use strict';


const payloadTypes = [
          require('./payload/payload_private'),
          require('./payload/payload_group')
      ],
      MessageBase = require('./message/message_base');

/**
 *
 */
class Payload {
    /**
     *
     */
    constructor(payload) {
        this.payload = payload;
    }


    /**
     *
     */
    get() {
        return this.normalizer();
    }


    /**
     *
     */
    normalizer() {
        let payload = this.findMatch();

        if (null === payload)
            return new MessageBase();

        return payload.getMessageModel();
    }


    /**
     *
     */
    findMatch() {
        for (let i = 0, len = payloadTypes.length; i < len; i++) {
            let type = new payloadTypes[i](this.payload);

            if (false !== type.isItMe())
                return type;
        }

        return null;
    }

}

module.exports = Payload;
{'fraction_non_alphanumeric': 0.14891243725599554, 'fraction_numerical': 0.0011154489682097045, 'mean_word_length': 1.5161290322580645, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4689151', 'n_tokens_mistral': 542, 'n_tokens_neox': 517, 'n_words': 102}