Esempio n. 1
0
        internal BibleClient(VerseLocator verseLocator, IDictionary <string, string> bookMappings)
        {
            var pattern = verseLocator.GetPattern();

            this.verseRegex   = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
            this.bookMappings = bookMappings;
        }
Esempio n. 2
0
        public static BibleClient Create(string culture, IRepository repository)
        {
            var books          = repository.GetBibleBooksAsync(culture).Result;
            var bookDictionary = books.ToDictionary(book => book.Order, book => book.Name);
            var bookMappings   = repository.GetBibleBooksAsync("en-US").Result.OrderBy(book => book.Order)
                                 .ToDictionary(book => bookDictionary[book.Order], book => book.Name);
            var verseLocator = VerseLocator.Create(books);

            return(new BibleClient(verseLocator, bookMappings));
        }
        public async Task <string> GetPattern(string culture)
        {
            var verseLocator = VerseLocator.Create(await repository.GetBibleBooksAsync(culture));

            return(verseLocator.GetPattern());
        }