[CWB] Empty XML tags not showing in CQP

Stefan Evert stefanML at collocations.de
Tue Jun 12 18:04:56 CEST 2018



> Is there any way I can make CQP to show empty XML tags in queries results (so I can visualize them in CQPWeb)?
> 
> I have tags like these: 
> 
> <inf id="E1"></inf>
> 
> (because it seems that cwb-encode doesn't like the shorter form <inf id="E1"/>)

That's because CWB doesn't support empty XML elements.  It accepts the long from with explicit start and end tags, but will simply ignore the empty regions.

In BNCweb, we store empty XML tags in a p-attribute that collects all tags that occur immediately before the respective token; a second p-attribute contains a pre-processed (feature set) representation for easier searching.

Unfortunately, CQPweb can't visualize arbitrary p-attributes yet, so this would help for searching but nor display.  I think the only work around would be to move the end tags so that the XML element wraps the following token:

<turn>
<inf id="E">
okay
</inf>
ya
son
las
horas
ah
</turn>

and then define a suitable visualization for the start tag <inf> in CQPweb, but not for the end tag </inf>.

Best,
Stefan


More information about the CWB mailing list