<commit_before>package clarity.parser;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import clarity.match.Match;

import com.google.protobuf.GeneratedMessage;

public class Peek {

    private static final Logger log = LoggerFactory.getLogger(Peek.class);
    
    private final int id;
    private int tick;
    private final int peekTick;
    private final boolean full;
    private final GeneratedMessage message;

    public Peek(int id, int tick, int peekTick, boolean full, GeneratedMessage message) {
        this.id = id;
        this.tick = tick;
        this.peekTick = peekTick;
        this.full = full;
        this.message = message;
    }
    
    public int getId() {
        return id;
    }

    public int getTick() {
        return tick;
    }

    public int getPeekTick() {
        return peekTick;
    }
    
    public boolean isFull() {
        return full;
    }
    
    public GeneratedMessage getMessage() {
        return message;
    }

    public void applySkew(int skew) {
        tick -= skew;
    }
    
    public void apply(Match match) {
        match.setTick(tick);
        trace();
        HandlerRegistry.apply(tick, message, match);
    }
    
    public void trace() {
        log.trace("id: {}, peekTick: {}, tick: {}, full: {}, mesageType: {}", id, peekTick, tick, full, message.getDescriptorForType().getName());
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Peek [tick=");
        builder.append(tick);
        builder.append(", type=");
        builder.append(message.getDescriptorForType().getName());
        builder.append(", size=");
        builder.append(message.getSerializedSize());
        builder.append("]");
        return builder.toString();
    }<commit_msg>fix typo<commit_after>package clarity.parser;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import clarity.match.Match;

import com.google.protobuf.GeneratedMessage;

public class Peek {

    private static final Logger log = LoggerFactory.getLogger(Peek.class);
    
    private final int id;
    private int tick;
    private final int peekTick;
    private final boolean full;
    private final GeneratedMessage message;

    public Peek(int id, int tick, int peekTick, boolean full, GeneratedMessage message) {
        this.id = id;
        this.tick = tick;
        this.peekTick = peekTick;
        this.full = full;
        this.message = message;
    }
    
    public int getId() {
        return id;
    }

    public int getTick() {
        return tick;
    }

    public int getPeekTick() {
        return peekTick;
    }
    
    public boolean isFull() {
        return full;
    }
    
    public GeneratedMessage getMessage() {
        return message;
    }

    public void applySkew(int skew) {
        tick -= skew;
    }
    
    public void apply(Match match) {
        match.setTick(tick);
        trace();
        HandlerRegistry.apply(tick, message, match);
    }
    
    public void trace() {
        log.trace("id: {}, peekTick: {}, tick: {}, full: {}, messageType: {}", id, peekTick, tick, full, message.getDescriptorForType().getName());
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Peek [tick=");
        builder.append(tick);
        builder.append(", type=");
        builder.append(message.getDescriptorForType().getName());
        builder.append(", size=");
        builder.append(message.getSerializedSize());
        builder.append("]");
        return builder.toString();
    }
{'fraction_non_alphanumeric': 0.11411245865490628, 'fraction_numerical': 0.0011025358324145535, 'mean_word_length': 2.3601851851851854, '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': '3732827', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1014, 'n_words': 265}