Beispiel #1
0
 public KJBibleBookDef(string bookName, string abbreviation1, string abbreviation2, TestamentType testamentType)
 {
     this.bookName      = bookName;
     this.abbreviation1 = abbreviation1;
     this.abbreviation2 = abbreviation2;
     this.testamentType = testamentType;
 }
Beispiel #2
0
        public KJBibleCollection GetVerses(string words, TestamentType testament, int limit = 30)
        {
            var col = new KJBibleCollection();

            string[] split    = words.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToArray();
            string   sentence = string.Join(" ", split).Trim();

            if (string.IsNullOrWhiteSpace(sentence))
            {
                return(col);
            }
            foreach (var data in KJBibleHelper.GetBibleDataInfo())
            {
                if (split.All(i => data.Value.StringContains(i, StringComparison.OrdinalIgnoreCase)))
                {
                    var item = CreateBibleItem(data);
                    if (testament.HasFlag(item.Book.Testament))
                    {
                        if (col.Count <= limit)
                        {
                            col.Add(item);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }
            return(col);
        }