Exemplo n.º 1
0
        private void WriteVerse(CorpusVerse corpusVerse)
        {
            var words = new List <AnalysisWordVM>();

            foreach (var word in corpusVerse.Words)
            {
                var analysisWordParts = word.Parts
                                        .Select(x => new AnalysisWordPartVM(
                                                    root: x.Root,
                                                    type: x.TypeCode,
                                                    form: x.Form,
                                                    description: x.TypeDescription,
                                                    decorators: x.Decorators.Select(d => d.Trim())));
                var analysisWord = new AnalysisWordVM(
                    wordNumber: word.Index,
                    english: word.English,
                    buckwalter: word.Buckwalter,
                    wordParts: analysisWordParts);
                words.Add(analysisWord);
            }
            var verseAnalysis = new VerseAnalysisVM(
                chapterNumber: corpusVerse.Reference.Chapter,
                verseNumber: corpusVerse.Reference.Verse,
                words: words);

            VerseAnalysisWriteRepository.Write(verseAnalysis);
        }
Exemplo n.º 2
0
 public ViewModel(
     Chapter chapter,
     int verseNumber,
     VerseAnalysisVM verseAnalysis,
     SelectChapterAndVerse selectChapterAndVerse)
 {
     Chapter               = chapter;
     VerseNumber           = verseNumber;
     VerseAnalysis         = verseAnalysis ?? throw new ArgumentNullException(nameof(verseAnalysis));
     SelectChapterAndVerse = selectChapterAndVerse;
 }