<commit_before>class SumElementsByFileTypes {
  constructor() {
    this._FileMap = new Map();
  }

  process(element) {
    if (element.isFile()) {
      let type = SumElementsByFileTypes.getFileType(element.getPath());
      let sumByFileType = this._FileMap.get(type);

      if (!sumByFileType) {
        sumByFileType = new SumByFileType(type);
        this._FileMap.set(type, sumByFileType);
      }

      sumByFileType.increment();
      sumByFileType.addSize(element.getSize());
    }
  }

  static getFileType(filename) {
    let tokens = filename.split('.');

    if (tokens.length > 1) {
      return tokens.pop().toLowerCase();
    }

    return '';
  }

  toString() {
    let output = "";

    for (var [key, value] of this._FileMap) {<commit_msg>fix another file pattern to sum by filetype<commit_after>class SumElementsByFileTypes {
  constructor() {
    this._FileMap = new Map();
  }

  process(element) {
    if (element.isFile()) {
      let type = SumElementsByFileTypes.getFileType(element.getPath());
      let sumByFileType = this._FileMap.get(type);

      if (!sumByFileType) {
        sumByFileType = new SumByFileType(type);
        this._FileMap.set(type, sumByFileType);
      }

      sumByFileType.increment();
      sumByFileType.addSize(element.getSize());
    }
  }

  static getFileType(filename) {
    let tokens = filename.split('.');

    if (tokens.length > 1) {
      let extension = tokens.pop();

      if (extension.indexOf('/') === -1) {
        return extension.toLowerCase();
      }
    }

    return '';
  }

  toString() {
    let output = "";

    for (var [key, value] of this._FileMap) {
{'fraction_non_alphanumeric': 0.13893967093235832, 'fraction_numerical': 0.0018281535648994515, 'mean_word_length': 2.7149321266968327, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4797782', 'n_tokens_mistral': 532, 'n_tokens_neox': 500, 'n_words': 101}