lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpad KATONA" <a.kat...@ever-team.com>
Subject Highlighting, startOffset, endOffset
Date Mon, 12 May 2003 07:43:03 GMT
Hello Lucene Users,

in order to highlighting terms in a text, i try to use Maik Schreiber's highlighting solution
see "Term Highlighter" on :
http://jakarta.apache.org/lucene/docs/contributions.html .
It is based on the "startOffset" and "endOffset" functions of the "org.apache.lucene.analysis.Token"
class, see the short code sample below.

org.apache.lucene.analysis.Token token;
TokenStream stream = analyzer.tokenStream(new StringReader(text));
while ((token = stream.next()) != null) {
  int startOffset = token.startOffset();
  int endOffset = token.endOffset();
...
}

The problem is, that these functions "startOffset" and "endOffset" seem to return always 0,
do you see why? In the mails archive there is only one mail that treats this thema : 
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgId=489630
From: Tom Dunstan
Subject: Excerpts
Date: Tue, 1 Oct 2002 12:19:29 +0930

but the sender seems to have never got an answer to his mail...

Thank you im voraus

Arpad KATONA
a.katona@ever-team.com


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


Mime
View raw message