<commit_before>package org.msgpack.core;

import org.msgpack.core.MessagePack.Code;

/**
 * Created on 2014/05/04.
 */
public enum MessageFormat {

    FIXINT(ValueType.INTEGER),
    FIXMAP(ValueType.MAP),
    FIXARRAY(ValueType.ARRAY),
    FIXSTR(ValueType.STRING),

    NIL(ValueType.NIL),
    UNKNOWN(ValueType.UNKNOWN),
    FALSE(ValueType.BOOLEAN),
    TRUE(ValueType.BOOLEAN),

    BIN8(ValueType.BINARY),
    BIN16(ValueType.BINARY),
    BIN32(ValueType.BINARY),

    EXT8(ValueType.EXTENDED),
    EXT16(ValueType.EXTENDED),
    EXT32(ValueType.EXTENDED),

    FLOAT32(ValueType.FLOAT),
    FLOAT64(ValueType.FLOAT),

    UINT8(ValueType.INTEGER),
    UINT16(ValueType.INTEGER),
    UINT32(ValueType.INTEGER),
    UINT64(ValueType.INTEGER),

    INT8(ValueType.INTEGER),
    INT16(ValueType.INTEGER),
    INT32(ValueType.INTEGER),
    INT64(ValueType.INTEGER),


    FIXEXT1(ValueType.EXTENDED),
    FIXEXT2(ValueType.EXTENDED),
    FIXEXT4(ValueType.EXTENDED),
    FIXEXT8(ValueType.EXTENDED),
    FIXEXT16(ValueType.EXTENDED),

    STR8(ValueType.STRING),
    STR16(ValueType.STRING),
    STR32(ValueType.STRING),

    ARRAY16(ValueType.ARRAY),
    ARRAY32(ValueType.ARRAY),

    MAP16(ValueType.MAP),
    MAP32(ValueType.MAP),

    NEGFIXINT(ValueType.INTEGER)
    ;

    private final ValueType valueType;

    private MessageFormat(ValueType valueType) {
        this.valueType = valueType;
    }

    public ValueType getValueType() {
        return valueType;
    }

    static MessageFormat toMessageFormat(final byte b) {
        if ((b & Code.POSFIXINT_MASK) == 0) { // positive fixint
            return FIXINT;
        }
        if ((b & Code.NEGFIXINT_PREFIX) == Code.NEGFIXINT_PREFIX) { // negative fixint
            return NEGFIXINT;
        }
        if ((b & 0xe0) == Code.FIXSTR_PREFIX) { // fixstr
            return FIXSTR;
        }
        if ((b & 0xf0) == Code.FIXARRAY_PREFIX) { // fixarray
            return FIXARRAY;
        }
        if ((b & 0xf0) == Code.FIXMAP_PREFIX) { // fixmap
            return FIXMAP;
        }
        switch (b & 0xff) {
            case Code.NIL:
                return NIL;
            case Code.FALSE:
                return FALSE;<commit_msg>Create a symbol table for MessageFormat<commit_after>package org.msgpack.core;

import org.msgpack.core.MessagePack.Code;

/**
 * Created on 2014/05/04.
 */
public enum MessageFormat {

    FIXINT(ValueType.INTEGER),
    FIXMAP(ValueType.MAP),
    FIXARRAY(ValueType.ARRAY),
    FIXSTR(ValueType.STRING),

    NIL(ValueType.NIL),
    UNKNOWN(ValueType.UNKNOWN),
    FALSE(ValueType.BOOLEAN),
    TRUE(ValueType.BOOLEAN),

    BIN8(ValueType.BINARY),
    BIN16(ValueType.BINARY),
    BIN32(ValueType.BINARY),

    EXT8(ValueType.EXTENDED),
    EXT16(ValueType.EXTENDED),
    EXT32(ValueType.EXTENDED),

    FLOAT32(ValueType.FLOAT),
    FLOAT64(ValueType.FLOAT),

    UINT8(ValueType.INTEGER),
    UINT16(ValueType.INTEGER),
    UINT32(ValueType.INTEGER),
    UINT64(ValueType.INTEGER),

    INT8(ValueType.INTEGER),
    INT16(ValueType.INTEGER),
    INT32(ValueType.INTEGER),
    INT64(ValueType.INTEGER),


    FIXEXT1(ValueType.EXTENDED),
    FIXEXT2(ValueType.EXTENDED),
    FIXEXT4(ValueType.EXTENDED),
    FIXEXT8(ValueType.EXTENDED),
    FIXEXT16(ValueType.EXTENDED),

    STR8(ValueType.STRING),
    STR16(ValueType.STRING),
    STR32(ValueType.STRING),

    ARRAY16(ValueType.ARRAY),
    ARRAY32(ValueType.ARRAY),

    MAP16(ValueType.MAP),
    MAP32(ValueType.MAP),

    NEGFIXINT(ValueType.INTEGER)
    ;

    private final ValueType valueType;

    private MessageFormat(ValueType valueType) {
        this.valueType = valueType;
    }

    public ValueType getValueType() {
        return valueType;
    }

    private final static MessageFormat[] formatTable = MessageFormat.values();
    private final static byte[] table = new byte[256];

    static {
        for(int b = 0; b < 0xFF; ++b) {
            table[b] = (byte) toMessageFormat((byte) b).ordinal();
        }
    }

    public static MessageFormat lookUp(final byte b) {
        return formatTable[table[b & 0xFF]];
    }


    static MessageFormat toMessageFormat(final byte b) {
        if ((b & Code.POSFIXINT_MASK) == 0) { // positive fixint
            return FIXINT;
        }
        if ((b & Code.NEGFIXINT_PREFIX) == Code.NEGFIXINT_PREFIX) { // negative fixint
            return NEGFIXINT;
        }
        if ((b & 0xe0) == Code.FIXSTR_PREFIX) { // fixstr
            return FIXSTR;
        }
        if ((b & 0xf0) == Code.FIXARRAY_PREFIX) { // fixarray
            return FIXARRAY;
        }
        if ((b & 0xf0) == Code.FIXMAP_PREFIX) { // fixmap
            return FIXMAP;
        }
        switch (b & 0xff) {
            case Code.NIL:
                return NIL;
            case Code.FALSE:
                return FALSE;
{'fraction_non_alphanumeric': 0.11806130903065451, 'fraction_numerical': 0.027340513670256836, 'mean_word_length': 2.4816149963950975, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4668844', 'n_tokens_mistral': 1718, 'n_tokens_neox': 1584, 'n_words': 265}