From lucene-dev Fri Feb 18 22:20:43 2005 From: Daniel Naber Date: Fri, 18 Feb 2005 22:20:43 +0000 To: lucene-dev Subject: Highlighter API Message-Id: <200502182320.43729 () danielnaber ! de> X-MARC-Message: https://marc.info/?l=lucene-dev&m=110876514813383 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