[CWB] Basic sort on structural attribute

Ruprecht von Waldenfels ruprecht.waldenfels at gmx.net
Fri Oct 20 18:28:26 CEST 2017


Dear Stefan - thanks!
I understand. About the longer explanation, I hesitate to make you spend 
the time laying this to me - maybe there is some document out there? 
Surely this is not the first time this has cropped up.
Otherwise - yes, I would love to hear that!

(BTW, one obvious hack to solve this problem would be to encode the same 
corpus several times, ordering the input data in different ways. Maybe 
that IS the most efficient solution in terms of time).

Best,
Ruprecht

Am 20.10.2017 um 18:18 schrieb Stefan Evert:

>> On 20 Oct 2017, at 17:04, Ruprecht von Waldenfels 
>> <ruprecht.waldenfels at gmx.net> wrote:
>>
>> a basic question: how do I sort on a structural attribute?
>>
>> Something like the following doesn't seem to work.
>>
>> "in" sort by match.meta_year
>>
>> with meta_year being a structural attribute ( i.e., an xml element 
>> enclosing a stretch of text).
> Short answer: you can't.
>
> Long answer: you can't because p-attributes and s-attributes use 
> entirely different data structures and API functions. The code 
> underlying "sort" and "count" commands only handles p-attributes; we 
> don't plan to extend it to s-attributes because it's more than 
> complicated enough already as it is. The code underlying "group" 
> includes special branches for s-attributes because users often want to 
> be able to do frequency counts for them.
>
> Ziggurat is going to put and end to this divide between p-attributes 
> and s-attributes, but it's still some way off …
>
> Best,
> Stefan
>
> PS: If you really need to sort by an s-attribute, you can use a clever 
> combination of "tabulate", Unix "sort" and "undump".  Let me know if 
> you want a longer explanation of this approach.
>
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://liste.sslmit.unibo.it/mailman/listinfo/cwb

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20171020/068d1a55/attachment.html>


More information about the CWB mailing list