Methods Documentation
General notes
The communication with the Sketch Engine works through the use of CGI queries and looks like this:
- create an authenticated connection to the Sketch Engine
- create a query that you want to work with
- process the output that is sent as a response
In the Examples section in the bottom of this page, there are some simple examples demonstrating how to connect the server, send a prepared query and process the output (in Java and Python). Construction of custom queries and more detailed output parsing is described in the following sections.
Creating a query
A Sketch Engine query has the following structure:
<base_url>/<method>?<attributes_and_values>
where
- <base_url> is the path to the main CGI script, "run.cgi", e.g. http://beta.sketchengine.co.uk/auth/corpora/run.cgi for beta.
- <method> is the particular method name, e.g. "wsketch" for word sketches. For list and documentation of all methods see the following section.
- <attributes_and_values> is the list of attributes and values in the CGI notation, that is attribute_1=value_1;attribute_2=value_2; ... ;attribute_n=value_n .
For more detailed description of all attributes see the following section.
An example of Sketch Engine query can look like this:
It is a query that returns word sketch HTML page for corpus "preloaded/bnc", and lemma test as a noun ("lpos=-n")
