Research Article

Text Matching and Categorization: Mining Implicit Semantic Knowledge from Tree-Shape Structures

Algorithm 1

ESemGraph().
Input: text
Output: SemGraph
() scan sentence
() IF sentence is not empty THEN
()  create
() ELSE exist
() FOREACH IN () DO
()  IF = NIL THEN
()  add to
()   Count() = 1
()  ElSE
() IF does not appear in THEN
()  add to
()  add all edges of to
()   Count() = 1
() IF appears in THEN
()   Count() = Count() + 1
() FOREACH two linked nodes IN DO
() IF the Counts of them are equal THEN
()  set the direction of the pointer randomly
() IF the Counts of them are unequal THEN
()  set the direction of the pointer from the node with a bigger Count to the one with a smaller Count