Database queries consist of patterns which match either individual segments, sequences of segments or parts of the hierarchical description of an utterance. The result of a query is a segment list which contains the labels and start and end times of each segment or sequence of segments which matched the query, along with the utterances to which they belong.
Queries can relate to any level of the hierarchy defined by the template file (see the chapter on Template Files). The type of segments returned depends on the form of the query.
There are two basic kinds of query: simple queries (see the section on simple queries) which relate to single segments, and compound queries (see the section on compound queries) which relate to either sequences of segments or to segments at different levels in the hierarchy.
Simple queries relate to a single segment, for example to find segments labelled p at the Phonetic level:
Segment labels can be quoted if they contain special characters, for example:
The following functions can also be used:
Start(Word,Phoneme)=1 Matches the first Phoneme in a Word
Mid(Word,Phoneme)=1 Matches any Phoneme which is neither the first nor last in a Word.
End(Word,Phoneme)=1 Matches the last Phoneme in a Word
Num(Word,Syllable)=1 Matches Words with only one Syllable.
Position(Word,Phoneme)>2 Matches the third and subsequent Phonemes in a Word.
These can be combined with & to further qualify the target segment. For example, to find content Words with Nuclear Accent:
Word=C & Accent=Nuclear
Note, however, that Word and Accent labels are at the same level. For labels at different levels you need to use a compound query (see the section called Compound Queries).