Esempio n. 1
0
        public List <ChapterModel> GetChapters(string text, string translation)
        {
            var chapters             = _sourceTextParser.GetChapters2(text);
            var chaptersTranslations = _sourceTextParser.GetChapters2(translation);

            var result = new List <ChapterModel>();

            foreach (var model in chapters)
            {
                var modelTranslation = chaptersTranslations.Single(i => string.Equals(i.Title, model.Title, StringComparison.CurrentCultureIgnoreCase));

                var chapterModel = new ChapterModel {
                    ChapterNo = model.Title
                };
                chapterModel.Sentences = _sentenceParser.GetSentences(model.Text, modelTranslation.Text);

                result.Add(chapterModel);
            }

            return(result);
        }
Esempio n. 2
0
        public void Parse_Title_And_Text()
        {
            var chapters = _sourceTextParser.GetChapters2(ChapterTestData.ChaptersWithText);

            Assert.Equal(14, chapters.Count);
        }