public Sentence WithEnding(SentenceEnding ending) => new Sentence(clauses, ending);
/// <summary>Initializes a new instance of the Sentence class.</summary> /// <param name="clauses">The sequence of Clause elements which comprise the Sentence.</param> /// <param name="ending"> /// The SentenceEnding which terminates the Sentence. If not provided, a period will be /// assumed, and an instance of SentenceEnding created to represent it. /// </param> public Sentence(IEnumerable <Clause> clauses, SentenceEnding ending) { Clauses = clauses; Ending = ending ?? SentenceEnding.Period; }
/// <summary>Initializes a new instance of the Sentence class.</summary> /// <param name="phrases">The sequence of Phrase elements which comprise the Sentence.</param> /// <param name="ending"> /// The SentenceEnding which demarcates the Sentence. If not provided, a period will be /// assumed, and an instance of SentenceEnding created to represent it. /// </param> public Sentence(IEnumerable <Phrase> phrases, SentenceEnding ending) : this(new [] { new Clause(phrases) }, ending) { }