CQP/Tree
A framework to translate tree-style linguistic queries into sequential queries for use in Corpus Workbench or Korp, with plans to soon support Sketch Engine.
Installation
This module requires Python version 3.12 or higher to be installed.
Installation is possible using pip.
pip install cqp-tree
If you want to run the current development version, you can clone this repository and install the package locally.
git clone https://github.com/Niklas-Deworetzki/cqp-tree.git
cd cqp-tree
pip install .
Get Started in the Browser
This package contains a local web-server. Running it allows you to open a website in your browser which has a user-friendly translation interface available.
cqp-tree-web
Running this command will start the server locally. Once it's started, click on the link displayed in your terminal or manually enter http://localhost:31495 to start translating queries. To stop the server again, press Ctrl and C in your terminal window.
Translating Queries
The module provides an executable called cqp-tree.
It can translate different queries into a common CQP representation and offers the most control over the translation process.
Currently, the following other query-languages are (partially) supported:
- Grew-match
- dep_search we have some documentation on supported features and extensions
- deptreepy
- CoNLL-U: this is not commonly intended as a query language, but (partial) trees in CoNLL-U format can be interpreted as queries. For details, see conll_frontend.md
In order to translate a query, you can provide it either via the command line, as the contents of a file or by directly typing it out into the program:
cqp-tree deptreepy --query 'TREE_ (pos NN) (AND (pos JJ) (word a.*))'
cqp-tree grew --file resources/example.grew
The converted query is, by default, printed to the screen.
Using the --output flag you can specify a file to which it should be written to instead.
Contributing
Feel free to add to this project. Read CONTRIBUTING.md to get started.
Metadata
Release files for cqp-tree 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cqp_tree-1.0.tar.gz | 145.8 kB | Without provenance | Details for cqp_tree-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cqp_tree-1.0-py3-none-any.whl | Python 3 | none | any | Details for cqp_tree-1.0-py3-none-any.whl |
Total release size: 301.4 kB
Release files / cqp_tree-1.0.tar.gz
| Download URL | cqp_tree-1.0.tar.gz |
|---|---|
| Size | 145.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ba0433307366011a99892be151915f17b7ddef782d7a253f881ee8ac12b09fd
|
|
BLAKE2b-256 checksum How to use checksums |
648f2e180d14764aee0c16e351b0894f2a6597af1546526c9695c99c423a28d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / cqp_tree-1.0-py3-none-any.whl
| Download URL | cqp_tree-1.0-py3-none-any.whl |
|---|---|
| Size | 155.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ef19175c816fec2bc3a93346515a8848018f099b9cc95710510ade8ad26fb54
|
|
BLAKE2b-256 checksum How to use checksums |
e440a9c685b75d4d39ef68a1f59b9319b34e73680e9bf30ad0aa4ea88edbbdc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for cqp-tree 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.