[CWB] Structural Attributes

Ruprecht von Waldenfels ruprecht.waldenfels at gmx.net
Tue Nov 18 14:49:35 CET 2014


Dear Maarten,

as to (1), I think you can use

[word=".*ion"] []{3,5} [pos="V.*"] :: match.text_year="1900"


as to (2), I think there's something in the Tutorial - maybe tabulate, 
but I'm not sure.
Best,
R

Am 18.11.2014 um 16:21 schrieb Maarten Janssen:
> Dear all,
>
> Structural attributes are very sparsely documented, yet very useful when working with, say, individual texts with a year indication. Here are two things I cannot figure out whether they are possible with structural attributes:
>
> (1) When using a (potentially) complex CQL it would be useful to be able to restrict that whole query to texts of a specific year, say
>
> [word=".*ion"] []{3,5} [pos="V.*"] :: text_year="1900"
>
> yet this does not work since structural attributes always seem to need an anchor - is there a way to specify something like this directly without anchoring one of the elements? (which would be the somewhat artificial a:[word=".*ion"] []{3,5} [pos="V.*"] :: a.text_year="1900")
>
> (2) Is there any way to sort results on structural attributes? Nothing of the things I tries works, the most obvious being:
> 	
> 	Matches = [word="in.*"];
> 	sort Matches by text_year;
>
> Maarten
>
> ps : an observation that might be useful for some: the int-cast only works if the structural attribute is a number in the XML - so
>
> a:"in.*" :: int(a.text_year) > 1850
>
> only works for <text year=1900>, not for <text year="1900">
>
> unfortunately, this makes it impossible to use approximate year indications, often encoded as <text year="[1900]">
>
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://devel.sslmit.unibo.it/mailman/listinfo/cwb



More information about the CWB mailing list