LanguageMachines / foliautils

Command-line utilities for working with the Format for Linguistic Annotation (FoLiA), powered by libfolia (C++), written by Ko van der Sloot (CLST, Radboud University)
https://proycon.github.io/folia
GNU General Public License v3.0
4 stars 3 forks source link

FoLiA-abby: metric info #58

Closed pirolen closed 3 years ago

pirolen commented 3 years ago

I am trying to access the metric elements' values, generated by FoLiA-abby on the paragraph level, e.g. as <metric class="first_char_top" value="368"/>

I can only access the class, using foliapy (as e.g. mymetric.cls). How should I get the value? (The 'Metric' object has no attribute 'value'.)

Not sure this is related, but I did foliavalidator --deep on the file and got:

Loaded set https://raw.githubusercontent.com/proycon/folia/master/setdefinitions/text.foliaset.ttl (19 triples) VALIDATION ERROR on full parse by library (stage 2/3), in (path)

ParseError: FoLiA exception in handling of @ line 73 (in parent

@ parent line 66) : [DeepValidationError] Set definition FoLiA-abby-set for metric not loaded (feature validation failed)!

Line 73 is the first occurrence of a metric element.

proycon commented 3 years ago

The value for metric is a so-called Feature, try: metric.feat("value")