/// <summary>
        /// Initializes a new instance of the <see cref="TextGenerator" /> class with the specified <see cref="SentenceGenerator" /> and with default values (<see cref="MinSentenceCount" /> = 10, <see cref="MaxSentenceCount" /> = 20, <see cref="LineBreakChance" /> = 0.0f, <see cref="ParagraphChance" /> = 0.1f).
        /// </summary>
        /// <param name="sentenceGenerator">The <see cref="SentenceGenerator" /> to use for sentence generation.</param>
        public TextGenerator(SentenceGenerator sentenceGenerator)
        {
            Check.ArgumentNull(sentenceGenerator, nameof(sentenceGenerator));

            SentenceGenerator = sentenceGenerator;
            MinSentenceCount  = 10;
            MaxSentenceCount  = 20;
            LineBreakChance   = 0;
            ParagraphChance   = .1f;
        }
        /// <summary>
        /// Generates a random sequence of sentences using the specified parameters of this <see cref="TextGenerator" /> instance.
        /// </summary>
        /// <returns>
        /// A new <see cref="string" /> with dynamically generated text.
        /// </returns>
        public string Generate()
        {
            Check.ArgumentNull(SentenceGenerator, nameof(SentenceGenerator));
            Check.ArgumentOutOfRangeEx.GreaterEqual0(MinSentenceCount, nameof(MinSentenceCount));
            Check.ArgumentOutOfRangeEx.GreaterEqual0(MaxSentenceCount, nameof(MaxSentenceCount));
            Check.ArgumentOutOfRangeEx.GreaterEqualValue(MaxSentenceCount, MinSentenceCount, nameof(MaxSentenceCount), nameof(MinSentenceCount));
            Check.ArgumentOutOfRangeEx.Between0And1(LineBreakChance, nameof(LineBreakChance));
            Check.ArgumentOutOfRangeEx.Between0And1(ParagraphChance, nameof(ParagraphChance));

            StringBuilder stringBuilder = new StringBuilder();

            lock (MathEx._Random)
            {
                int sentences = MathEx._Random.Next(MinSentenceCount, MaxSentenceCount + 1);

                for (int i = 0; i < sentences; i++)
                {
                    stringBuilder.Append(SentenceGenerator.Generate());

                    if (MathEx._Random.NextSingle() < ParagraphChance)
                    {
                        stringBuilder.AppendLine().AppendLine();
                    }
                    else if (MathEx._Random.NextSingle() < LineBreakChance)
                    {
                        stringBuilder.AppendLine();
                    }
                    else
                    {
                        stringBuilder.Append(" ");
                    }
                }
            }

            return(stringBuilder.ToString().Trim());
        }