Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

How SynonymFilter works?

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


a.soleimani at yahoo

May 27, 2012, 11:35 PM

Post #1 of 4 (418 views)
Permalink
How SynonymFilter works?

Dear all

I am going to find out how SynonymFilter in Lucene-analyzers 3.5 works and what exactly its output tokens are.
Is there any sample code that shows how to fill SynonymMap and then use SynonymFilter to filter a sentence.
I appreciate any comment.

Thanks,
Atieh Soleimani


ian.lea at gmail

May 30, 2012, 2:42 AM

Post #2 of 4 (401 views)
Permalink
Re: How SynonymFilter works? [In reply to]

Did you get an answer to this? Looking at the lucene test cases can
be a good way of finding out things like this. Reading Lucene In
Action is also highly recommended. May not have the exact answer to
this question but will teach you how to find out.


--
Ian.


On Mon, May 28, 2012 at 7:35 AM, atiyeh soleimani <a.soleimani [at] yahoo> wrote:
> Dear all
>
> I am going to find out how SynonymFilter in Lucene-analyzers 3.5 works and what exactly its output tokens are.
> Is there any sample code that shows how to fill SynonymMap and then use SynonymFilter to filter a sentence.
> I appreciate any comment.
>
> Thanks,
> Atieh Soleimani

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


rrs at rand

Aug 10, 2012, 10:24 AM

Post #3 of 4 (354 views)
Permalink
Re: How SynonymFilter works? [In reply to]

Ian Lea <ian.lea <at> gmail.com> writes:

>
> Did you get an answer to this? Looking at the lucene test cases can
> be a good way of finding out things like this. Reading Lucene In
> Action is also highly recommended. May not have the exact answer to
> this question but will teach you how to find out.
>
> --
> Ian.
>
> On Mon, May 28, 2012 at 7:35 AM, atiyeh soleimani <a.soleimani <at> yahoo.com>
wrote:
> > Dear all
> >
> > I am going to find out how SynonymFilter in Lucene-analyzers 3.5 works and
what exactly its output tokens are.
> > Is there any sample code that shows how to fill SynonymMap and then use
SynonymFilter to filter a sentence.
> > I appreciate any comment.
> >
> > Thanks,
> > Atieh Soleimani
>

Ian,

Did you ever figure this out. I'm poking around but I can't find any example nor
get it to work. I'm stuck at creating the SynonymMap.

Thanks,

-ricardo


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ian.lea at gmail

Aug 13, 2012, 2:23 AM

Post #4 of 4 (343 views)
Permalink
Re: How SynonymFilter works? [In reply to]

I didn't know that SynonymMap had gone all FST.

Looks like you need something along these lines

String base1 = "fast";
String syn1 = "rapid";
String base2 = "slow";
String syn2 = "sluggish";

SynonymMap.Builder sb = new SynonymMap.Builder(true);
sb.add(new CharsRef(base1), new CharsRef(syn1), true);
sb.add(new CharsRef(base2), new CharsRef(syn2), true);
SynonymMap smap = sb.build();


Hope that helps. There may be an easier way. Have you tried looking
at the source code/test cases?



--
Ian.


On Fri, Aug 10, 2012 at 6:24 PM, Ricardo <rrs [at] rand> wrote:
>
>
> Ian Lea <ian.lea <at> gmail.com> writes:
>
>>
>> Did you get an answer to this? Looking at the lucene test cases can
>> be a good way of finding out things like this. Reading Lucene In
>> Action is also highly recommended. May not have the exact answer to
>> this question but will teach you how to find out.
>>
>> --
>> Ian.
>>
>> On Mon, May 28, 2012 at 7:35 AM, atiyeh soleimani <a.soleimani <at> yahoo.com>
> wrote:
>> > Dear all
>> >
>> > I am going to find out how SynonymFilter in Lucene-analyzers 3.5 works and
> what exactly its output tokens are.
>> > Is there any sample code that shows how to fill SynonymMap and then use
> SynonymFilter to filter a sentence.
>> > I appreciate any comment.
>> >
>> > Thanks,
>> > Atieh Soleimani
>>
>
> Ian,
>
> Did you ever figure this out. I'm poking around but I can't find any example nor
> get it to work. I'm stuck at creating the SynonymMap.
>
> Thanks,
>
> -ricardo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.