Skip to main content

MWE Query

DOI PyPI version Actions Status

Run Locally

This will ask for the (local) BaseX-database to query.

pip install -r requirements.txt
python -m mwe_query

Use as Library

Create Queries

from mwe_query import Mwe
from alpino_query import parse_sentence

# the pronominal is marked with <>
sentence = 'iemand zal er <goed> voor staan'
mwe = Mwe(sentence)
# parse this sentence using Alpino
tree = parse_sentence(mwe.can_form)
mwe.set_tree(tree)

# This generates a list of MweQuery-objects
queries = mwe.generate_queries()

# precise = queries[0]
# near_miss = queries[1]
superset = queries[2]

print(superset.xpath)
# /node[..//node[@lemma="goed" and @pt="adj"] and ..//node[@lemma="staan" and @pt="ww"]]
print(superset.description)
# superset
print(superset.rank)
# 3

Analyze Results

from mwe_query import analyze_mwe_hit

# hit: etree._Element containing the node which matched on of the
# queries
# queries: generated query objects
# tree: etree._Element of the entire utterance tree
info = analyze_mwe_hit(hit, queries, tree)
print(hit.components.marked_utt)

Upload to PyPi

pip install twine
python setup.py sdist
# this can be tested locally by creating a virtualenv and installing it:
# pip install dist/mwe-query-x.x.x.tar.gz
twine upload dist/*

Metadata

Release files for mwe-query 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mwe-query 0.1.0
File Size Uploaded Provenance Actions
mwe-query-0.1.0.tar.gz 98.0 kB Without provenance Details for mwe-query-0.1.0.tar.gz

Release files / mwe-query-0.1.0.tar.gz

Download URL mwe-query-0.1.0.tar.gz
Size 98.0 kB
Tags Source
SHA-256 checksum
How to use checksums
61ea13b29c7bb5664a953f6fefa516aea6eb4a1f7f946884961dd8a74ae09bd7
BLAKE2b-256 checksum
How to use checksums
8ae58c18a9011244b9c6cbea5eb4e1e04b712a959d6f80da2c7d06ae620f3d43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Security for mwe-query 0.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page