<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-GB;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Verdana",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi José,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Documentation is, as ever, a work in progress.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Chapter 12 of the admin manual
</span><a href="http://cwb.sourceforge.net/files/CQPwebAdminManual.pdf">http://cwb.sourceforge.net/files/CQPwebAdminManual.pdf</a>
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">
&nbsp;is intended to be the definitive version of the API documentation, but I’ve not updated it since before the last phase of work. In particular it has nothing about the client objects since when I did the last update I’d not thought them through yet. And the
 function names weren’t all verb phrases at that point whereas now they are.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The list of functions, and the roadmap (ie, the parts of that list that are commented out), are visible in lib/api-lib.php in the CQPweb
 server code. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The idea for the client objects is that there will be individual methods for certain commonly used functions: log_in, log_out, get_version,
 get_cwb_version, list_api_functions,, get_api_error_info and so on.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">And there will also be methods for managing the client state: the constructor (which sets the server URL), ok, set_secrets, set_corpus,
 get_error_code, get_error_messages … these are identically named across languages.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">(Clients can have whatever private methods they like of course, e.g. the JS client object already has a couple.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">But everything else will be done via the call()&nbsp; method with one of the appropriate function constants<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">IE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Client.call(API_FUNC_FETCH_FREQLIST, [ … ])<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">… where the 2<sup>nd</sup> parameter is a hash of named arguments as specified by the API documentation. (Where the “hash” might be
 an array (PHP), dict (Python), object (JS) …)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">As in the example in ch 12, the parameters and return types will be defined in a pseudo-C style, thus:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt">RETURN_TYPE FUNCNAME(PARAM_TYPE PARAM_NAME, …)<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">array list_api_functions(void)<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">I haven’t finished writing the call() method in PHP yet so there does not exist an illustration of how the client should &nbsp;construct
 the server call. But it will work like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">http://server.net/cqpweb/$CORPUS/api.php?f=$FUNCTION...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">… with the named function parameters appended as a sequence of &nbsp;&amp;$PARAM=$ARG (with URL encoding of the $ARG value) as necessary.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The return from api.php is always a JSON string. the object structure, as created by ApiController::dispatch()&nbsp; in api-lib.php, is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">{<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:72.0pt"><b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">status</span></b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">
 – string “ok” or “error”<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:72.0pt"><b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">errno</span></b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">
 – integer, one of the API_ERR_ constants<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">// plus
