Using Definition Files

contents of this chapter:

what are definition files for?
definition file example
query file example
output file example
advanced definition files

what are definition files for?

Definition files are an optional convenience for the CorpusSearch user. If you find yourself writing the same long argument list for many different queries, you would probably benefit from having a definition file. A definition file allows you to assign a label to a list of arguments. When you write a query, you can refer to this label instead of writing out the argument list.

definition file example

Here's an example of a definition file written by Ann Taylor. The name of the file is "Ann.def". Definition file names must always end in ".def".

// definition file written by Ann Taylor.

non_finite_verb:  *VB|V*N|*HV|H*N|*DO|D*N|*BE|BEN

finite_verb:  *MD|*HVP|*HVD|*DOP|*DOD|*BEP|*BED|*VBP|*VBD

query file example

Here's an example of a query file, "def.q", that refers to the definition file:

define: Ann.def

query:  (finite_verb precedes non_finite_verb)

The first line, "define: Ann.def", tells CorpusSearch where to find the definitions of "finite_verb" and "non_finite_verb". Without this line, "finite_verb" and "non_finite_verb" will not be replaced by their definitions.

output file example

Here's the preface from an output file resulting from "def.q".

/*
    PREFACE:  regular output file.
    CorpusSearch copyright Beth Randall 2000.
    Date:  Thu Apr 13 08:57:07 EDT 2000

    command file:       def.q
    output file:        def.out

    definition file:  Ann.def
    shorthand:  (finite_verb precedes non_finite_verb)
    node:   IP*
    query:  (*MD|*HVP|*DOP|*DOD|*BEP|*BED|*VBP|*VBD precedes
             *VB|V*N|*HV|H*N|*DO|D*N|*BE|BEN)
*/

Notice that the query appears in two forms: first in the shorthand form found in the command file, and second in its expanded form after the installation of the definitions. The second form of the query is the one that CorpusSearch uses for the search. If you still see your definition labels in the second form of the query, it means that the definitions were not installed. You may have forgotten to put "define: <def.file>" in your command file, or perhaps misspelled the labels.

advanced definition files

Definition files aren't necessarily restricted to argument lists: you can also define queries or parts of queries. This is not recommended for beginners because it's very easy to make mistakes, as described in Search Tips.

Coding
Table of Contents