Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
I need to convert the bible text to XML Balanced Tree Index.
First you have to convert each lines to XML.
example:
XML
<line>1 text on the first line</line>
<line>2 text on the 2nd line</line>
<line>3 text on the 3rd line</line>
<line>4 text on the 4th line</line>
<line>5 text on the 5th line</line>
<line>6 text on the 6th line</line>
<line>7 text on the 7th line</line>

for the whole bible text,
Then you have create index XML
should look like "aaron"
XML
<first text "a"></>
<second text "a"></>
<third text "r"></>
<word text ="aaron"></>
<line number> 122</> // these are the line which contain the word aaron when yo search the word "aaron"
<line number> 132</> // these are the line which contain the word aaron
<line number> 3222</> // these are the line which contain the word aaron

"the bible txt"
http://www.2shared.c...V1611Bible.html
"Exclude word when you search"
http://www.2shared.c...x9/exclude.html


The code i created is not complete!!!!
Any One Knows how to do it!!!!
Posted
Updated 10-Feb-13 1:03am
v3
Comments
TRK3 7-Feb-13 18:52pm    
What is the original problem you are trying to solve?

Indexing the whole text for every word in the text and then writing that index out in XML is going to create an index file that may be as large as the original text and might even take longer to search.

Why XML?

What problem are you having trouble with? Building the index? Or writing it out in XML? If you are trying to do both at the same time you are doing it wrong.
sumanthan 8-Feb-13 12:21pm    
Is there any way Can you create the code,
bible text you can search on Google for ""AV1611Bible""
exclude text are
the
and
of
to
that
in
he
shall
for
unto
i
his
a
they
be
is
not
him
them
it
with
all
thou
was
thy
which
my
me
but
their
said
ye
have
will
thee
from
as
are
when
this
were
out
by
you
up
there
then
had
into
on
one
her
we
s
your
also
so
an
if
at
us
no
do
now
therefore
every
these
our
or
because
after
o
may
did
what
over
who
she
any
among
thereof
neither
am
should
whom
nor
thus
yet
set
more
about
how
himself
than
other
ever
would
without
where
under
both
been
until
yea
wherefore
toward
well
only
such
very
between
above
yourselves
cannot
within
whosoever
could
about
above
the
and
of
to
that
in
he
for
unto
i
his
a
they
be
is
not
him
them
it
with
all
thou
was
thy
which
my
me
but
their
said
ye
have
thee
from
as
are
when
this
were
out
by
you
up
there
then
had
into
on
one
her
we
also
your
so
day
an
if
shalt
at
let
go
us
do
these
or
our
say
hast
o
did
what
who
any
put
am
two
should
know
whom
nor
thus
yet
done
saw
how
than
off
art
three
other
those
would
first
where
both
been
yea
wherefore
five
four
whose
being
much
why
only
such
very
though
ten
can
therein
known
while
doth
thyself
six
cannot
third
twelve
second
could
new
knew
wherein
till
here
lo
able
throughout
find
forty
fifty
thence
must
get
ask
lot
wherewith
ought
threescore
tenth
ones
plain
whereof
el
Andreas Gieriet 10-Feb-13 5:26am    
1) please use the "reply" button on the top right of a comment to reply to that comment.
2) Answer the questions of those who try to help - ignoring that leads to no help. Sorry.
3) Learn to ask proper questions that allows to understand what you need. This quesiton and your comments do not help at all - confusing.
4) Do not use repeated punctuation(!!!) - this is childish.
5) This is not a forum of mercy - if you cry for gimme code - forget it. No one will do your work. We help if you need help in fixing problems of your work.

So, finally: what did you do so far and where exactly do you get stuck?

Andi
Joezer BH 10-Feb-13 6:54am    
What seems to be the problem?
Your question and\or problem is unclear

1 solution

You may implement something as shown below.

Pseudo Code:
C#
ignored = CreateHashTableOfIgnoredWords();
xref = CreateEmptyCrossReference();
foreach(line in ReadAllLines("document file name"))
{
   foreach (word in line)
   {
      xref.AddXref(word, line.Number) if (!ignored.Contains(word));
   }
}
xref.Serialize("index file name");
...
CrossReference.AddXref(key, ref)
{
    xrefEntry = GetEntry(key) or CreateAndAddNewXrefEntry(key);
    xrefEntry.Add(ref);
}

Cheers
Andi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900