public static OpeningSection Create(string animal, string separator = ".") { var opening = new SectionStart(animal, separator); var ending = new SectionEnd(animal); return(new OpeningSection(opening, ending)); }
public static Section Create(List <string> animalCollection, AnimalRhyme rhyme, string separator = "!") { var opening = new SectionStart(animalCollection.Last()); var ending = new SectionEnd(animalCollection.First()); var animalReview = new AnimalReviewSection(animalCollection); return(new Section(opening, rhyme, animalReview.GetSentences(), ending, separator)); }
private OpeningSection(SectionStart opening, SectionEnd ending) : base(new List <string> { opening.Value, ending.Value }) { }
private List <string> ComposeSentences(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator) { var openingSetences = ComposeOpening(opening); var composedSentences = ComposeRhyme(rhyme, openingSetences, rhymeSeparator); composedSentences.AddRange(animalReviewSentenceList); composedSentences.Add(ending.Value); return(composedSentences); }
private static List <string> ComposeOpening(SectionStart opening) => new List <string> { opening.Value, };
private Section(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator = "!") { SentenceList = ComposeSentences(opening, rhyme, animalReviewSentenceList, ending, rhymeSeparator); }