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 803A318AC9 for ; Thu, 12 Nov 2015 13:12:59 +0000 (UTC) Received: (qmail 37780 invoked by uid 500); 12 Nov 2015 13:12:56 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 36964 invoked by uid 500); 12 Nov 2015 13:12:56 -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 35985 invoked by uid 99); 12 Nov 2015 13:12:55 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Nov 2015 13:12:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E545418098E for ; Thu, 12 Nov 2015 13:12:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JZSLSrI5hVrb for ; Thu, 12 Nov 2015 13:12:53 +0000 (UTC) Received: from mail-yk0-f181.google.com (mail-yk0-f181.google.com [209.85.160.181]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 572F521277 for ; Thu, 12 Nov 2015 13:12:53 +0000 (UTC) Received: by ykfs79 with SMTP id s79so93933105ykf.1 for ; Thu, 12 Nov 2015 05:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=wKn/pvOLUwR6V9fQQThbMKKsl4wX9mkM3OZZlwGEuI0=; b=nbI8rqbUAfXc3E21S50Lb7jUqyBJQMDnKKwFwNCysAxXO8eM9U5qtjj9J71IYlf/6L NRPtm2Q3YcPifrHDNm5JIR3kElJrPXFqwLCyLoRC3A5/2bwJHl8FvzHzxPYx/DJekRxf Jys4He38rYFnCAOvFYBlX1sjwTOBNShSAI7fzakt4XxxOcsbCgbcpHsPrw+zk28aLZY8 Ukby0Z8Dgy/jHuwoSScBym7/TmCf3cMldA7yynP4a+d24xBqIaTIO/D0bsFJRHd56+8H 1KJn2auTn7ZP6XNzjjneTR9vQQYZ5zGtpl3HKaAK2oigYIbQrBwp+xd3TaTWi1zJ/WC4 lXFw== MIME-Version: 1.0 X-Received: by 10.13.250.66 with SMTP id k63mr16623366ywf.183.1447333966383; Thu, 12 Nov 2015 05:12:46 -0800 (PST) Received: by 10.129.85.6 with HTTP; Thu, 12 Nov 2015 05:12:46 -0800 (PST) Date: Thu, 12 Nov 2015 14:12:46 +0100 Message-ID: Subject: how to call UIMA Ruta from uimaFIT From: Olivier Austina To: user@uima.apache.org Content-Type: multipart/alternative; boundary=94eb2c06602af014e2052457b27d --94eb2c06602af014e2052457b27d Content-Type: text/plain; charset=UTF-8 Hi, I try to call a simple UIMA ruta script from uimaFIT in java. It works in plain UIMA but it didn't work in uimaFIT for me. Here is the script: PACKAGE tutorial.entity; WORDLIST MonthsList = 'month.txt'; DECLARE Month; DECLARE Year; DECLARE Date; Document{-> MARKFAST(Month, MonthsList )}; NUM{REGEXP("19..|20..") -> MARK(Year,1,2)}; Month Year {-> MARK(Date,1,2)}; Here is the java code (based on Ruta doc example): //System.out.println( "Hello World!" ); File specFile = new File("/home/olhome/software/workspace/rutatest1/dateproject/descriptor/tutorial/entity/DateEngine.xml"); XMLInputSource in = new XMLInputSource(specFile); ResourceSpecifier specifier = UIMAFramework.getXMLParser(). parseResourceSpecifier(in); // for import by name... set the datapath in the ResourceManager AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier); CAS cas = ae.newCAS(); cas.setDocumentText("This is my document. March June December"); ae.process(cas); JCas jcas = cas.getJCas(); for (Month month : JCasUtil.select(jcas, Month.class)) { System.out.println(month.getCoveredText()); } This is the pom dependencies: org.apache.uima ruta-core 2.3.1 org.apache.uima uimafit-core 2.1.0 I have the following error: Exception in thread "main" java.lang.Error: Unresolved compilation problems: Month cannot be resolved to a type Bound mismatch: The generic method select(FSArray, Class) of type JCasUtil is not applicable for the arguments (JCas, Class). The inferred type Month is not a valid substitute for the bounded parameter Month cannot be resolved to a type at tuto.tuto_step0.App.main(App.java:51) It seems that I am not able to correctly import types like in the maven example. I am not so familiar with maven. I have put the DateTypeSystem.xml in a folder called tuto under src folder and add the line "classpath*:/tuto/DateTypeSystem.xml" in the text file src/META-INF/org.apache.uima.fit/types.txt. Any suggestion is welcome. Thank you. Regards Olivier --94eb2c06602af014e2052457b27d--