Am 31.05.2017 um 09:59 schrieb Peter Klügl:
Hi,
Hi Peter,
Am 30.05.2017 um 19:35 schrieb Sumit Madan:
We were not able to access the annotation within the BLOCK.
###
STRING s;
BOOLEAN a ;
// This is not working for us:
BLOCK(forEACH) Lemma{}{
Lemma{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
Lemma{a ->Test1};
}
// This is working:
BLOCK(forEACH) Lemma{}{
W{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
W{a ->Test2};
}
// This is also working:
BLOCK(forEACH) Lemma{}{
Document{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
Document{a ->Test3};
}
###
All three examples should work. Which ruta version do you use? It looks
like a bug.
Lisa is testing again and will get back to you.
We weren't aware that we can use contains() as a condition too. I
think the documentation [1] doesn't describe that String functions
with return value boolean can be used as conditions. I think one can
assume if you see the source code (public class
ContainsBooleanFunction extends BooleanFunctionExpression) under [2].
[1] https://uima.apache.org/d/ruta-current/tools.ruta.book.html
[2]:
https://github.com/apache/uima-ruta/blob/trunk/ruta-core-ext/src/main/java/org/apache/uima/ruta/string/bool/ContainsBooleanFunction.java
Thank, I'll extend the documentation.
Thank you!
Hmm, I do not know, this sounds all correct. Did you switch the CAS view
in the CAS Editor?
It's working now. The commit, which activated the second debug option,
was not included on our developement environment. That's why the views
were empty. The views are very helpful to get an fast overview over the
failed and matched rules.
Best,
Peter
--
Mit freundlichem Gruß / Best regards
Sumit Madan, M.Sc.
Wissenschaftlicher Mitarbeiter / Research fellow
Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Department of Bioinformatics
Schloss Birlinghoven
D-53754 Sankt Augustin
Room: C3-242
Tel.: +49 2241 14 2997
Email: [email protected]
Internet: http://www.scai.fraunhofer.de/