Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corpus_query_language-0.0.5.tar.gz (188.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corpus_query_language-0.0.5-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for corpus_query_language-0.0.5.tar.gz
Algorithm Hash digest
SHA256 aa092824d64810efbdc43a8a12a24f68b74fa48ec28e49482b22a80fc8e5d12b
MD5 7532d92c59234e3f07dc2809935d8357
BLAKE2b-256 01c0c907c5b9a24c28b6af46f0e454838319ba9a76b6d30bd5d8466a4e705077

See more details on using hashes here.

Provenance

The following attestation bundles were made for corpus_query_language-0.0.5.tar.gz:

Publisher: pypi-publish.yml on matgille/CQL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file corpus_query_language-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for corpus_query_language-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 83cd43e543d5e00a8020dc9d124eb54782e0f7aa4664d69d5a23684724ae1f04
MD5 1887df56c082f7643ee444ca91992042
BLAKE2b-256 db022e01775f938c5474858c9bffbd0cffefa8dc5ea8c4612ce09687218fa8d5

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page