<commit_before>﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using RazorEngine;
using RazorEngine.Templating;

namespace Baker.View
{
    /// <summary>
    /// Default view engine implementation.
    /// </summary>
    public class RazorViewEngine: IViewEngine
    {
        const string LayoutPattern = @"@\{Layout=""([_a-zA-Z\/\.\%0-9].*)"";\}";
        const string IncludePattern = @"@Include\(""([_a-zA-Z\/\.\%0-9].*)""\)";
        const string InputPattern = @"@Input\(""([_a-zA-Z\/\.\%0-9]*)""\)";

        /// <summary>
        /// Resolves the template content.
        /// </summary>
        private readonly ConcurrentDictionary<string, string> Cache =
            new ConcurrentDictionary<string, string>();

        /// <summary>
        /// Gets or adds a view from the cache.
        /// </summary>
        /// <param name="input">The input asset.</param>
        /// <param name="valueFactory">A function that produces the value that should be added to the cache in case it does not already exist.</param><commit_msg>added '-' handling as well, should be most of the characters now<commit_after>﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using RazorEngine;
using RazorEngine.Templating;

namespace Baker.View
{
    /// <summary>
    /// Default view engine implementation.
    /// </summary>
    public class RazorViewEngine: IViewEngine
    {
        const string LayoutPattern = @"@\{Layout=""([_a-zA-Z\/\-\.\%0-9].*)"";\}";
        const string IncludePattern = @"@Include\(""([_a-zA-Z\/\-\.\%0-9].*)""\)";
        const string InputPattern = @"@Input\(""([_a-zA-Z\/\-\.\%0-9]*)""\)";

        /// <summary>
        /// Resolves the template content.
        /// </summary>
        private readonly ConcurrentDictionary<string, string> Cache =
            new ConcurrentDictionary<string, string>();

        /// <summary>
        /// Gets or adds a view from the cache.
        /// </summary>
        /// <param name="input">The input asset.</param>
        /// <param name="valueFactory">A function that produces the value that should be added to the cache in case it does not already exist.</param>
{'fraction_non_alphanumeric': 0.16496529195590037, 'fraction_numerical': 0.004899959167006942, 'mean_word_length': 2.6296296296296298, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '1671628', 'n_tokens_mistral': 716, 'n_tokens_neox': 695, 'n_words': 195}