Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 86984 invoked from network); 18 May 2009 13:35:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 May 2009 13:35:49 -0000 Received: (qmail 8526 invoked by uid 500); 18 May 2009 13:35:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 8489 invoked by uid 500); 18 May 2009 13:35:46 -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 Received: (qmail 8479 invoked by uid 99); 18 May 2009 13:35:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 13:35:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [129.187.254.106] (HELO mailrelay1.lrz-muenchen.de) (129.187.254.106) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 13:35:37 +0000 Received: from klio.ze.tum.de (klio.ze.tum.de [129.187.39.43]) by mailout.lrz-muenchen.de with ESMTP for java-user@lucene.apache.org; Mon, 18 May 2009 15:34:51 +0200 To: CC: From: Kamal Najib Subject: =?iso-8859-1?q?Re=3A_Re=3A_how_to_get__the_word_before_and_the_word_after?= =?iso-8859-1?q?__the_matched_Term=3F?= Date: Mon, 18 May 2009 15:34:49 +0200 Mime-version: 1.0 Content-type: Multipart/mixed; boundary="===============2470726948616540627==" Message-Id: X-Virus-Checked: Checked by ClamAV on apache.org --===============2470726948616540627== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Thank you for the reply. Kamal Original Message: Well, when you get the Document object, you have access to the fields in =
that document, including the text that was searched against.

You could simply retrieve this string, and then use simple java Strin= g =
manipulation to get what you want.

Matt

Kamal Najib wrote:
> Hi all,
> I want to get the word before and the word after the matched Term= .For Example if i have the Text " The drug was freshly prepared at 4-hour i= ntervals . Eleven courses were administered to seven patients at this dose = level and no patient experienced nausea or vomiting" and the matched Term f= or example "patient" i want to get the word level and the word experienced(= "and" and "no" are stop words, therefore i d'ont want to get them.).I have = looked at the Class Termposition but in this Class i can only get the posit= ion of the matched Term, how can i get the word before and after it, any su= ggestion?. =
> Thank you in advance.
> Kamal
> =
> -------------------------------------------------------------------= -----
>
>
> -------------------------------------------------------------------= --
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


-- =
Matthew Hall
Software Engineer
Mouse Genome Informatics
mhall@informatics.jax.org
(207) 288-6012



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

--=20 --===============2470726948616540627== Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --===============2470726948616540627==--