Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0046200B25 for ; Wed, 8 Jun 2016 13:45:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AE6FD160A2E; Wed, 8 Jun 2016 11:45:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 05528160A29 for ; Wed, 8 Jun 2016 13:45:48 +0200 (CEST) Received: (qmail 92171 invoked by uid 500); 8 Jun 2016 11:45:47 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Delivered-To: moderator for java-user@lucene.apache.org Received: (qmail 88077 invoked by uid 99); 8 Jun 2016 11:45:11 -0000 X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=FeFfdRvq79YWMTODPxx+56sLz6L2PEdnNaaofK4P/sY=; b=eafEtTDKH+3lcyNVdUWhLo/o/yAQJCgSUltqIitq5Lmlx+l4sClkOVvnToobO+hCZO CPzFjRPNcO8zpVV2UVAJM6LafOcDY1Xf7jgsvxIVvh3jydOvfXt5H79qpRLOB1nnFqHH IvPNxMcScBfNa9gPJCM3ZdDkohHleU8mmwltf9Dh10/cc4xyM+mEd3NdRdrH2a7RGVzU GFbfEWUgBwW+2W9j/0p7FSpOuQ8olSr4V9bVgIJcYwLK7JLvwL4548hq/1hLEwe7vD+G Bzc8hAd52SABjpODLddYoQkPP/Cq5/GYLHwZ4L77/wwoGdjf/xKZ9KJUY8CcbeQaRvvx YOyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FeFfdRvq79YWMTODPxx+56sLz6L2PEdnNaaofK4P/sY=; b=X22G5JK5BLQMYYGiTBR/qx1WA2WHYAibG6NPt3y79+1cjp7IepducD2pv8FognNeT7 ZWCY96VLWxVS8H+G8cyLKunEU3EdswDKslM95qa5Ddw+kJQeS5d3QngtU8B/npKDQGzW Vm6AnKgcIA0lPC9GH7lPpM/IFjWyMVXCpQjCKoPgUSPgdD5gJs7TjuFSPXB4KTGYvl04 OrR03k/3NbDXGM4dESLBOBUFNmhy+fR0uTloRywNNLiQrvbx2hFg0JRRg22qs/fS/D4P IlXPrakLlEao/w1iabA51pHzTCEfb0AMSRnOULfJqS8o77WwuihYtTjRCL4PLSigsWmJ JKRw== X-Gm-Message-State: ALyK8tLXNeUoMZekVMNpSQXR/JRXHUmIpxgy2+pwKdklD4YQ1Dok+dHhvwpg25kx5D6vB6GDAX7qQhABb9hA1A== X-Received: by 10.46.5.67 with SMTP id 64mr1253017ljf.12.1465386307946; Wed, 08 Jun 2016 04:45:07 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Michal_Kraj=C5=88ansk=C3=BD?= Date: Wed, 08 Jun 2016 11:44:58 +0000 Message-ID: Subject: Custom TokenStream + custom Attributes To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a114a6a52580df40534c2d659 archived-at: Wed, 08 Jun 2016 11:45:49 -0000 --001a114a6a52580df40534c2d659 Content-Type: text/plain; charset=UTF-8 Dear Lucene users, I have implemented a custom tokenizer (derived from TokenStream). I need to pass additional attributes to those standard in Lucene (PositionIncrementAttribute, OffsetAttribute), that would represent the word position in the tokenized sentence in the number of words and not characters, as one usually passes through OffsetAttribute. (I need both.) Is there a way of achieving this? I tried to implement own Attribute class (derive a new interface and implementing class). The code compiles ok but I am getting exception at runtime about the class casting. Thank you a lot in advance, MK --001a114a6a52580df40534c2d659--