<commit_before>﻿using System;
using System.Collections.Generic;

namespace GeneratorAPI {
    /// <summary>
    /// </summary>
    /// <typeparam name="TProvider"></typeparam>
    public class Generator<TProvider> {
        private readonly TProvider _provider;

        public Generator(TProvider provider) => _provider = provider;

        private IEnumerable<TResult> InfiniteEnumerable<TResult>(Func<TProvider, TResult> fn) {
            while (true) yield return fn(_provider);
        }

        /// <summary>
        ///     <para>
        ///         Turn Generator into Generation&lt;TResult&gt;
        ///     </para>
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="fn"></param>
        /// <returns></returns>
        public Generation<TResult> Generate<TResult>(Func<TProvider, TResult> fn) => new Generation<TResult>(
            InfiniteEnumerable(fn));
    }

    public static class Generator {
        /// <summary>
        ///     <para>
        ///         Contains methods for creating Generators with various Providers.
        ///     </para>
        /// </summary>
        public static GeneratorFactory Factory { get; } = new GeneratorFactory();
    }

    /// <summary>
    ///     <para>
    ///         Contains methods for creating Generators with various Providers.
    ///     </para>
    /// </summary>
    public class GeneratorFactory {
        /// <summary><commit_msg>Move none generic generator to top of file<commit_after>﻿using System;
using System.Collections.Generic;

namespace GeneratorAPI {
    public static class Generator {
        /// <summary>
        ///     <para>
        ///         Contains methods for creating Generators with various Providers.
        ///     </para>
        /// </summary>
        public static GeneratorFactory Factory { get; } = new GeneratorFactory();
    }

    /// <summary>
    /// </summary>
    /// <typeparam name="TProvider"></typeparam>
    public class Generator<TProvider> {
        private readonly TProvider _provider;

        public Generator(TProvider provider) => _provider = provider;

        private IEnumerable<TResult> InfiniteEnumerable<TResult>(Func<TProvider, TResult> fn) {
            while (true) yield return fn(_provider);
        }

        /// <summary>
        ///     <para>
        ///         Turn Generator into Generation&lt;TResult&gt;
        ///     </para>
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="fn"></param>
        /// <returns></returns>
        public Generation<TResult> Generate<TResult>(Func<TProvider, TResult> fn) => new Generation<TResult>(
            InfiniteEnumerable(fn));
    }


    /// <summary>
    ///     <para>
    ///         Contains methods for creating Generators with various Providers.
    ///     </para>
    /// </summary>
    public class GeneratorFactory {
        /// <summary>
{'fraction_non_alphanumeric': 0.13741496598639455, 'fraction_numerical': 0.0, 'mean_word_length': 1.92636815920398, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 69, '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': '739843', 'n_tokens_mistral': 768, 'n_tokens_neox': 752, 'n_words': 190}