<commit_before>'use strict';

// defaultOpts -> configured in generator config
function init(templateProcessors, templates, defaultOpts, helpers) {
  function processTemplate(templateName, templateVariables, opts) {
    if (templates.has(templateName)) {
      const templateObject = templates.get(templateName);
      for (const [processorName, processor] of templateProcessors.entries()) {
        const extIndex = processor.extensions.indexOf(templateObject.ext);
        if (extIndex !== -1) {
          const mergedOptions = Object.assign(
            { filenameWithPath: `${process.cwd()}/${defaultOpts.path}/${templateName}${templateObject.ext}` },
            defaultOpts.global,
            defaultOpts[processorName],
            opts
          );
          return processor.process(templateObject.template, mergedOptions, templateVariables, helpers);
        }
      }
      throw new Error(`No template processor found for extension:
${templateObject.ext}. Given extension ${templateObject.ext}`);
    } else {
      throw Error(`Template: "${templateName}" does not exist`);
    }
  }

  // Offer direct access to individual processors
  for (const [name, fn] of templateProcessors.entries()) {
    processTemplate[name] = fn.process;<commit_msg>Change error message<commit_after>'use strict';

// defaultOpts -> configured in generator config
function init(templateProcessors, templates, defaultOpts, helpers) {
  function processTemplate(templateName, templateVariables, opts) {
    if (templates.has(templateName)) {
      const templateObject = templates.get(templateName);
      for (const [processorName, processor] of templateProcessors.entries()) {
        const extIndex = processor.extensions.indexOf(templateObject.ext);
        if (extIndex !== -1) {
          const mergedOptions = Object.assign(
            { filenameWithPath: `${process.cwd()}/${defaultOpts.path}/${templateName}${templateObject.ext}` },
            defaultOpts.global,
            defaultOpts[processorName],
            opts
          );
          return processor.process(templateObject.template, mergedOptions, templateVariables, helpers);
        }
      }
      throw new Error(`No template processor found for extension: ${templateObject.ext}.`);
    } else {
      throw Error(`Template: "${templateName}" does not exist`);
    }
  }

  // Offer direct access to individual processors
  for (const [name, fn] of templateProcessors.entries()) {
    processTemplate[name] = fn.process;
{'fraction_non_alphanumeric': 0.1158021712907117, 'fraction_numerical': 0.0008041817450743868, 'mean_word_length': 3.3725834797891037, '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': '5704341', 'n_tokens_mistral': 616, 'n_tokens_neox': 626, 'n_words': 156}