Continuing to what Matt said, answer to your question: there is no direct library to give this. Also try sandbox based "highlight" related code base.
Best Regards, Aditya -----Original Message----- From: Matthew Hall [mailto:mh...@informatics.jax.org] Sent: Monday, May 18, 2009 6:58 PM To: java-user@lucene.apache.org Subject: Re: how to get the word before and the word after the matched Term? 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 String 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 intervals . Eleven courses were administered to seven patients at this dose level and no patient experienced nausea or vomiting" and the matched Term for 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 position of the matched Term, how can i get the word before and after it, any suggestion?. > Thank you in advance. > Kamal > > ------------------------------------------------------------------------ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org -- Matthew Hall Software Engineer Mouse Genome Informatics mh...@informatics.jax.org (207) 288-6012 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org