[ Collection: Introduction to CQP ]
3b. Extending simple queries: Combinations of attributes and values
This section introduces simple queries involving one token with more than one property, It presupposes that you have read Section 1 and Section 2.
Recall that in Section 2, we searched for love, and that our queries always returned examples of the noun and the verb. However, when searching for a particular lemma or word form, we typically want to limit our query to a particular part of speech. We can do this by combining two attribute-value pairs in a single pair of square brackets using the ampersand symbol &
– [attribute=“value” & attribute=“value”]
.
For example, to find love as a singular noun (one love, to cite Bob Marley's famous song), the query would look like this:
[hw="love" & pos="NN1"]
Enter it at the prompt and hit RETURN
. You will see that the concordance contains only uses of the singular noun love.
Or, we might be interested in whether the noun love can be used in the plural. Our query would look like this:
[hw="love" & pos="NN2"]
Again, run the query and look at the results. You will see, that the plural noun loves does indeed exist.
Summary and outlook
This section has shown you how to create concordances using combinations of attribute-value pairs. Building on this, you can look at the following sections in any order:
- Section 3a: Extending simple queries: Alternative attributes and values
- Section 3c: Complex Queries
- Section 3d: Metadata
- Section 3e: Regular expressions (basics)
- Section 3f: Working with concordances
- Section 3g: Sorting and sampling
[ Introduction to CQP: Section 1 – Section 2 – Section 3 – Section 4 – Section 5 – Section 6 ]