Hi Peter,
Thank you for the quick answer, it works now !
Best regards,
Fouad
Le 25 juin 2013 à 17:45, Peter Klügl a écrit :
> Hi,
>
> the important part is missing in the documentation. Sorry for that, I
> will fix the documentation.
>
> EXEC has another parameter, a list of types, which are internally
> reindexed in Ruta. This is necessary for therule inference and
> conditions like PARTOF, which would be extremely inefficient otherwise.
>
> If you use the following rule, then you are able to match/use all
> annotations, which are added by the HtmlAnnotator
>
> Document{-> EXEC(HtmlAnnotator, {TAG})}; // or only "{A}" in your case
>
> There might be another problem, if you set the parameter "onlyContent"
> of the HtmlAnnotator to false. Then, you additionally need to make the
> markup annotations visible:
>
> Document{-> RETAINTYPE(MARKUP)};
>
> I hope this helps.
>
> Best,
>
> Peter
>
>
> On 25.06.2013 17:13, Fouad HAMDI wrote:
>> Hi,
>>
>> I am currently trying the Ruta workbench and I would like to know if it is
>> possible to refer to annotations put by an engine from a script.
>>
>> Here is a simple example: I want to analyze an html document and I would
>> like to mark all the links inside the document. I write this script:
>>
>> ENGINE utils.HtmlAnnotator;
>>
>> TYPESYSTEM utils.HtmlTypeSystem;
>> DECLARE Link;
>>
>> Document{-> EXEC(HtmlAnnotator)};
>>
>> org.apache.uima.ruta.type.html.A {-> MARK(Link)};
>>
>> I test with the following input:
>>
>> <html>
>> <body>
>> <ul>
>> <li><a href="#">Link 1</a></li>
>> <li><a href="#">Link 2</a></li>
>> </ul>
>>
>> <p><a href="#">Link 3</a></li></p>
>> </body>
>> </html>
>>
>> In the output, I expected to find 3 "Link" annotations but I obtained none.
>> However, the output file contains the "org.apache.uima.ruta.type.html.A"
>> annotations as expected.
>>
>> I didn't find how to use the annotations put by an engine on the document in
>> the remaining of my script.
>>
>> I conclude that the Document object annotated by the engine is not
>> accessible from the script after executing this engine.
>>
>> Is this possible to do such an operation in RUTA scripts ?
>>
>> Thank you for your help.
>>
>> Best regards,
>> Fouad
>