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 99ADC106AF for ; Sun, 25 Jan 2015 23:36:39 +0000 (UTC) Received: (qmail 88891 invoked by uid 500); 25 Jan 2015 23:36:39 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 88835 invoked by uid 500); 25 Jan 2015 23:36:39 -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 88823 invoked by uid 99); 25 Jan 2015 23:36:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 23:36:39 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aleks.dimitrov@gmail.com designates 74.125.82.41 as permitted sender) Received: from [74.125.82.41] (HELO mail-wg0-f41.google.com) (74.125.82.41) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 23:36:11 +0000 Received: by mail-wg0-f41.google.com with SMTP id a1so6318208wgh.0 for ; Sun, 25 Jan 2015 15:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=hlSZgGWcadGF/LnGqRDywccGr/jITbo2KJZMnGUXElw=; b=lI1SDNu536+vr0oDEU9Lam5UmDr4bHILU68kjrxLxXGrtJ3sMPtJxm8Px6Ssj7JA/i Q2/KVvm+8PbWf23f8BD+0ITbHFmWIvcoWxMf3WxY0wVzsLXJLdc0Hry5Y7TuVEbcQRSi Bv8m6heuQWYZPd2YxP0tX/5mBcCadzjK5dphPpLHISiQX3132n0jP5NK/VCeRhaqZUhv vaTGmZ7rgSAvuyqKGr9rdJGYMVwn8Mx83yzWWGIITqYy9pWbkEUPV9xVOx9DaY2ywutO nSBnouTSj2b5OnLS81aGJiojHf7B59NXScBSQI3lhYC54bhvBMH36GAI5IPNRjPro15R oefA== X-Received: by 10.180.91.109 with SMTP id cd13mr20568865wib.46.1422228970462; Sun, 25 Jan 2015 15:36:10 -0800 (PST) Received: from minsk (stgt-5f72871d.pool.mediaWays.net. [95.114.135.29]) by mx.google.com with ESMTPSA id fo17sm11994155wjc.19.2015.01.25.15.36.09 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 25 Jan 2015 15:36:09 -0800 (PST) From: Aleksandar Dimitrov X-Google-Original-From: Aleksandar Dimitrov Date: Mon, 26 Jan 2015 00:36:00 +0100 To: user@uima.apache.org Subject: Re: Using OpenNLP type annotations with UIMAfit Message-ID: <20150125233559.GA9038@minsk> References: <20150125215945.GB28930@minsk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Checked: Checked by ClamAV on apache.org --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Thanks for taking the time to answer! Your mail helped lift quite some confusions I had. > No, it is not generated at runtime. It is generated manually or at build-= time, > e.g. using the maven-jcasgen-plugin. Right, I was wondering when that happened, and just thought it would be run-time, since I never saw the familiar .java and _Type.java files anywhere. > OpenNLP aims to be configurable with regards to types. So you must have *= some* > type system that you configure OpenNLP to use, right? Yes, the OpenNLP type system that ships with the OpenNlp source. Though I t= hink after our discussion, I might just switch over to my own type system (most = of which will be a verbatim copy.) > Open it in the Eclipse > UIMA Type-System Editor and hit the "JCasGen" button - it will generate t= he > JCas classes that you can use with uimaFIT JCasUtil. I'm not using Eclipse, but I believe that maven-jcasgen-plugin would help me here. > typeSystemInit() is meant for CAS-based analysis engines, not for JCas-ba= sed annotators.=20 Oh, that's interesting! I was confused, because its an overridable method f= or JCasAnnotator. > You need the CAS-based API only if you want to configure your components = at > runtime with regards to the annotation types they should use. So that's the way OpenNLP does it? > If you can stick to a specific type system, use the JCas-based analysis > engines. I can, and I think I shall. > The CAS-API is not type-safe. Neither is the UIMA-JCas API, but the uimaF= IT JCas-API is ;) Rigt, so I usually dislike having to have the JCas-Gen-generated files lying around (no real reason, except that it adds another step to the source setup and compilation process, and I'm not using Eclipse) but I *very* much enjoy uimaFIT's type safety in AnalysisEngines, so I think I'll bite the bullet. > You could alternatively use an alternative OpenNLP binding for UIMA, e.g.= the > one provided by DKPro Core [1] (not an Apache project, but one I'm workin= g on > too). I've been looking at and reading the DKPro code extensively. It's nice and = easy to read, and has helped me along with finding solutions to some problems (I've been using it mostly as example code for an uimaFIT setup!) Just this one I couldn't figure out :-) And sometimes I chose different ave= nues, for example I ended up using a URLStreamHandlerFactory instead of dkpro's ResourceUtils.resolveLocation() to load my resource files from within JARs = (or indeed any other location.) Cheers, Aleks --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJUxX3fAAoJEA4fDuQpC7qFFC4P/jvL9yx97z3kvO+rNV3iaX6C J5jFijuVkVLeDY3/qIQg8Pllcn143jSH8NnmM18rGmOf5OsuReZAa/WdCeXOsbo1 BX5B9g7gl7URPcedYaMHhZbgycDU5reFvCgUO62VXeDED1gpo3nPmhiX0cAYsK3J QBkOjoSIVCJ3V3wk8CNJLTD1JICLcr7oe0X0pHwPECD+mfpACJ+7LfplV2IcKjEC UNAbKADaSNB8cdXKjLBPsrKPuD6sgIDZuRugbf3zNBDd2LfSSwe02iD+cCIyAg0e obOsiyec332tMnw9bdGh1HjvHV+zCJpTqdZgFqGym8adDBbPHF8P2OzWvUyNlJkA YILBVfATw2m0uz2M3ObBfxKSLRVWIbRcpaq5m95J/parAgDbiXi7bA5Mgst7vgzN jMiPg/aJkHhGbDVPSXRxqM/ZXc59550q+Pwx/iZW1/o0kqb7BW3vuSo9tP2zTXl2 MCElK8r0wHxqBEcvURv14P/gM84WCqrwoX0D4sjzntuHZYDx53y5dl6G4tPTzYJ7 d0JCfbOW4v5YF0Rf5ZIEtnsLOIJ6Wu3lRINooNuLGvqCK6/yxyl0ekzM7H7SmG/S l7qSqJolzzsYeJjEXpFq2zPrZepO0eovjjKsrZRDFRieduDohiGLWDT8jjlEl0P2 aG52o5Ne6IMyEOgAsbqf =aU14 -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--