The PyCQP_interface Subprocess wrapper

This module was written by Jørg Asmussen to wrap a CQP subprocess and allow the querying and processing of corpus data from within Python.

class PyCQP_interface.CQP

Wraps a CQP subprocess that can execute queries on corpora.

__init__(self, bin=None, options)

Creates the CQP subprocess. The path to the CQP binary can be given as the _bin_ parameter.

Exec(self, cmd)

Executes a CQP command. The method takes as input a command string and sends it to the CQP child process (and does not expect a result from CQP).

Query(self, cmd)

Executes the given query with the “query lock” turned on.

Dump(self, subcorpus='Last', first=None, last=None)

Dumps named query result into table of corpus positions (with columns for beginning, ending, and the marked part of the match).

Undump(self, subcorpus='Last', table=[])

Undumps named query result from table of corpus positions

Count(self, subcorpus='Last', sort_clause=None, cutoff=1)

Computes frequency distribution for match strings, based on sort clause

Previous topic

Installing CWB-Python

Next topic

CWB.CL: The Lowlevel Interface

This Page