add this bookmarking tool

Using Xaira under Windows

12. Xaira Queries in Detail

12.1. Xaira Queries in Detail

This section of Help explains in more detail the various types of Xaira query.

For an overview of Xaira queries, see here.

For details on how to begin a particular type of query, see here.

For details on the general procedure of running a Xaira query, see here.

For details on what happens if Xaira finds too many solutions to your query, see here.

For details on what happens if Xaira finds no solutions at all to your query, see here.

When your Query has run, the solutions will be displayed in a new Query window. You can manipulate the query display to show the solutions in various ways, including altering the amount of context you can see around each solution. You can also select one solution as the current solution to view and to work with.

For details on the Query menu, which contains commands for manipulating the solutions in a Query window in carious ways, see here.

12.2. Quick query

Enter a word or phrase you wish to search for in the box on the Quick query toolbar and press Return. This is equivalent to carrying out a Phrase query.

When you press RETURN, the query is executed in the same way as any other Xaira query.

The
button opens the keyboard dialog.

Xaira keeps a record of the queries you enter. You can re-run earlier queries by selecting them from the dropdown list below the query box.

12.3. Word Query

When a corpus is indexed in Xaira, a lexicon for that corpus is created. A word query searches this lexicon for you and gives you a list of words in the lexicon that match what you were searching for. You can then run a query to search the corpus for instances of one, several, or all of the words on this list.

To start a word query, select Word Query from the New Query on the File Menu, or press the Word Query button on the toolbar. This will bring up the Word Query dialog box:

At the top of the dialog box is a small text-box window. The first step in a word query is to type a search term here. A search term is the word, or the part of a word, that you wish to search for in the Xaira index.

The
button next to the text box opens the keyboard dialog.

Once you have typed your search term, press the LOOKUP button to search for words in the index that begin with the letters in your search term. In the example below, looking up the search term "the" has produced the following results:

This lookup has found all the words beginning with the letters THE - so not just "the" but also "theatre", "theft", "their" and twenty-one others.

If the Pattern tick box to the right of the window is ticked, whatever you type will be interpreted as a pattern when Xaira looks through the corpus index. All words that match that pattern will be listed in the main part of the dialog box. For example, using the pattern "th.." to look up all four-letter words beginning in TH:

The central area displays information about the words found in the index. The first column shows a list of the words that have been found. The second column gives the frequency (i.e. the number of times that each word occurs in the corpus), and the third column gives the number of forms that exist for that word (see below for more on forms).

You can re-sort the items on the wordlist by clicking on the buttons at the tops of the columns. For example, clicking on the "Frequency" button" will sort the words in the list from the most frequent to the least frequent; clicking on the "Word" button will return them to alphabetical order.

If you want to keep a record of the list of words Xaira found from the lexicon, you can use the SAVE button to save the whole of the word-form list in a text file, in either XML or a delimited listing format.

Alternatively, you can run a search of the corpus for one or more of the words on the list. First, click on one or more of the word forms displayed in the lower window to select them. As usual in Windows programs, clicking on one or more items with the CTRL key held down will select each of them; clicking one and then another with the SHIFT key held down will select both those two and all the items that occur between them in the list.

When you have highlighted one or more words on the list in this manner, press the QUERY button to run a search for the selected word forms: a new Query window will open to show you the solutions of the query.

To close the dialog box without running a query, press the X in the top-right corner of the dialog, or press ESC.

Using Forms in a Word Query

If your corpus contains certain Additional key information relating to parts-of-speech, and if this information has been indexed, it is possible to use this information in a Word Query.

Some words occur with more than one part-of-speech category in different contexts. For instance, in "I can roll my tongue", can is a verb. In "as rusty as an old tin can", can is a noun. If this information has been included in the index, Xaira can count up, and search for, each of these forms separately.

The "Forms" column in the main area of the word query dialog tells you how many forms exist in the index for each word shown. If the index of your corpus does not distinguish between different forms, this will always be 1. However, if there are different forms for a single word, you can see a breakdown of the multiple forms by ticking the "Show Forms" tickbox in the bottom right of the dialog.

The following example shows two words with a number of different forms in a corpus of English. The search term used was the string cut; the lookup produces four results, one of which has 4 forms, and the others 1 form each. Selecting one or more words causes a list of the forms of those words to be displayed separately in the lower half of the display area:

