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 966371055E for ; Sun, 25 Jan 2015 22:02:39 +0000 (UTC) Received: (qmail 14109 invoked by uid 500); 25 Jan 2015 22:02:39 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 14069 invoked by uid 500); 25 Jan 2015 22:02: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 14052 invoked by uid 99); 25 Jan 2015 22:02: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 22:02: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.170 as permitted sender) Received: from [74.125.82.170] (HELO mail-we0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 22:02:12 +0000 Received: by mail-we0-f170.google.com with SMTP id w55so701263wes.1 for ; Sun, 25 Jan 2015 13:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=hp/XR8o72nNVFxV4J0xotmc+Jq3JqbaApef0P0BuGvg=; b=0OIhgq27ukS+NdJOeqVowFfKKlDkSGTCZ49SPhYi06LCIr11hoHcEFpi9ik9H/vLBr bI6wjTxv9eJ6yzOlYidjmn7NniJd2CoMWl7pBVb0P+6IR0Kx7oLxaHA9KckZBW3ZFp1W C3PzaAJd69VCaYkna1qzyfKTGeMHvGF4k2MX1x/pp/yJQmde5QDJropNTQzNODpbuZRW F4QVFM23PMzIuVUi2hPtoS/3Rrx4z5a+jsibInGLOtVSrJD3IixJvhq89ld4nZ3Am87x FKwrTPcwxFMFrL+zxv8Ne6xFK57Zu2XHgBuRc5WXhIzdV3hLvCAaO+M2gaC9+anSC2X1 bs6g== X-Received: by 10.194.24.103 with SMTP id t7mr38003122wjf.15.1422223195812; Sun, 25 Jan 2015 13:59:55 -0800 (PST) Received: from minsk (stgt-5f72871d.pool.mediaWays.net. [95.114.135.29]) by mx.google.com with ESMTPSA id dt10sm11317011wib.23.2015.01.25.13.59.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 25 Jan 2015 13:59:55 -0800 (PST) From: Aleksandar Dimitrov X-Google-Original-From: Aleksandar Dimitrov Date: Sun, 25 Jan 2015 22:59:45 +0100 To: user@uima.apache.org Subject: Using OpenNLP type annotations with UIMAfit Message-ID: <20150125215945.GB28930@minsk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Checked: Checked by ClamAV on apache.org --GID0FwUMdk1T2AWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, The UIMAfit manual (5.1) states that the preferred way to iterate over tokens in the CAS is the following: // JCas version for (Token token : JCasUtil.select(jcas, Token.class)) { ... } This assumes a Token.class is importable somewhere. But I'm using the OpenNLP tools, which don't provide such a type. Instead, it seems to be generated at run time during configuration steps, and is not accessible as a class in the AE (to my knowledge.) Additionally, when extending o.a.u.fit.component.JCasAnnotator_ImplBase instead of o.a.u.component.JCasAnnotator_ImplBase, the method void typeSystemInit(TypeSytem) is not provided, which makes instatiating the type system the same way OpenNLP does it rather cumbersome (I generate an empty CAS with the typSystemDescription, then get its TypSystem and provide the Type and Feature objects from this TypeSystem instance as UIMAfit configuration parameters before deploying my AE.) Even then, I can only use the less type-safe method of iterating over annotations: for (AnnotationFS token : cas.getAnnotationIndex(tokenType)) where tokenType is the Type instance I acquired from the TypeSystem either during typeSystemInit() or during configuration with the above hack. Is there some good way of solving this dilemma while still using UIMAfit's classes? Obviously, I could go back to using just plain UIMA, but I quite like UIMAfit's way of dealing with external resources! And I don't like the type-system-through-cas hack. I'm using opennlp-uima 1.5.3 and uima-fit 2.1.0, uima 2.6.0. Cheers, Aleks --GID0FwUMdk1T2AWN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJUxWdRAAoJEA4fDuQpC7qFPKUP/j2CS0RgZANS1lXOen9Oma0H lDMtNCN+m8YpfT3PZ/F1oPfjDcSlCJ4Vo01iGU025jj1bJC4bRRqBaSyvnhw7TEw 22sNPzV4oRx2tlJG8c1u2Joc/zEIwU7C0aPuHMUB3MEPX27eZBxGm9f44pXUs9SW GkVVSnwFwKa2kMzPrQcUCLKf0i9BjbD84taSUAh4yBLGoJc+oqmB/gRDnOjdP4UB uqlo+4GSMFs3tRTEesKXrtMbq7dQVRo/BG/LZQyoxrHSxdnQLpfCPfuJWZ86lpoz 81lozj4+fs/CoF/hHcvkYQdFtwK+qxhu3qNT6C4Y21x+jq8l0fTMfoLiCSqzLU/d +4osW5UC8Uy8Zdm9KaXcS0wpowUCmIn2XahfxxrAPsM3nvSnfQWAcXtL53qacyoi ozgrj0fHfqwv3Dc3pWvyy7AzTQisAJiZGnU6HsK11eDXF4wXv3chR6Oktfxcl9kT XWr+oeek2fdxe66Qt+qKUMsJczaD0eeSZYgY2LW7OehPG1HK7B/EvZT6T7TE65Ds aHEbwHRd4PrEAv/KgoqEL73bFulx191GhaicKQrAdSvRO29FRRtAzXLORMvONFk8 xY/kr+FOjZlBgcNpbE2Mmc/XZ+yg/fh3f3G3Bhy21aHZxODC2qe4/UC1VVGBG4d4 Bn/L5JdOcrJgte9INLzJ =PsE4 -----END PGP SIGNATURE----- --GID0FwUMdk1T2AWN--