public static OpeningSection Create(string animal, string separator = ".")
        {
            var opening = new SectionStart(animal, separator);
            var ending  = new SectionEnd(animal);

            return(new OpeningSection(opening, ending));
        }
Example #2
0
        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
 })
 {
 }
Example #4
0
        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);
        }
Example #5
0
 private Section(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator = "!")
 {
     SentenceList = ComposeSentences(opening, rhyme, animalReviewSentenceList, ending, rhymeSeparator);
 }