[CWB] cqp http server

Maarten Janssen maartenpt at gmail.com
Fri Jul 1 14:08:03 CEST 2016


Dear Enrique,

I’m not entirely sure what you mean by “HTTP” server in this case (I hope not HTML), but if you simply mean dumping the CQP output over HTTP (which would not make it very platform independent, I’d rather convert it to something like SOAP in that case), it might be easier to do PHP rather than Perl; both TEITOK and CQPWeb have a simple Perl module that allows you to call the CWB engine, in the TEITOK version a hyper-trivial HTTP engine would look like this (this is not going to be too secure though):

Maarten


require ("cwcqp.php”);
$cql = $_GET[‘cql’]; // grab the query from the URL variables
$cqp = new CQP();
$cqp->exec('DICKENS’); // select the corpus you want to use
$cqp->exec('Matches = “$cql"’); // run the query
$results = $cqp->exec('cat Matches');
$cqp->close();

print join ( “\n”, $results ); // print the results





More information about the CWB mailing list