See http://www.lucidimagination.com/search/document/7fe40486bc935ce4/get_term_neighbours (although I think you can do better than the code in the third reply by using a TermVectorMapper such that you can process the TermVector as it comes from disk.)

Essentially, you need to use a combination of SpanQuery, TermVector and TermVectorMapper.

HTH,
Grant

On May 18, 2009, at 9:20 AM, 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

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using Solr/Lucene:
http://www.lucidimagination.com/search


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

Reply via email to