[CWB] Structural attributes in CQP with values

Diana Santos dianamsmpsantos at gmail.com
Sat Sep 5 14:00:06 CEST 2026


Dear Timm,
Thank you for this.
As far as I understood from your advice and from the manual, I should,
instead of doing
cwb-encode ... -V mwe
do instead
cwb-encode ... -S mwe -V mwe_lema
and replace in the verticalized file
<mwe lema="whatever">
by
<mwe>
<mwe_lema whatever>
Is this what you mean?
This works, but I was wondering whether there was any command or trick that
from
<mwe lema="whatever" ...> (with several key value pairs)
would make cwb-encode at once <mwe_lema ..> etc, without explicitly
encoding it in the source file.
In case there isn't, I will write a Perl script to do it.
Thanks again
Diana

Timm Weber <timm.weber at fau.de> escreveu (sexta, 4/09/2026 à(s) 21:05):

> Hi Diane,
>
> you probably want to encode separate structural attributes for the
> attributes using -S. The s-attribute mwe will then only encode the bare
> span, while mwe_lema will encode the span and the attribute value for lema,
> etc. Refer to the corpus encoding manual (
> https://cwb.sourceforge.io/files/CWB_Encoding_Tutorial.pdf) section 5 for
> how to deal with XML attributes.
>
> Best regards
> Timm
>
>
> Am 04.09.2026 19:40 schrieb Diana Santos via CWB <cwb at sslmit.unibo.it>:
>
> Hi
>
> I have been studying the use of XML attributes in CWB
> https://cwb.sourceforge.io/files/CQP_Manual/4_3.html
> and testing it (in the CQPDemo DICKENS corpus,
> https://corpora.linguistik.uni-erlangen.de/demos/CQP/CQPDemo/frames-simple.html
> )
> but do not seem to be able to replicate this behaviour in my own corpora.
>
> In particular, instead of <np> etc I have just <mwe>, but with some
> values, such as .
> <mwe lema="jogo=de=palavras" pos="N">
> <mwe lema="cana=do=nariz"  pos="N" grupo="Cabeça" sema="corpo">
>
> But although I have tried to encode the corpora with -V mwe.lema, I still
> cannot get it, that is, I cannot do "simple" things like
> <np> a:[] []* </np> :: a.np_h = "bank";
>
> that is
> <mwe> a:[] [*] </mwe> :: a.mwe_lema = "cor"
>
> I suppose there is something in the encoding that I am doing wrongly?
> I can of course do
>
> <mwe> [] []* </mwe>
>
> but I cannot access the values of the key-values pairs. Can anyone help me
> with this?
> Thanks a lot in advance
> Diana
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20260905/3778fc8e/attachment.html>


More information about the CWB mailing list