<commit_before>const EventEmitter = require('events').EventEmitter
const clone = require('clone')
const utils = require('./utils')

function Splitter (configuration) {
  if (!utils.config.validate(configuration)) {
    throw new Error('Invalid configuration')
  }

  // Private
  const config = clone(configuration)
  const logger = utils.logger.init(clone(config.bunyan))

  // Public
  this.events = new EventEmitter()
  this.getConfiguration = () => clone(config)
  this.getLogger = () => logger
  this.start = () => {
    this.events.emit('application_start')

    // redefine, fire once, and destroy
    this.start = () => {
      logger.error('This splitter instance already started!')
    }
  }
}

exports = module.exports = Splitter
exports.isConfigurationValid = (configuration) => utils.config.validate(configuration)
<commit_msg>Change start function<commit_after>const EventEmitter = require('events').EventEmitter
const clone = require('clone')
const utils = require('./utils')

function Splitter (configuration) {
  if (!utils.config.validate(configuration)) {
    throw new Error('Invalid configuration')
  }

  // Private
  const config = clone(configuration)
  const logger = utils.logger.init(clone(config.bunyan))
  const started = () => logger.error('Already started')

  // Public
  this.events = new EventEmitter()
  this.getConfiguration = () => clone(config)
  this.getLogger = () => logger
  this.start = () => {
    this.events.emit('application_start')

    // redefine, fire once, and destroy
    this.start = started
  }
}

exports = module.exports = Splitter
exports.isConfigurationValid = (configuration) => utils.config.validate(configuration)

{'fraction_non_alphanumeric': 0.13723150357995226, 'fraction_numerical': 0.0, 'mean_word_length': 4.208074534161491, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1405054', 'n_tokens_mistral': 469, 'n_tokens_neox': 469, 'n_words': 106}