mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 09:29:59 -04:00
minor fixes, removed sortable verse list, as it wasn't useful yet. finished json full text conversion.
This commit is contained in:
parent
e31ac3a4ac
commit
1af5989ac1
Binary file not shown.
@ -24,5 +24,6 @@ namespace DynamicBibleUtility
|
||||
{
|
||||
public string txt = "";
|
||||
public string str = "";
|
||||
public int i = -1;
|
||||
}
|
||||
}
|
||||
|
@ -274,129 +274,67 @@ namespace DynamicBibleUtility
|
||||
{
|
||||
Book bk = new Book();
|
||||
bk.bk = el.FirstAttribute.Value.ToString();
|
||||
foreach (XElement chn in el.Descendants())
|
||||
foreach (XElement chn in el.Nodes())
|
||||
{
|
||||
Chapter ch = new Chapter();
|
||||
ch.ch = chn.FirstAttribute.Value;
|
||||
foreach (XElement vs in chn.Nodes())
|
||||
{
|
||||
Verse v = new Verse();
|
||||
v.vs = vs.FirstAttribute.Value;
|
||||
int i = 0;
|
||||
foreach (object o in vs.Nodes())
|
||||
{
|
||||
Text t = new Text();
|
||||
if (o.GetType() == typeof(XElement))
|
||||
{
|
||||
t.txt = ((XElement)o).Value;
|
||||
if (((XElement)o).Name == "gr")
|
||||
{
|
||||
if (Convert.ToInt32(bk.bk) >= 40)
|
||||
{
|
||||
t.str = "G" + ((XElement)o).FirstAttribute.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
t.str = "H" + ((XElement)o).FirstAttribute.Value;
|
||||
}
|
||||
}
|
||||
else if ((((XElement)o).Name.ToString().ToLower() == "style"))
|
||||
{
|
||||
// do nothing, because we don't care about style right now.
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Unknown Element");
|
||||
}
|
||||
t.i = i++;
|
||||
}
|
||||
else if (o.GetType() == typeof(XText))
|
||||
{
|
||||
t.txt = ((XText)o).Value;
|
||||
t.i = i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Unknown Element");
|
||||
}
|
||||
v.words.Add(t);
|
||||
}
|
||||
ch.vss.Add(v);
|
||||
}
|
||||
bk.chs.Add(ch);
|
||||
|
||||
System.IO.File.WriteAllText(bk.bk.ToString() + "-"+ch.ch+".json", Serialize(ch));
|
||||
}
|
||||
bbl.Add(bk);
|
||||
|
||||
UpdateStatus("Book: " + bk.bk + "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
// finished.
|
||||
|
||||
// to index, you need to iterate through every word in the bible.
|
||||
/*
|
||||
foreach (DynamicBible.Schemas.XMLBIBLE_BOOK bk in b.BIBLEBOOKS)
|
||||
{
|
||||
Book book = new Book();
|
||||
book.bk = bk.bnumber.ToString();
|
||||
foreach (DynamicBible.Schemas.XMLBIBLE_CHAPTER ch in bk.CHAPTERS)
|
||||
{
|
||||
Chapter chapter = new Chapter();
|
||||
chapter.ch = ch.cnumber.ToString();
|
||||
foreach (DynamicBible.Schemas.XMLBIBLE_VERSES vs in ch.VERSES)
|
||||
{
|
||||
Verse verse = new Verse();
|
||||
verse.vs = vs.vnumber.ToString();
|
||||
if (vs.Items != null)
|
||||
{
|
||||
foreach (object w in vs.Items)
|
||||
{
|
||||
// for each word, add an entry.
|
||||
if (w.GetType() == typeof(DynamicBible.Schemas.XMLBIBLE_GR))
|
||||
{
|
||||
DynamicBible.Schemas.XMLBIBLE_GR gr = ((DynamicBible.Schemas.XMLBIBLE_GR)w);
|
||||
if (gr.Text != null)
|
||||
{
|
||||
foreach (string t in gr.Text)
|
||||
{
|
||||
foreach (string s in t.Split(' '))
|
||||
{
|
||||
AddWordToIndex(s, bk.bnumber.ToString(), ch.cnumber.ToString(), vs.vnumber.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (w.GetType() == typeof(DynamicBible.Schemas.XMLBIBLE_STYLE_ITEM))
|
||||
{
|
||||
DynamicBible.Schemas.XMLBIBLE_STYLE_ITEM o = ((DynamicBible.Schemas.XMLBIBLE_STYLE_ITEM)w);
|
||||
if (o.Text != null)
|
||||
{
|
||||
foreach (string t in o.Text)
|
||||
{
|
||||
foreach (string s in t.Split(' '))
|
||||
{
|
||||
AddWordToIndex(s, bk.bnumber.ToString(), ch.cnumber.ToString(), vs.vnumber.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.gr != null)
|
||||
{
|
||||
DynamicBible.Schemas.XMLBIBLE_STYLE_GR gr = o.gr;
|
||||
if (gr.Text != null)
|
||||
{
|
||||
foreach (string t in gr.Text)
|
||||
{
|
||||
foreach (string s in t.Split(' '))
|
||||
{
|
||||
AddWordToIndex(s, bk.bnumber.ToString(), ch.cnumber.ToString(), vs.vnumber.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (o.STYLE != null)
|
||||
{
|
||||
foreach (DynamicBible.Schemas.XMLBIBLE_STYLE_STYLE so in o.STYLE)
|
||||
{
|
||||
if (so.Text != null)
|
||||
{
|
||||
foreach (string t in so.Text)
|
||||
{
|
||||
foreach (string s in t.Split(' '))
|
||||
{
|
||||
AddWordToIndex(s, bk.bnumber.ToString(), ch.cnumber.ToString(), vs.vnumber.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (so.gr != null)
|
||||
{
|
||||
DynamicBible.Schemas.XMLBIBLE_STYLE_STYLE_GR gr = so.gr;
|
||||
if (gr.Value != null)
|
||||
{
|
||||
foreach (string s in gr.Value.Split(' '))
|
||||
{
|
||||
AddWordToIndex(s, bk.bnumber.ToString(), ch.cnumber.ToString(), vs.vnumber.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (vs.Text != null)
|
||||
{
|
||||
foreach (string w in vs.Text)
|
||||
{
|
||||
foreach (string s in w.Split(' '))
|
||||
{
|
||||
if (s != null && s.Trim() != "")
|
||||
{
|
||||
verse.words.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
chapter.vss.Add(verse);
|
||||
}
|
||||
|
||||
book.chs.Add(chapter);
|
||||
}
|
||||
bbl.Add(book);
|
||||
UpdateStatus("Book: " + bk.bnumber + ", Word Count: " + _words.Count + "\r\n");
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,9 +127,7 @@ function Search(sv)
|
||||
}
|
||||
|
||||
}
|
||||
$( "#result" ).sortable();
|
||||
$( "#result" ).disableSelection();
|
||||
|
||||
$( "#result" ).sortable({ axis: "x", handle: ".handle" });
|
||||
}
|
||||
catch (err)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user