The forms list shows the word-form itself (i.e. the word from the word-list above), and the frequency of each form. The middle column shows the values of the additional key that was used to separate the various instances of cut: in this case the addkey in question was "pos", i.e. a part-of-speech tag. So the display tells us, overall, that the corpus contains 12 instances of cut; 4 have the POS code VVN, 4 have the POS code VVI, and so on.

You can search for one or more particular forms of cut by selecting those forms and pressing QUERY.

If several words are selected in the word-list, then you can search for one or more forms of each word. In the example below, all the forms of both cut and cut-ups that are nouns (NN1 or NN2) - but no other forms of cut - will be retrieved by the search that is about to be initiated:

Note: the Forms display functions slightly differently if a lemmatisation scheme is being used. See below for more on this.

Download control in the Word Query dialog

Ticking the "Show Controls" tick box in the lower right of the Word Query dialog box opens up an extra section of the dialog which contains some advanced options. There are two panels of options: one that allows you to restrict the number of downloads, and another which allows you to classify the words according to a lemmatisation scheme (for information on the latter, see below).

The first panel of options allows you to restrict the number of downloads (i.e. the number of words that are displayed when you press LOOKUP). It looks like this:

You can specify how many downloads you want by picking one of the three radio buttons. To download all the words found in the index, select the first radio button. This is the usual default setting.

To download only the most frequent words in the corpus, choose the second radio button, and enter the number of words you want. So for instance, if you enter 5 here and press LOOKUP, only the five most frequent words in the index that match your search term will be shown here:

You can also choose to download only words whose frequency falls within a specific range, by selecting the third radio button. You specify the range of values you want by choosing an operator from the drop down list, and entering a value in the window. The following operators are available:

<
frequency is less than...
<=
frequency is less than or equal to...
=
frequency is equal to...
>
frequency is greater than...
>=
frequency is greater than or equal to...

For example, to download only word forms that appear 5 times or more, select >= and enter 5; to download only words that appear less than 10 times, select < and enter 10, as in the example below:

Any restrictions to the number of downloads you make in this panel will remain in force for all subsequent word queries, unless you change them (even if the Downloads panel is hidden).

Using Lemmatisation schemes

You can search the lexicon for groups of words linked by their lemmata using the options on the Lemmata panel, as shown below:

The information in the Lemmata panel tells us that the currently active lemmatisation scheme is "null". This is the built-in default which does not group words together at all, but treats each word form as a separate lemma (see here for more information). To change to another lemmatisation scheme, simply select it from the dropdown menu, and press APPLY. This will change the contents of the word list so that the results of the lookup are lemmas rather than words.

Like forms distinguished on the basis of POS codes, lemmatisation is dependent on additional keys, so if your corpus does not possess the appropriate markup, you will only see the "null" lemmatisation scheme here.

The only other lemmatisation option for the corpus of Old English text shown in the example above is called, rather straightforwardly, "lemma". Applying this scheme has the following effect:

As you can see, beonne has disappeared from the list, as it is part of the lemma beon (both are forms of the Old English verb menaing to be). So only beon actually appears.

The Forms column of the display, and the list of forms lower down in the display area, work slightly differently if a lemmatisation scheme other than "null" is applied. Beon is listed as having 112 forms: this means that 112 unique combinations of word form and part of speech are listed under the lemma beon. So for instance:

Among the 112 forms of the lemma beon are eom with POS-code ET, eom with POS-code BT, is with POS-code ET, is with POS-code ET, and so on. (The various usages of the word forms beon and beonne are also on this list, further up.)

If you select a lemmatisation scheme in this panel, it remains in force for all subsequent word queries, until you change it again (even if the Lemmata panel is hidden).

12.4. Phrase query

A phrase query searches your corpus for any single word or for a sequence of words. A phrase query can find any set of words that appear together in the corpus.

To start a phrase query, select Phrase Query from the New Query submenu on the File Menu, or press the Phrase Query button on the toolbar. This will bring up the Phrase Query dialog box:

You can type any sequence of words, or a single word, into the window. You can also use the Anyword wild card character. This is the _ character (underscore). Use _ in a phrase query to match any single word. You should not use this wild card at the start of a phrase query, however.