<i>either</i> (if errno != API_ERR_NONE)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>errors</b> – array of error messages<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">//
<i>or</i> (if errno == API_ERR_NONE)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>content</b> – value of the return type defined for the function.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">// plus possibly<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt;text-indent:36.0pt"><b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">user_login_token</span></b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">
 – string containing the login token for convenience (it is also sent as a cookie, but more easily accessed here)<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The client object’s call() method is expected to receive and handle this object, returning just the “content” if all is OK, and otherwise
 storing the error code/messages appropriately within its own state variables.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Also, all clients will have access to the same set of API_FUNC_ and API_ERR_ constants that exist in the server code. I am working
 on automating the updating of this (via a script located alongside the client objects.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">So in short, the role of the client objects is to take away from the user the need to build up the URL and to analyse the returned
 JSON. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">best<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Andrew.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> cwb-bounces@sslmit.unibo.it &lt;cwb-bounces@sslmit.unibo.it&gt;
<b>On Behalf Of </b>José Manuel Martínez Martínez<br>
<b>Sent:</b> 13 July 2019 13:19<br>
<b>To:</b> Open source development of the Corpus WorkBench &lt;cwb@sslmit.unibo.it&gt;<br>
<b>Subject:</b> Re: [CWB] CQPweb: help wanted for client objects<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Andrew,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">thank you for your answer. I understand now better the aim and scope.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I've taken a look at the API lib, the PHP client, and the python one. Is there some documentation/example about the API, how to call the functions for instance? Are there some guidelines to keep consistent the clients across languages?
 Or the list of features to be implemented? Just to have an idea of the volume of work.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I find the project interesting (in fact, I was considering to write in Python a light API to interact with CQP). I'd like to contribute to the Python client and team up with whoever wants to join forces.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">José Manuel Martínez Martínez<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://chozelinek.github.io" target="_blank">https://chozelinek.github.io</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Jul 11, 2019 at 9:57 AM Hardie, Andrew &lt;<a href="mailto:a.hardie@lancaster.ac.uk">a.hardie@lancaster.ac.uk</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">Hi José,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">The clients have their own tree in the repo, here:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://sourceforge.net/p/cwb/code/HEAD/tree/gui/cqpweb-client/trunk/" target="_blank">https://sourceforge.net/p/cwb/code/HEAD/tree/gui/cqpweb-client/trunk/</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&gt;&gt;</span><span style="font-size:13.5pt"> Is the idea to have a client written in Python to interact with a REST API written in PHP?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">Yes, except I am not sure the API will abide by the rules of REST.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">To clarify: the API is accessed via an entry point within the normal CQPweb tree, at
</span><a href="http://your.server.net/cqpweb/CORPUS/api.php" target="_blank"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">http://your.server.net/cqpweb/<i>CORPUS</i>/api.php</span></a><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">
 . Functions can be called, and arguments sent, using GET/POST parameters on that entry point script.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">The client objects are designed to be embedded into a larger software unit in the language of the user’s choice to make accessing the API less inconvenient. &nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">That will allow other GUIs to be written that use CQPweb as a backend while handling user interaction in whatever way they like.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">That’s the idea anyway; the API is not yet complete. The available functions so far can be seen at
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="https://sourceforge.net/p/cwb/code/HEAD/tree/gui/cqpweb/trunk/lib/api-lib.php" target="_blank">https://sourceforge.net/p/cwb/code/HEAD/tree/gui/cqpweb/trunk/lib/api-lib.php</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">lines 50 thru 73.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">best</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">Andrew.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D">&nbsp;</span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<b><span lang="EN-US">From:</span></b><span lang="EN-US"> </span><a href="mailto:cwb-bounces@sslmit.unibo.it" target="_blank"><span lang="EN-US">cwb-bounces@sslmit.unibo.it</span></a><span lang="EN-US"> &lt;</span><a href="mailto:cwb-bounces@sslmit.unibo.it" target="_blank"><span lang="EN-US">cwb-bounces@sslmit.unibo.it</span></a><span lang="EN-US">&gt;
<b>On Behalf Of </b>José Manuel Martínez Martínez<br>
<b>Sent:</b> 07 July 2019 18:16<br>
<b>To:</b> </span><a href="mailto:cwb@sslmit.unibo.it" target="_blank"><span lang="EN-US">cwb@sslmit.unibo.it</span></a><span lang="EN-US"><br>
<b>Subject:</b> Re: [CWB] CQPweb: help wanted for client objects</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
&nbsp;<o:p></o:p></p>
<p style="margin-left:4.8pt"><span style="font-size:13.5pt">Hi Andrew,</span><o:p></o:p></p>
<p style="margin-left:4.8pt"><span style="font-size:13.5pt">this sounds interesting. But I'm not sure if I understand it. Where can I find the Python client? Is the idea to have a client written in Python to interact with a REST API written in PHP?</span><o:p></o:p></p>
<p style="margin-left:4.8pt"><span style="font-size:13.5pt">Cheers,</span><o:p></o:p></p>
<pre style="margin-left:4.8pt">José Manuel Martínez Martínez<o:p></o:p></pre>
<pre><a href="https://chozelinek.github.io" target="_blank">https://chozelinek.github.io</a><o:p></o:p></pre>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
On 04.07.19 05:49, Hardie, Andrew wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">Hi all,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">If you happen to be subscribed to the checkin feed for the SVN repo on sourceforge you may have noticed that I have created a number of “CQPwebClient” class definitions for different programming
 languages.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">The idea of these is to ease use of the client API – raw API involves a lot of juggling about with GET and POST parameters. The only serious API function that is “working” theoretically at the
 moment is access to frequency lists. (“theoretically” because I am sure there are bugs.)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">I am trying to make each client follow the same object model within the constraints of each language’s structure. The “odd one out” is the JavaScript, which is designed for asynchronous programming
 (As in a browser), unlike the others. </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">The two most complete are the JavaScript and PHP, followed by the C, the Python and the Perl. The idea is that, as far as possible, the same properties and methods should be exposed by each object
 model – so the sequence of calls to the client (and the parameters which need to be specified) to accomplish some task X will be the same regardless of the language.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">I intend to continue to work on the JS and PHP clients myself as they are my languages of choice. (Well, actually, C is my language of choice, thus why there is a client object for C, but really
 it is a proof of concept rather than something I have a strong expectation of people wanting to make use of).&nbsp; Plus they exemplify the asynchronous/synchronous usage generally. However, for the others, having put down the rough outlines I would very much like
 to hand off maintenance to people who actually know what they are doing in the respective languages.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">TLDR</span></b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">:
<b><span style="color:red">I would be most grateful to anyone willing to volunteer to take on primary responsibility for one of the clients
</span></b>other than the JS and PHP versions – especially the Python, R or Perl. (BTW – the R client is just an empty file; I have no intention of actually writing it because R’s object system gives me the heebie-jeebies.)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">Or if anyone would like to contribute a client object in one of the (many) languages that I’m too scared even to touch (e.g. Java, C#, Ruby, Go, Lisp, shell, Groovy, Lua, MATLAB, BASIC, INTERCAL…)
 then that would also be fabulous.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">Anyone who is interested – just drop a note to the list. The only requirement is that you must be happy for your contributions to be released open source (with an MIT style licence).
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">Thanks in advance!</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">best</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">Andrew.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:36.0pt;mso-margin-bottom-alt:auto;margin-left:40.8pt">
<span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,sans-serif">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><o:p>&nbsp;</o:p></p>
<pre style="mso-margin-top-alt:0cm;margin-right:36.0pt;margin-bottom:0cm;margin-left:40.8pt;margin-bottom:.0001pt">_______________________________________________<o:p></o:p></pre>
<pre style="mso-margin-top-alt:0cm;margin-right:36.0pt;margin-bottom:0cm;margin-left:40.8pt;margin-bottom:.0001pt">CWB mailing list<o:p></o:p></pre>
<pre><a href="mailto:CWB@sslmit.unibo.it" target="_blank">CWB@sslmit.unibo.it</a><o:p></o:p></pre>
<pre><a href="http://liste.sslmit.unibo.it/mailman/listinfo/cwb" target="_blank">http://liste.sslmit.unibo.it/mailman/listinfo/cwb</a><o:p></o:p></pre>
</blockquote>
</div>
</div>
<p class="MsoNormal" style="margin-left:4.8pt">_______________________________________________<br>
CWB mailing list<br>
<a href="mailto:CWB@sslmit.unibo.it" target="_blank">CWB@sslmit.unibo.it</a><br>
<a href="http://liste.sslmit.unibo.it/mailman/listinfo/cwb" target="_blank">http://liste.sslmit.unibo.it/mailman/listinfo/cwb</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>