[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-dev
Subject:    Highlighter API
From:       Daniel Naber <daniel.naber () t-online ! de>
Date:       2005-02-18 22:20:43
Message-ID: 200502182320.43729 () danielnaber ! de
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic