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 786621099D for ; Thu, 5 Dec 2013 08:59:34 +0000 (UTC) Received: (qmail 44410 invoked by uid 500); 5 Dec 2013 08:59:29 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 44347 invoked by uid 500); 5 Dec 2013 08:59:20 -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 44339 invoked by uid 99); 5 Dec 2013 08:59:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Dec 2013 08:59:18 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [132.187.3.35] (HELO mailrelay.rz.uni-wuerzburg.de) (132.187.3.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Dec 2013 08:59:10 +0000 Received: from virusscan-slb.rz.uni-wuerzburg.de (localhost [127.0.0.1]) by mailrelay-slb.rz.uni-wuerzburg.de (Postfix) with ESMTP id 0688876EA9 for ; Thu, 5 Dec 2013 09:58:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by virusscan-slb.rz.uni-wuerzburg.de (Postfix) with ESMTP id 01BA076EA8 for ; Thu, 5 Dec 2013 09:58:50 +0100 (CET) X-Virus-Scanned: amavisd-new at uni-wuerzburg.de Received: from mailmaster.uni-wuerzburg.de ([10.101.19.2]) by localhost (vmail002.slb.uni-wuerzburg.de [10.101.19.142]) (amavisd-new, port 10225) with ESMTP id OXwhe_x_LevX for ; Thu, 5 Dec 2013 09:58:49 +0100 (CET) Received: from [132.187.15.93] (win6093.informatik.uni-wuerzburg.de [132.187.15.93]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTPSA id CD4CA76EA7 for ; Thu, 5 Dec 2013 09:58:49 +0100 (CET) Message-ID: <52A04049.5050906@uni-wuerzburg.de> Date: Thu, 05 Dec 2013 09:58:49 +0100 From: =?ISO-8859-1?Q?Peter_Kl=FCgl?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: user@uima.apache.org Subject: Re: Problem writing ruta extensions References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Am 04.12.2013 18:33, schrieb Sebastian: > Hi, > > I'm highly interested in ruta, and its potential applications in industrial > applications. Right know I'm trying to create a simple toy condition > extension that is simply a case insensitive INLIST condition. It is > completely based on the InListCondition class, I also declared an > implementation of the IRutaConditionExtension interface. > > With primitve types everything seems to work great, except when the > condition is used with a variable : > > STRINGLIST MonthsList = {"january", ...}; > DECLARE Month; > ANY{INSENSITIVEINLIST(MonthsList) -> MARK(Month)}; > > I get a class cast exception when the condition is being created, because > MonthsList is a SimpleTypeExpression and I'm expecting a StringListExpression. > > Am I doing something wrong ? I suppose there is a way to resolve the > variable to the actual list, but I missed it somehow. > It's hard to say what went wrong. My first guess would be that there is a problem in your extension. I just verified that INLIST works at all (I haven't used it myself for a long time). The example works with INLIST: STRINGLIST MonthsList = {"january"}; DECLARE Month; ANY{INLIST(MonthsList) -> MARK(Month)}; Can you post the stacktrace of the exception? Or can you send me the source code of your extension (in case you do not want to post it on a public mailing list)? Anyways, the usage of INLIST makes only sense if you want to work on dynamic dictionaries that may change during rule execution. Have you taken a look at the MARKFAST or TRIE action? http://uima.apache.org/d/ruta-current/tools.ruta.book.html#ugr.tools.ruta.language.actions.markfast They already have options for case-insensitivity and are overall faster and more powerful. Best, Peter PS: You can, of course, also post a feature request on JIRA for adding a case-insensitivity to the INLIST condition :-) > Any ideas on how that could be done? > > Regards > > Sebastian >