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

            return(new OpeningSection(opening, ending));
        }
示例#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
 })
 {
 }
示例#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);
        }
示例#5
0
 private static List <string> ComposeOpening(SectionStart opening) =>
 new List <string>
 {
     opening.Value,
 };
示例#6
0
 private Section(SectionStart opening, AnimalRhyme rhyme, List <string> animalReviewSentenceList, SectionEnd ending, string rhymeSeparator = "!")
 {
     SentenceList = ComposeSentences(opening, rhyme, animalReviewSentenceList, ending, rhymeSeparator);
 }