In this chapter, I'll use the vector form of this sentence:
This sentence was first described in Handling Input Sentences. Here it is in vector form:
In general, search functions take the following as their input:
where the sentence vector is the current input sentence in vector form, the x_List is the first list of arguments in vector form, and the y_List is the second list of arguments in vector form.
For example, if this is the search-function call:
then these items will be passed to the search function "iDominates" (immediately dominates):
The output of a search function is a "result vector", as described below.
If a searched-for structure is found in an input sentence, the result vector records which nodes of the sentence make up the structure. Every node is a sub-vector of the sentence, either a phrase-node with this form:
[index, label]
for instance, [1, IP-MAT], or a word-node with this form:
[index, label, text]
for instance, [9, ADV, dayly].
If an example of the searched-for structure is discovered in the input sentence, the structure is recorded in a vector of this form:
Of course, there may be multiple instances of the searched-for structure in the input sentence. Every instance is represented by a structure-vector which is one sub-vector of the result vector.
For example: I'll run this query
on the above sentence. This is the result vector:
The result vector is ready to be input to the AND function or to various printing functions.
It is beyond the scope of this thesis to describe the algorithm of every search function. In general, however, the search functions traverse the sentence vector using the traverse algorithm outlined in "Handling Input Sentences." On the way, they look for sub-vectors whose first element is a node boundary, as described in the "node: " line of the command file. Searches for linguistic structures are then conducted within this sub-vector, which represents a sub-tree whose root is the node boundary. When an entire structure is found, the information representing it is added to the results vector.