You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Markus Fischer <ma...@fischer.name> on 2005/08/13 08:51:33 UTC
Public access to the stemmer (germanstemmer in my case)
Hi,
I was wondering if there's a reason why the stemmers, e.g. GermanStemmer
are not accessible from outside the lucene package.
When I want to highlight the search terms, I need to know which terms
have been found. Example: when searching for "Vitamine" the
GermanStemmer produces "Vitami". "Vitami" is a word not directly used,
but often it's "Vitamin", the noun. When I now try to highlight the
matched words solely based on the user input, I certainly won't be able
to highlight "Vitamin" or a part of the word, since I'm not aware of the
stemmed word.
My frontend application is not Java, I'm only accessing Lucene through
my package with XML-RPC. What I did now is I copied the GermanStemmer
from lucene into my package and called it from there.
But I'm not sure if that's a clever idea and maybe I just overlooked a
public interface to the stemmer output? Or I'm approaching the whole
highlight search term from the wrong direction?
thanks for any pointers,
- Markus
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Public access to the stemmer (germanstemmer in my case)
Posted by Otis Gospodnetic <ot...@yahoo.com>.
You can use Lucene highlighter. It lives in Lucene's contrib/
directory (not released as a separate Jar, but you can either build it,
or grab it from, for example, Lucene in Action's code download). It
lets you highlight search terms like this:
http://www.lucenebook.com/search?query=highlighter
Otis
--- Markus Fischer <ma...@fischer.name> wrote:
> Hi,
>
> I was wondering if there's a reason why the stemmers, e.g.
> GermanStemmer
> are not accessible from outside the lucene package.
>
> When I want to highlight the search terms, I need to know which terms
>
> have been found. Example: when searching for "Vitamine" the
> GermanStemmer produces "Vitami". "Vitami" is a word not directly
> used,
> but often it's "Vitamin", the noun. When I now try to highlight the
> matched words solely based on the user input, I certainly won't be
> able
> to highlight "Vitamin" or a part of the word, since I'm not aware of
> the
> stemmed word.
>
> My frontend application is not Java, I'm only accessing Lucene
> through
> my package with XML-RPC. What I did now is I copied the GermanStemmer
>
> from lucene into my package and called it from there.
>
> But I'm not sure if that's a clever idea and maybe I just overlooked
> a
> public interface to the stemmer output? Or I'm approaching the whole
> highlight search term from the wrong direction?
>
> thanks for any pointers,
> - Markus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org