There is no limit on the number of words a phrase query may contain, but the total length of the phrase you are looking for may not exceed 200 characters.

If a phrase query contains any very common words, the query may take a very long time to execute. Examples might include "to" and "the" in English, "de" and "la" in French, and so on. In such cases it is usually better to replace the very high frequency word with the Anyword character. For example, to find the phrase "die the death", type "die _ death". You can then discard any false positives such as "die a death", using the Thin command.

The "Ignore case" tick box determines the search is case sensitive or not. If the "Ignore case" box is ticked, Xaira will ignore the differences between uppercase and lowercase letters (for instance, between "D" and "d") when searching for your phrase. If the "Ignore case" box is cleared, Xaira will only find phrases that match the exact case of the phrase you have queried. If you have typed "die _ death", for instance, Xaira will ignore "DIE A DEATH" and "Die The Death". For most purposes, it is better to leave this box ticked.

The
button opens the keyboard dialog.

Pressing CANCEL aborts the query. Pressing OK runs the search.

12.5. Addkey query

An Addkey query is used to search for a word or words marked up with particular Additional key information, relating to parts-of-speech, for instance.

To start an Addkey query, select Addkey from the New Query submenu on the File Menu, or press the Addkey Query button on the tool bar. This will bring up the Addkey Query dialog box:

To search for Addkey information, you must first choose what Addkey you want to search on. A list of the Addkeys available in your corpus appears in the lower right-hand side of the dialog box. In the example shown above, only one Addkey is available: POS, which one would anticipate - correctly - to contain a POS code.

You can search either for a particular Addkey value occurring in association with a particular word, or for a particular Addkey value occurring in association with any word.

To look for an Addkey value associated with a particular word, enter the word you want to search for in the "Word" text box at the top. The
button next to this box opens the keyboard dialog.

To look for an Addkey value with any word, tick the Any tick box.

Having either entered a word or ticked Any, press REFRESH. This brings up a list of all the relevant Addkey values in the main display area in the middle of the dialog box.

So, in the example below, the two "POS" values that occur for the word "level" in this corpus are shown:

In this case the values for the Addkey "POS" that co-occur with the word "level" are displayed: they are JJ and NN1.

Sometimes the value ??? appears on the Addkey list. This indicates that on at least one occasion, the word you have entered occurs without a "POS" Addkey. This could happen, for instance, if the word occurs in the header of one or more texts: words in a header are indexed but are unlikely to be fully marked up with POS and other Addkey values.

If you have ticked Any, then all the values for the selected Addkey that occur in the whole corpus will be listed when you press REFRESH, regardless of what word you have entered.

If you enter a word that does not occur in the corpus index, no values will be displayed at all.

You can now use the word and Addkey values to create a query. Choose the Addkey value or values that you wish to search for by selecting them from the list in the central area of the dialog box.

For instance, in the example above, to search for "level" as an adjective, you would click on NN1. To search for "level" as NN1, click on NN1. You can select more than one value to search for: as usual in Windows programs, clicking on one or more values with the CTRL key held down will select each of them; clicking one value and then another with the SHIFT key held down will select both those two values and all the values that occur between them in the list.

In the example below, the Any tick box has been used to list all the POS tags in the corpus, and all the noun tags (N-) have been selected:

When you run the Addkey query, Xaira will find all instances either of the word form-Addkey pairs you have specified (if the Any tick box is unchecked), or of the Addkeys you specified with any word form (if the Any tick box is checked).

Pressing OK runs the search. Pressing CANCEL aborts the query.

12.6. Pattern query

A pattern query searches your corpus for all the words that match a pattern (or regular expression) that you specify.

To start a pattern query, select Pattern Query from the New Query submenu on the File Menu, or press the Pattern Query button on the tool bar. This will bring up the Pattern Query dialog box:

The main part of the dialog box is a text window. You type the pattern you want to search for here. See here for details on how to create a pattern.

The Primary / Secondary / Tertiary radio buttons control the strength of the comparison between the pattern and the words in the corpus. This relates to the issues of whether capital letters match lowercase letters, and whether accented characters match the same characters without the accents.

A Primary strength match ignores both case and accents (so "d" and "D" match, and "e" and "e" match).

