<commit_before>package talkhouse;
import java.util.List;
import java.util.ArrayList;

public class Segmenter {
  private double[] buf=null;
  int winsz;
  int winshift;

  public Segmenter(int winsz, int winshift) {
    this.winsz = winsz;
    this.winshift = winshift;
  }

  public double[][] apply(double[] data) {
    double[] combo;
    if (buf != null) {
        combo = new double[buf.length + data.length];
        System.arraycopy(buf, 0, combo, 0, buf.length);
        System.arraycopy(data, 0, combo, buf.length, data.length); 
    } else {
        combo = data;
    }
    if (combo.length < winsz + winshift * 5) {
        buf = combo;
        return null;
    } else {
        buf = null;
    }
    double[][] result = new double[(combo.length-winsz)/winshift+1][];
    int i = 0;
    int j=0;
    while (i+winsz <= combo.length) {
      double[] seg = new double[winsz];
      System.arraycopy(combo, i, seg, 0, winsz);
      result[j++] = seg;
      i+=winshift;
    }
    
    int bufsize = combo.length - i;
    if (bufsize > 0) {
        if (buf == null || buf.length != bufsize) {
          buf = new double[bufsize];
        }
        System.arraycopy(combo, combo.length - bufsize, buf, 0, bufsize);
    } else {
        buf = null;
    }
    return result;
  }
};
<commit_msg>Remove unused imports from Segmenter.java<commit_after>package talkhouse;

public class Segmenter {
  private double[] buf=null;
  int winsz;
  int winshift;

  public Segmenter(int winsz, int winshift) {
    this.winsz = winsz;
    this.winshift = winshift;
  }

  public double[][] apply(double[] data) {
    double[] combo;
    if (buf != null) {
        combo = new double[buf.length + data.length];
        System.arraycopy(buf, 0, combo, 0, buf.length);
        System.arraycopy(data, 0, combo, buf.length, data.length); 
    } else {
        combo = data;
    }
    if (combo.length < winsz + winshift * 5) {
        buf = combo;
        return null;
    } else {
        buf = null;
    }
    double[][] result = new double[(combo.length-winsz)/winshift+1][];
    int i = 0;
    int j=0;
    while (i+winsz <= combo.length) {
      double[] seg = new double[winsz];
      System.arraycopy(combo, i, seg, 0, winsz);
      result[j++] = seg;
      i+=winshift;
    }
    
    int bufsize = combo.length - i;
    if (bufsize > 0) {
        if (buf == null || buf.length != bufsize) {
          buf = new double[bufsize];
        }
        System.arraycopy(combo, combo.length - bufsize, buf, 0, bufsize);
    } else {
        buf = null;
    }
    return result;
  }
};

{'fraction_non_alphanumeric': 0.14108045083560047, 'fraction_numerical': 0.00777302759424796, 'mean_word_length': 2.1777777777777776, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '235214', 'n_tokens_mistral': 921, 'n_tokens_neox': 890, 'n_words': 226}