Information Technology Reference
In-Depth Information
Fig. 4 A searching tree with keyword { circle, clique, color, flow, forest }
3.3 Keyword Searching and Location in Documents
3.3.1 Algorithm
Let
be the set of selected keywords. A keyword
searching tree T was constructed in Algorithm 3.2.1 ready for use. Let
Θ ( T ) be the set of leaves of the rooted tree T . For the sake of conve-
nience, each leaf of T is denoted by its corresponding keyword. That is,
Θ ( T )=
K
=
{
K 1 , K 2 ,
···
, K m }
K
{
K 1 , K 2 ,
···
, K m }
.
Input. A text document D i
=
= d i, 0 ···
d i,t i
where the first and the last
character d i, 0 = d i,t i =
.
Output. The position sets of each keyword in the document. Each keyword
K μ is associated with a set
( K μ )ifandonly
if the keyword K μ appears in the document D i at position p .
Initial Step. j
P
( K μ ) of integers, where: p
∈P
0 (the character d i,j
of the document D i
is currently in
iteration).
v
v 0
P
( K μ )
←∅
,foreach K μ .
w
1: w is the position of current word in the document.
 
Search WWH ::




Custom Search