A Secondary strength match ignores accents but not case (so "d" and "D" don't match but "e" and "e" do match).

A Tertiary strength match takes both accents and case into account (so "d" and "D" don't match and "e and "e" don't match either).

The
button opens the keyboard dialog.

If you press OK, the pattern is validated, and Xaira runs a search for all the words that match the pattern. Pressing CANCEL aborts the query.

Pattern Query Tip: You can check the results of a pattern query without actually running the query, by taking advantage of the Word Query dialog box. If you enter a pattern into the Word Query box, it will display a list of the words in the corpus that match the pattern. See here for more information.

12.7. XML query

As well as information about words and their parts of speech, the index Xaira uses to search the corpus contains information about where the XML elements in the corpus begin and end.

XML tags are used to mark structural components of texts such as sections, paragraphs, or headings in written texts. In spoken texts, they are also used to mark where one speaker takes over from another, as well as paralinguistic features such as pausing, coughing, or voice quality.

An XML Query searches for XML start- or end-tags in the corpus. An XML query can be started by selecting XML Query from the New Query submenu on the File Menu, or pressing the XML button on the tool bar (shown above). This will cause the XML Query dialog box to be displayed:

The upper part of the dialog contains a scrollable list of the name sof all the XML elements that occur in the corpus. (For an explanation of what these are and how they are used in the corpus, you will need to refer to the corpus documentation.)

To search the corpus for an XML start or end tag, select the name of the element you want from this list by clicking on it. Then specify whether you want to look for the start tag (i.e. <element>) or the end tag (i.e. </element>), using the radio buttons in the top left of the dialog box.

Click on the OK button to run the query or click on CANCEL to abort the query.

Attribute-value constraints in XML queries

If you are searching for a start tag, you can also restrict the search to instances of the start tag that have particular values for given attributes, using the Attribute controls in the lower half of the dialog box.

First, click on the name of the element you want, and select the "Start" radio button as before. This will cause a list of any attributes defined for the element you have selected to appear in the window in the bottom left of the dialog. (If you tick the "Global" tick box at this point, only those attributes which have been flagged to the indexer as global - that is, available for all elements - will be shown.)

Now, select the attribute you want you to use in the search by clicking on the attribute's name. Then, use the buttons in the centre of the Attribute area to specify the value that you want this attribute to have.

In the example below, the a query is being set up to look for instances of the <catRef> element. The next step is to press one of the three buttons circled in red below, to define the value that will be searched for:

The ADD VALUE button opens a dialog box in which you can type the value that you want the attribute to have:

The ADD PATTERN button opens a dialog box where you can specify a pattern that the value of the attribute must match:

If there are fewer than 250 different values for that attribute in your corpus, Xaira can display a list of the values, from which you can choose one or more values that you want to search for. To open the dialog that contains this list, press the ADD FROM LIST button:

In all three of the above dialogs, pressing CANCEL aborts the value-adding procedure; typing or selecting the value you want and then pressing OK adds that attribute-value pair to the search. The attribute value pair will then appear in the list in the lower right of the XML Query dialog:

The search above, if run, would find all instances of a <catRef> start-tag where #default attribute has a value equal to "LAW".

You can add more than one attribute-value constraint, if you wish, but you can only have one attribute-value constraint for any one attribute. If you want to remove one of the constraints you have added, click on it in the right hand window to highlight it, and then press REMOVE. The REMOVE ALL button removes all the currently listed constraints.

12.8. Query Builder

The Query Builder allows you to create complex queries using a visual interface. A complex query is one in which several queries, possibly of different types, must all be satisfied within a specified context.

An example of a complex query would be a search for a given phrase occurring within a specified XML element; another example is a search for a word, followed within the same sentence by a different word with a specified part of speech.

The Query Builder display represents the structure of a complex query as a network of nodes. Each node represents one specific thing that the query is looking for.

To start a query with the Query Builder, either select Query Builder from the New Query submenu on the File Menu, or press the Query Builder button on the toolbar. This will cause the Query Builder dialog box to be displayed. When you first open the dialog box, it looks like this:

You begin with two empty nodes. Every Query Builder query always has at least two nodes. One, the scope node, defines the context that the search will look in. The other node or nodes, which may be linked in various ways, are known as content nodes: they define what you are looking for.

In the example above, the scope node is on the left, with an arrow running through it; the content node is on the right. Both nodes are empty; the content node is outlined in red because empty content nodes are not allowed in a Query Builder query.

The information line in the lower right of the dialog reminds you that there are empty nodes. It is also for this reason that the OK button is greyed out. If the content node is filled (see below), its outline will turn black, and the information line will display "Query is OK":

This is the minimal Query Builder query (in this case, directly equivalent to a phrase query). To run the query, press OK. To close the Query Builder window without running the Query, press CANCEL.

Below, we will see in detail how to fill a content node; how to fill the scope node; and how to add more content nodes to the query and manipulate the links between them.

How to fill a content node

Content nodes specify what the search is looking for. Each content node contains a single query, selected from the various types of query available in Xaira.

A content node can contain any kind of query (other than a CQL or a Query Builder query). So it might contain a Word Query; a Phrase query; an Addkey query; a Pattern query; an XML query; or the Anyword character (the underscore _ ) as a content node in its own right.

A content node can also contain a Quick Query. To add a Quick Query to a content node, right-click on the node with the mouse, and type the word you want:

When you have finished typing, click away from the text box with the left mouse button. The node will be filled by the CQL representation of the Quick Query you have just entered (remember, the Quick Query is equivalent to a Phrase Query):

To put any other sort of query into a content node, click on the node with the left mouse button to open a context-menu, and select the Edit submenu:

From this submenu, you can choose what type of query you want. The dialog box for the type of query you have selected will appear. You can specify the options for that query in exactly the same way as you would normally (see here for a list of relevant help pages). The only difference is that pressing OK in the query dialog will not run the query: instead, you will be returned to the Query Builder, where a CQL representation of the query you have defined will appear in the node you edited. This content node is now filled.

Choosing the "Any" command works slightly differently: it fills the node with a Phrase query consisting only of the Anyword wildcard character, the underscore _ . Note that an Any node can only be used in a query which has multiple content nodes - see below.

When a node is filled, you can edit its contents, clear the contents, or delete the node. To access these commands, click on the filled node with the left mouse button:

The Edit command will return you to the dialog box you used to create the query in that node. You can make any changes you wish to that dialog, before clicking OK to return to Query Builder, where the content node will have been updated.

The Delete command removes the content node, but leaves the rest of the query unchanged. If there is only one content node in your query, you cannot delete that node - for this reason, the Delete command is greyed out in the illustration above.

The Clear command removes the query from the node, making it an empty node again. Any content node can be cleared in this way.

The Copy command copies the CQL text of the content node. The Paste command overwrites the content mode with the CQL text you have previously copied. Note that these Copy and Paste commands do not use the ordinary clipboard, so you cannot, for instance, move text in and out of the Query Builder dialog using these commands. Copy and Paste are of greatest use when you are dealing with multiple content nodes - see below.

How to fill a scope node

The scope node specifies what context Xaira should look in to find the content you defined in the content node. This context definition is called the scope of the query. Each Query Builder Query has only one scope node.

To specify the scope of your query, click on the scope node with the left mouse button:

You can choose either Span or XML from this menu. If you choose XML, the XML element dialog box opens. This works in the same way as the XML query dialog, allowing you to select an XML element, possibly modified by attribute-value constraints. Pressing OK on that dialog will return you to the Query Builder, and the scope node will contain the CQL text of the XML scope you have defined.

When you specify an XML element in the scope node, it restricts the query to words or combinations of words that occur inside that XML element. So for instance, the query below will look for instances of "schadenfreude" occurring inside a <foreign> element in the corpus:

If there is more than one content node, then all the content node query items must be found within the same XML element that you have specified in the scope node. For instance, the query below will look for instances of "man" and "dog" occurring within the same <p> unit (paragraph):

If you define the scope as a span then all the content node query items must be found within the number of consecutive words you specify as the span. Selecting Span from the scope node's menu will make the dialog below appear:

Enter an integer in the text box to define a span, and press OK to return to the Query Builder (or CANCEL to abort). Once again, the CQL text of the span you have specified will appear in the Query Builder display. So, for instance, the Query Builder query below will look for instances of "man" and "dog" occurring within 5 words of one another:

For obvious reasons, defining a span of X words as the scope only makes sense if you are looking for more than one item. It would not make much sense to look for a single word occurring within a span of 5 words from itself! So if your content nodes only specify one item that you are looking for, making the scope a numeric span will make the scope node's outline turn red and a warning appear on the dialog:

To rectify a query like this, you would have to define another content node above or below the node containing "man", or replace the numeric scope with an XML scope. See below for more detail on using multiple content nodes.

Using multiple content nodes

Additional content nodes can be added to the single compulsory content node, to specify additional material that must be found within the scope for the search to be satisfied. They are all filled in the same way (see above).

To add a content node, click with the left mouse button on the T-shaped branch emerging from an existing node. You can add nodes above, to the right of, or below and existing node in this way:

You can also insert nodes between two existing nodes, by clicking on the line that links the two nodes together with the left mouse button. If the nodes are linked horizontally, this will simply insert the node:

However, if the nodes are linked vertically, a small menu will appear; select "Insert node" to add a content node at the point you clicked the mouse:

So how do the different content nodes interact?

Content nodes that are joined horizontally represent alternatives. So the query below will look for either the word "the" or the word "a":

So, the query above will find any example of "the" or "a" in the corpus, (as long as it occurs within an <s> element).

(Note that alternatives can also be contained within a single content node by using a pattern query that matches more than one word, or by selecting several words from the word-form list in a Word Query.)

Nodes that are linked vertically represent query targets that must all be found, within the defined scope, for the query to be solved (unless they are linked by a "not next" link: see below). So, for instance, the query below looks for instances of the word "the" inside the same <s> element as the word "first". Every solution to this query will contain both "the" and "first":

It is of course possible to combine horizontal alternatives with vertical additional targets. So for instance the query below looks for instances of "the" or "a", followed within the same <s> element by an instance of "first" or "second":

You can add as many content nodes as you want, both horizontally and vertically. Note however that all content nodes must be filled. Also, if you use a very large number of nodes, your query may get too big for Xaira to handle easily.

It is quite easy to add enough content nodes that the entire network of nodes is too big to fit in the Query Builder dialog display. In this case, you can either re-size the dialog using the mouse in the usual Windows fashion (as shown in many of the example above), or make use of the scroll bars to move around the network:

Linking multiple content nodes

When two nodes are linked vertically, the line that joins them together indicates what order they have to occur in, and how close together they must be. The possibilities are:
  • next (represented by a thick line): the query term indicated above the line must immediately precede the term below the line;
  • not next (represented by a thick line with a bar across it): the query term indicated above the line must not be immediately followed by the term below the line (and, indeed, the term below the line need not occur within the scope at all);
  • one-way (represented by a downwards pointing arrow): the query term indicated above the line must precede the term below the line within the scope indicated by the scope node;
  • two-way (represented by a double-headed arrow): the query terms above and below the line may appear in any order within the scope indicated by the scope node.

When you create a new node above or below another node, the default link between them is a one-way link:

To change the link type, click on the link with the left mouse button to open the menu, and choose the option you want from the Link type sub-menu:

All horizontal links are of the same type: all represent alternative search targets, as explained above.

12.9. CQL query

CQL (short for XML Query Language) is the XML language in which all Xaira queries are expressed. You can view the CQL form of any query by switching on the Query Text option on the Query menu.

Usually Xaira generates the CQL form of a query for you, and keeps it hidden behind the scenes. But you can also type CQL commands directly into Xaira, using a CQL Query.

A CQL Query also allows you to use the few features of CQL which Xaira cannot generate easily (or at all) from the other types of query.

To start a CQL query, select CQL from the Query submenu of the New option on the File Menu or press the CQL button on the tool bar. This brings up the CQL Query dialog box:

The main area of this window is the text box where you type your CQL text. You can either type it in directly from scratch, or else use the CQL text of another type of query as a basis for modifications.

For instance, if you run a Word query on "the", you can copy the CQL text of this query to the clipboard using the Copy query command. If you then open the CQL query dialog box and use the CTRL+V shortcut to paste the clipboard contents, you will see the following:

<lemma>the</lemma>

Running this query will have the same results as your original word query, but you can also modify the query. For instance, you could change the word from "the" to "them" to do a Word query on the latter word, or you could add more CQL terms to the search to make it more elaborate.

See here for information on the syntax of CQL.

CQL dialog controls

The
button opens the keyboard dialog.

Pressing CANCEL aborts the query. Pressing OK runs the search.

If you run a CQL query which is badly written - that is, not fully correct CQL syntax - Xaira will reject the query and display an error message that will tell you what type of error was involved.

12.10. Running a Xaira query

Whichever type of Xaira query you want to perform, the process of running it is the same:
  • use the New query command on the File menu or the buttons on the Query toolbar to open the appropriate dialog box for the query you want;
  • specify your query using the commands in the dialog box;
  • press the OK button on the query's dialog box (or hit the Return key) to initiate the query;
  • the red BUSY light on the status bar at the bottom of the main window will light up or flash, indicating that Xaira is processing your query;
  • if the number of solutions to the query in the corpus is less than the Maximum Downloads set in the User Preferences dialog box, the results will start to appear in a new Query window, named "QueryN" (where "N" is the number of this query in the session);
  • if the number of solutions is greater than the Maximum Downloads figure, the Too Many Solutions dialog box will appear;
  • if the corpus contains no solutions to your query, the Query failed dialog box will appear.

When the query is complete and all solutions have been loaded into the window, the red BUSY light will go out.

You can cancel a query which is taking too long to process by pressing the ESC key, at any time when the red light on the status bar is on. This will abort processing of the query as soon as possible.

You can scroll, sort, thin, save, see the sources of, or otherwise manipulate the solution set using options from the Query menu.

12.11. Too many solutions dialog

If Xaira finds more solutions to a query you are running than the "Maximum downloads" limit you have set in the Preferences dialog box, the Too many solutions dialog will appear:

The dialog offers you a number of options for handling this situation. Selecting an option and clicking OK will run the search. Pressing CANCEL will take you back to the dialog box that started the query, where you can modify your query if you wish.

The text box at the bottom of this dialog specifies how many solutions are to be downloaded. When the dialog first appears, it will contain the "maximum downloads" limit set in the Preferences dialog, but you can change the number, either manually or by using the radio button options above it.

If you select the "Download initial solutions" radio button, Xaira will download the number of solutions given in the text box at the bottom of the dialog, starting from the first to appear in your corpus. So, in the example shown above, this option would instruct Xaira to download the first 100 solutions from the corpus, and ignore the remaining 1200. "Download initial solutions" is selected by default when the dialog box first appears.

If you select the "Download random set" solutions radio button, Xaira will download the number of solutions given in the text box at the bottom of the dialog, selecting solutions randomly. So, for the same example, this option would instruct Xaira to download a random 100 solutions from the corpus, and ignore the remaining 1200. This is similar in action to the Thin Random command.

The "download initial solutions" and "Download random set" options will be greyed out and unavailable if the number of solutions to be downloaded, as given in the text box at the bottom of the dialog, is increased to be equal to or greater than the total number of solutions that Xaira found in the first place.

If you select the "Download all" option, the number of solutions to be downloaded will be changed, so that it is equal to the total number of solutions in the corpus: this option allows you to temporarily (i.e. for this search only) override the "maximum downloads" limit.

When "Download all" is selected, you may choose to download only the first solution from any particular text in your corpus using the "One per text" tick box. This will change the number of solutions that are to be downloaded to be equal to the number of texts containing at least one solution to the query. This one-per-text option is similar in action to the Thin One per text command.

Note: the OK button will be greyed out if you ask for a number of downloads that is larger than Xaira can handle.

12.12. Query failed dialog

If there are no solutions to your query in the corpus you are running it on - for instance, if you are looking for a word, phrase, XML element or word/Addkey combination that does not occur in the corpus - then the Query failed dialog box will be displayed.

Press OK to return to the dialog box that created the query, or press VIEW to open a window showing you the CQL text for the failed query.

12.13. Controlling the Query display

The Query window displays the solutions to your Query. Xaira allows you to control various aspects of the Query window display, letting you choose how the text of your solutions will be rendered, the text-flow direction of the solutions, how much context to show with each solution, whether to view the Query in Page mode or Line mode, and other options.

Many of the Query display controls are accessed using the Query menu. Others are available through the Query window context-specific menu (see below). However, some commonly used Query display controls are accessed using the Format toolbar, which has the following layout:

The button on the left toggles between page mode and line mode. The four buttons at the right end of the toolbar access (from left to right) the Flybys, New Stylesheet, Open Stylesheet, and Edit Stylesheet commands respectively.

The three controls in the centre of the Format toolbar give you quick access to key display options. First is the Format dropdown. This dropdown contains a list of all the available stylesheets; you can use the dropdown to switch quickly between the currently open stylesheets:

Whichever stylesheet you select will be applied to the solutions in the Query window. (Note: this control is also active in the Browser window.)

The adjacent control is the scope scroll box. This allows you to set the solution scope for the current Query window by using the arrow buttons to increment or decrement the scope:

Finally, the Align dropdown controls the direction of the text flow in the Query display. You can set the text display to flow from the left, from the right, from the top, or from the bottom:

(NB: the last two options in the Align dropdown are not implemented in the current version of Xaira.)

The default settings for the above controls (the Format dropdown, the scope control, and the Align dropdown) are determined by options in the User Preferences dialog.

The Query window context-sensitive menu

Right-clicking with the mouse on any solution in a Query window will cause the context-specific menu shown below to drop down:

Some of the commands on this menu are available through the menu system or the toolbar, but some are only available here.

The Copy command has the same effect as the Copy command on the Edit menu.

The Copy word command copies to the Windows clipboard the single word that your mouse was hovering over when you dropped down the context menu.

The Increase scope command has the same effect as increasing the solution scope using the scope scroll box, as described above. However, whereas the scope scroll box affects all the solutions in the Query window, the Increase scope command on the context menu only affects the solution your mouse is currently pointing at. This is useful if you just want to see the text surrounding one particular solution.

The Selected command selects the solution the mouse is pointing at. Selected solutions can be thinned out of the results set, or preserved while other solutions are thinned. If the solution your mouse is pointing at is already selected, a tick will appear next to this command on the context menu: click on the Selected command once more to de-select the solution.

The Block select command changes the Selected status of the current solution, the solution that your mouse is pointing at, and every solution that lies between these two on the list. (Note, therefore, that if your mouse is pointing at the current solution, Block select will affect only that single solution.) Any solution affected by Block select will switch to selected (if it was previously unselected) or to unselected (if it was previously selected).

The Source command is the same as the Source command on the Query menu.

The Browse command opens a Browser window, showing the text that the solution you are pointing at came from.

The Home command scrolls the display in the Query window right to the very top in a single step.

12.14. Solution scope

The solution scope determines how much of the text around a solution is displayed along with the focus of the query (i.e. the word, phrase or XML element that the query was looking for).

The unit that the scope is measured in may vary, depending on the XML markup in the corpus and how the corpus has been indexed. It might typically be measured in sentences (<s> units) or paragraphs (<p> units).

A solution always contains the whole of the scope unit in which the query hit occurs. So, assuming the scope unit is <s>, a solution will always contain the whole sentence in which the query focus occurs. But the number of units before and after that unit that are shown in the solution is determined by the solution scope.

So (still using <s> as an example):
  • if the solution scope is 0, no sentences other than the one in which the query focus occurs will be shown in the solution
  • if the solution scope is 1, one sentence before the sentence containing the focus and one sentence after will be shown as well for a total of 3 sentences of context
  • if the solution scope is 3, a total of 7 sentences will be shown (the sentence in which the query hit occurs, three sentences before it, and three sentences after it)

The initial solution scope for a new Query window is determined by a default value, which you can set in the User Preferences dialog. Once a Query window is open, you can increase or decrease the solution scope using the Scope control on the Format toolbar:

12.15. The Current Solution

At any time, one of the set of solutions in a Query window is the current solution. This is the solution that is currently selected.

In Page display mode, this is the solution which is visible on the screen. You can move up and down through the results set using the PAGE UP and PAGE DOWN keys on your keyboard.

In Line display mode, the current solution is the solution which is highlighted by a dotted line above and below it. You can move up and down through the results set using the UP and DOWN cursor keys. Alternatively, clicking on a solution once with the mouse will make it the current solution (you can use the scroll bar on the right to move quickly up and down through the results set).

In either case, the information displayed in the status bar applies to the current solution (so, to see information on a particular solution, you must make that solution the current solution).

Up: Contents Previous: 11. The Help Menu Next: 13. Other Help Topics