<commit_before>namespace Nancy.ViewEngines
{
    using System;
    using System.Linq;
    using System.Reflection;
    using System.Resources;

    public class DefaultTextResource : ITextResource
    {
        private readonly Assembly culturedAssembly;

        public DefaultTextResource()
        {
            var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            culturedAssembly = assemblies.FirstOrDefault(x => x.GetManifestResourceNames().Any(y => y.Contains("Text.")));
        }

        public string this[string key, NancyContext context]
        {
            get
            {
                var manager = new ResourceManager(culturedAssembly.GetName().Name + ".Resources.Text", culturedAssembly);
                return manager.GetString(key, context.Culture);
            }
        }
    }
}<commit_msg>Made ResourceManager private readonly to prevent creating a new instance every time<commit_after>namespace Nancy.ViewEngines
{
    using System;
    using System.Linq;
    using System.Reflection;
    using System.Resources;

    public class DefaultTextResource : ITextResource
    {
        private readonly Assembly culturedAssembly;
        private readonly ResourceManager resourceManager;

        public DefaultTextResource()
        {
            var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            culturedAssembly = assemblies.FirstOrDefault(x => x.GetManifestResourceNames().Any(y => y.Contains("Text.")));

            resourceManager = new ResourceManager(culturedAssembly.GetName().Name + ".Resources.Text", culturedAssembly);
        }

        public string this[string key, NancyContext context]
        {
            get
            {

                return resourceManager.GetString(key, context.Culture);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08070550507749866, 'fraction_numerical': 0.0, 'mean_word_length': 2.1728813559322036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2880395', 'n_tokens_mistral': 463, 'n_tokens_neox': 425, 'n_words': 100}