lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal Najib <kamal.na...@mytum.de>
Subject Re: RE: how to get the word before and the word after the matched Term?
Date Tue, 19 May 2009 12:42:12 GMT
Thank you for the reply Aditya,
Kamal.
Original Message:

Continuing to what Matt said, answer to your question: there is no direct
<br />library to give this.
<br />Also try sandbox based "highlight" related code base.
<br />
<br />Best Regards,
<br />Aditya
<br />
<br />
<br />-----Original Message-----
<br />From: Matthew Hall [mailto:mhall@informatics.jax.org] 
<br />Sent: Monday, May 18, 2009 6:58 PM
<br />To: java-user@lucene.apache.org
<br />Subject: Re: how to get the word before and the word after the matched Term?
<br />
<br />Well, when you get the Document object, you have access to the fields in 
<br />that document, including the text that was searched against.
<br />
<br />You could simply retrieve this string, and then use simple java String 
<br />manipulation to get what you want.
<br />
<br />Matt
<br />
<br />Kamal Najib wrote:
<br />> Hi all,
<br />> I want to  get the word before and the word after  the matched Term.For
<br />Example if i have the Text " The drug was freshly prepared at 4-hour
<br />intervals . Eleven courses were administered to seven patients at this dose
<br />level and no patient experienced nausea or vomiting" and the matched Term
<br />for example "patient" i want to get the word level and the word
<br />experienced("and" and "no" are stop words, therefore i d'ont want to get
<br />them.).I have looked at the Class Termposition but in this Class i can only
<br />get the position of the matched Term, how can i get the word before and
<br />after it, any suggestion?. 
<br />> Thank you in advance.
<br />> Kamal
<br />>   
<br />> ------------------------------------------------------------------------
<br />>
<br />>
<br />> ---------------------------------------------------------------------
<br />> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
<br />> For additional commands, e-mail: java-user-help@lucene.apache.org
<br />
<br />
<br />-- 
<br />Matthew Hall
<br />Software Engineer
<br />Mouse Genome Informatics
<br />mhall@informatics.jax.org
<br />(207) 288-6012
<br />
<br />
<br />
<br />---------------------------------------------------------------------
<br />To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
<br />For additional commands, e-mail: java-user-help@lucene.apache.org
<br />
<br />
<br />---------------------------------------------------------------------
<br />To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
<br />For additional commands, e-mail: java-user-help@lucene.apache.org
<br />
<br />

-- 


Mime
View raw message