A small example package
Project description
Corpus Query Language Engine
Presentation
This repo hosts the code for a simple CQL processor. CQL is a language used for linguistics queries over large corporas.
Pip install
pip3 install corpus-query-language
Uses
Two main functions are implemented:
- match, for checking if some pattern exists in a corpus (stops at first match). Returns a boolean
- findall, for finding the position of all matching tokens. Returns a list of tuples, with start and end position.
import sys
import corpus_query_language as CQL
query = "Some CQL query"
corpus = CQL.utils.import_corpus("path/to/json/corpus.json")
MyEngine = CQL.core.CQLEngine()
MyEngine.findall(corpus, query)
MyEngine.match(corpus, query)
Implemented CQL functions
- parsing of any kind of annotation classes:
word,lemma,pos,morph - combination of annotations:
[lemma='rey' & pos='NCMP000'] - one or zero annotations
[lemma='rey']?(partially implemented, may produce errors). - distance
[lemma='rey'][]{,5}[lemma='santo'] - any regex in the annotation value
[lemma='reye?s?'] - alternatives:
([lemma='rey']|[lemma='príncipe'])[]{,5}[lemma='santo'](may produce errors)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file corpus_query_language-0.0.5.tar.gz.
File metadata
- Download URL: corpus_query_language-0.0.5.tar.gz
- Upload date:
- Size: 188.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa092824d64810efbdc43a8a12a24f68b74fa48ec28e49482b22a80fc8e5d12b
|
|
| MD5 |
7532d92c59234e3f07dc2809935d8357
|
|
| BLAKE2b-256 |
01c0c907c5b9a24c28b6af46f0e454838319ba9a76b6d30bd5d8466a4e705077
|
Provenance
The following attestation bundles were made for corpus_query_language-0.0.5.tar.gz:
Publisher:
pypi-publish.yml on matgille/CQL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corpus_query_language-0.0.5.tar.gz -
Subject digest:
aa092824d64810efbdc43a8a12a24f68b74fa48ec28e49482b22a80fc8e5d12b - Sigstore transparency entry: 529700109
- Sigstore integration time:
-
Permalink:
matgille/CQL@40f5b82adbaa0fe06da4e6bc943d02cbf870c1f1 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/matgille
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@40f5b82adbaa0fe06da4e6bc943d02cbf870c1f1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file corpus_query_language-0.0.5-py3-none-any.whl.
File metadata
- Download URL: corpus_query_language-0.0.5-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83cd43e543d5e00a8020dc9d124eb54782e0f7aa4664d69d5a23684724ae1f04
|
|
| MD5 |
1887df56c082f7643ee444ca91992042
|
|
| BLAKE2b-256 |
db022e01775f938c5474858c9bffbd0cffefa8dc5ea8c4612ce09687218fa8d5
|
Provenance
The following attestation bundles were made for corpus_query_language-0.0.5-py3-none-any.whl:
Publisher:
pypi-publish.yml on matgille/CQL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corpus_query_language-0.0.5-py3-none-any.whl -
Subject digest:
83cd43e543d5e00a8020dc9d124eb54782e0f7aa4664d69d5a23684724ae1f04 - Sigstore transparency entry: 529700120
- Sigstore integration time:
-
Permalink:
matgille/CQL@40f5b82adbaa0fe06da4e6bc943d02cbf870c1f1 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/matgille
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@40f5b82adbaa0fe06da4e6bc943d02cbf870c1f1 -
Trigger Event:
release
-
Statement type: