<commit_before>/******************************************************************************
 * Copyright (C) 2006-, <NAME>                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// AFilmetrixDotCom
//
// Wrapper class to read text files retreived from https://reflactiveindex.info
//
///////////////////////////////////////////////////////////////////////////////

#include <fstream>
#include <iostream>

#include "TSystem.h"

#include "AFilmetrixDotCom.h"
#include "AOpticsManager.h"

ClassImp(AFilmetrixDotCom);

AFilmetrixDotCom::AFilmetrixDotCom(const char* fname) : ARefractiveIndex() {
  std::ifstream fin;
  fin.open(gSystem->ExpandPathName(fname));

  if (!fin.is_open()) {
    Error("AFilmetrixDotCom", "Cannot open %s", fname);
    return;
  }

  char buf[100];
  fin.getline(buf, 100);

  // Check header with possible UTF-8 BOM and CR
  // clang-format off
  if (strcmp(buf, "\xef\xbb\xbfWavelength(nm)\tn\tk\r") != 0 &&
      strcmp(buf, "\xef\xbb\xbfWavelength(nm)\tn\tk"  ) != 0 &&
      strcmp(buf,             "Wavelength(nm)\tn\tk\r") != 0 &&
      strcmp(buf,             "Wavelength(nm)\tn\tk")   != 0 ) {
    // clang-format on
    Error("AFilmetrixDotCom", "Invalide data format");
    return;
  }

  fRefractiveIndex = std::make_shared<TGraph>();
  fExtinctionCoefficient = std::make_shared<TGraph>();<commit_msg>Fix typo<commit_after>/******************************************************************************
 * Copyright (C) 2006-, <NAME>                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// AFilmetrixDotCom
//
// Wrapper class to read text files retreived from https://reflactiveindex.info
//
///////////////////////////////////////////////////////////////////////////////

#include <fstream>
#include <iostream>

#include "TSystem.h"

#include "AFilmetrixDotCom.h"
#include "AOpticsManager.h"

ClassImp(AFilmetrixDotCom);

AFilmetrixDotCom::AFilmetrixDotCom(const char* fname) : ARefractiveIndex() {
  std::ifstream fin;
  fin.open(gSystem->ExpandPathName(fname));

  if (!fin.is_open()) {
    Error("AFilmetrixDotCom", "Cannot open %s", fname);
    return;
  }

  char buf[100];
  fin.getline(buf, 100);

  // Check header with possible UTF-8 BOM and CR
  // clang-format off
  if (strcmp(buf, "\xef\xbb\xbfWavelength(nm)\tn\tk\r") != 0 &&
      strcmp(buf, "\xef\xbb\xbfWavelength(nm)\tn\tk"  ) != 0 &&
      strcmp(buf,             "Wavelength(nm)\tn\tk\r") != 0 &&
      strcmp(buf,             "Wavelength(nm)\tn\tk")   != 0 ) {
    // clang-format on
    Error("AFilmetrixDotCom", "Invalid data format");
    return;
  }

  fRefractiveIndex = std::make_shared<TGraph>();
  fExtinctionCoefficient = std::make_shared<TGraph>();
{'fraction_non_alphanumeric': 0.32354818123803447, 'fraction_numerical': 0.009572431397574984, 'mean_word_length': 2.0319148936170213, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7625939', 'n_tokens_mistral': 939, 'n_tokens_neox': 882, 'n_words': 166}