lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <daniel.na...@t-online.de>
Subject Highlighter API
Date Fri, 18 Feb 2005 22:20:43 GMT
Hi,

the Highlighter's getBestFragment method takes a TokenStream and a text. 
Wouldn't it be easier to give it just the text and an analyzer so the user 
doesn't have to care about building a TokenStream? Like this:

public final String getBestFragment(Analyzer analyzer, String text)
throws IOException
{
  TokenStream tokenStream = analyzer.tokenStream("field", new 	
    StringReader(text));
  return getBestFragment(tokenStream, text);
}

The old method could then be deprecated. Or am I missing something? This 
would also avoid problems in case the stream doesn't match the text.

Regards
 Daniel

-- 
http://www.danielnaber.de

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


Mime
View raw message