lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Retrieve nearest token based off location in original Text
Date Fri, 06 Jul 2007 17:23:49 GMT
: I never got a response to this and thought maybe I was too wordy.
:
: I'm wondering if there's a way where given a position in the original text
: you can retrieve the token index that is nearest to that position using the
: StandardToken/StandardTokenizer classes?

i may not be understanding the question, but wouldn't that just be...

  TokenStream s = getTokenStreamForOrriginalText()
  Token t;
  for (i=0; i<thePositionYouKnow; i++) {
    t = s.next();
  }
  return t;

?


-Hoss


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


Mime
View raw message