From user-return-7511-apmail-uima-user-archive=uima.apache.org@uima.apache.org Wed Apr 26 16:11:28 2017 Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8CD019439 for ; Wed, 26 Apr 2017 16:11:28 +0000 (UTC) Received: (qmail 29974 invoked by uid 500); 26 Apr 2017 16:11:28 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 29926 invoked by uid 500); 26 Apr 2017 16:11:28 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 29915 invoked by uid 99); 26 Apr 2017 16:11:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2017 16:11:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C64D7CA74F for ; Wed, 26 Apr 2017 16:11:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.796 X-Spam-Level: X-Spam-Status: No, score=-1.796 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kp0_X9CGqSaa for ; Wed, 26 Apr 2017 16:11:26 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D916A5FCDD for ; Wed, 26 Apr 2017 16:11:25 +0000 (UTC) Received: from [192.168.11.108] ([212.60.243.34]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LtDGF-1e5roa1fx5-012oeD for ; Wed, 26 Apr 2017 18:11:19 +0200 Subject: Re: Ruta: order while execution of actions in rule? To: user@uima.apache.org References: From: =?UTF-8?Q?Peter_Kl=c3=bcgl?= Message-ID: <1799b41d-4c37-4c33-7e0a-eb408f12cc43@averbis.com> Date: Wed, 26 Apr 2017 18:11:19 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:nY8HBVaiRbBIX/Zb/OvnTpqWTR1nClXLsUTeSytO5P53tOgcfiF xujHD+uyRn/79mdW5grOGnaoQ003b2H7wzMP5MX4bkXFMV7/mmoWgUPnSCtqZdqM7e/XgiI prhjH4LfM2o1oIv7DJxKPV6WRkLS+0Ydc2Gnhi5bOLPNfD7lKlROAGCdQ5592zLbKysBODp LS29zzomd3q0VjqcdRjwA== X-UI-Out-Filterresults: notjunk:1;V01:K0:JZehZ9/tBAA=:B8bNuFus/ycMzJ8DOQ1app WHUd7lSC+7KYJU68sRFpDplVeE+1kJFaHpkYSkkB6qRgPoUaoXl8Cy/VimBVxHgP4+MJE/rQi mSS2NDwzudBFKa1o9Tfp8QJzl4awBSS+Mbre0zVFxaI++hOWlef5HYQlVShIvaGqfRE8vETON q/kZEl8jTO9jlLiJC1tkgZTjxy52GAuB2cS/XWe9sI4j1cFrakP+588icypQIeMU4ipvjoMbq K09dZkSVfEe62KCcE9feRgYb4zviFEGE0xstg1+W4A+brEYX6IggHgQHpN7abj2cjdGL/udfv 9s/puyOxU75R5eUvHOYKOfvV69O9qC3TWmfs5waV7OH701qZCV8OcNVysADP62JhdspZ+/FYx +IhMg3/FQUG1NgSEcyygYHvjgligAkXkX7H6uXT4MazSeKhy8PSoxsJu8a1ZkrzoTcG9O3xMU RzsydY2ltajJznZ4ZOHorZVugcNt0GO9mT8QDAS5SyL8A0m6adYUE8Lg2N499WLJmVRnBJPRO iS6IiVnBkICcrIjWXVONvq8caGWB6rxqblVDXVI4Sp9Va1Kuo+3L5oYszrk9S9tSmNgyuW1K2 GDrfaCzBpIujAr0d/VWwtEp1Yuri1jfOq1HcyyL+ykR6o7IjcgW7MGoIIFn7I7lWR1LRuJg46 xYqMbUisuYXA2mRWm2Fr9vW+WKaiGp0UzGhdwT45VqLSzhjL7CV8GFi3id5J5OQtuG0l+B3Fx W5dk3OthpXaX9Aq2 Hi, just a quick comment... The actions are executed from left to right. I tried to reproduce it (ruta 2.6.0). There seems to be a bug affecting the FLOAT variable. When I replace the line FLOAT a2,a1; with DOUBLE a2,a1; it seems to work. I need to investigate it further in order to narrow down the cause. Best, Peter Am 26.04.2017 um 14:18 schrieb Wolf-Dietrich Materna: > Hello, > I have a problem with the execution order of actions in rules. > I want to use Ruta to extract numeric values and convert them for different units. > Example input & expected output: > “10 %” => annotation “Percent” with value 10.0 > “10 ‰” => annotation “Percent” with value 1.0 > I wrote some simple rules for testing: > DECLARE Annotation Percent(STRING class, FLOAT value, STRING unit ); > FLOAT a2,a1; > // works as expected: value is 10.0 for input "10 %" > (NUM{PARSE(a1)} "%") {-> CREATE (Percent, "value" = a1, "class" = "Percent", "unit" = "%")}; > // Example 2: => returns wrong value 0.0. ASSIGN() is excecuted after CREATE() ? > (NUM{PARSE(a1)} "‰") {-> ASSIGN(a1, a1/10), CREATE (Percent, "value" = a1, "class" = "Percent", "unit" = "‰")}; > I tried Ruta 2.3.1 and 2.6.0, but the second rule doesn’t work as expected. > The Percent annotation, which is created for “10 ‰”, has the value 10.0. > > It seems that the CREATE() action is executed before the ASSIGN() action. > Is there any way to force Ruta to execute the ASSIGN() as first action? > I expected that Ruta executes the actions from left to right, but in this case the order is different. > I already tried other variants of the second rule, but this didn’t help: > // returns value = 0.0 in annotation > NUM{PARSE(a1) -> ASSIGN(a2, a1/10.0)} Tmpp10 {-> CREATE (Percent, 1,2, "value" = a2, "class" = "Percent", "unit" = "‰")}; > Thank you in advance for an explanation or hint to solve the issue. > Wolf-Dietrich Materna > > >