[CWB] cwb-python

Stefan Evert stefanML at COLLOCATIONS.DE
Sun Apr 4 21:37:01 CEST 2010


Dear Yannick,

thanks again for sharing your combined CWB/Python interface!  I've  
managed to install now, but haven't had an opportunity to spend much  
time with it.  I hope that there will be an opportunity to play around  
with Python scripts soon ... do you have any demo scripts or so to get  
people like me started?

> If you're interested, please check out
> http://bitbucket.org/yannick/cwb-python/

I'd like to include this interface in the official CWB distribution  
(as a "Python API").  Would that be ok with you?  Do you want to keep  
it in the Mercurial repository, or could we upload it to the SVN at  
cwb.sf.net?

If you prefer to do the development in Mercurial, perhaps we can  
import releases into the sf.net SVN so that all CWB-related source  
code is available in a single place.


> I have modified the module so it uses only the "public" cl.h  
> interface instead of grabbing stuff from the internal data  
> structures. The sad thing is, before (i.e., using the internal  
> structures) I could make a list of all attributes, wrapped into  
> appropriate S- or P-attribute objects as needed whereas the public  
> API does not include any function to inquire the type/name of an  
> attribute or get a list of attributes for a corpus. (Or maybe there  
> is and I overlooked it because the Perl CWB::CL doesn't use it).

There is a good reason that the CWB::CL module doesn't provide  
attribute listings: the lack of an appropriate function in the CL  
library.  I've been wanting to add such a function for a long time,  
but never quite got around to it.  I'll add a feature request to the  
sf.net tracker.

As Serge pointed out, you can get attribute lists through the CQi  
client/server interface.  CQPserver grabs them from CQP's internal  
data structures (since it's just a modified version of CQP), precisely  
because they're not easily accessible through the CL API.

Best wishes & thanks again,
Stefan




More information about the CWB mailing list