Multi-Index Spellchecker

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multi-Index Spellchecker

Mark Miller-3
Does anyone have any interested in making the spellchecker work across more
than one index? Does the coder of the spellchecker have any advice/dont do
that moron info etc ?

- Mark
Reply | Threaded
Open this post in threaded view
|

Re: Multi-Index Spellchecker

Chris Hostetter-3

: Does anyone have any interested in making the spellchecker work across more
: than one index? Does the coder of the spellchecker have any advice/dont do
: that moron info etc ?

Doesn't it already? ... the SpellChecker class doesn't seem to care if you
call indexDictionary more then once ... so you can make multiple
LuceneDictionary instances from your multiple indexes, and add all of
them...

  SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
  // To use terms from field a of index1
  spellchecker.indexDictionary(new LuceneDictionary(reader1, a_field));
  // To use terms from field b of index1
  spellchecker.indexDictionary(new LuceneDictionary(reader1, b_field));
  // To use terms from field c of index2
  spellchecker.indexDictionary(new LuceneDictionary(reader2, c_field));
  String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);


...or am i missing something here?

(disclaimer: i've never acctually used SpellChecker, just skimmed the
code)


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Multi-Index Spellchecker

Mark Miller-3
Thanks Hoss,

I hadn't looked at the indexDictionary method yet. It does not appear to
be what I am looking for though...I should have been more explicit -
I am using the spellchecker for a 'did you mean search', so I am not
using a dedicated spell check index. Instead I am passing the index that
I am searching and so I
do not want to add a dictionary to that index. The index must not be
modified...just have suggested words puled from it.

 I want to be able to apply my 'did you mean' check across multiple
indexes in the case of a multisearcher being used.

- Mark

Chris Hostetter wrote:

> : Does anyone have any interested in making the spellchecker work across more
> : than one index? Does the coder of the spellchecker have any advice/dont do
> : that moron info etc ?
>
> Doesn't it already? ... the SpellChecker class doesn't seem to care if you
> call indexDictionary more then once ... so you can make multiple
> LuceneDictionary instances from your multiple indexes, and add all of
> them...
>
>   SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
>   // To use terms from field a of index1
>   spellchecker.indexDictionary(new LuceneDictionary(reader1, a_field));
>   // To use terms from field b of index1
>   spellchecker.indexDictionary(new LuceneDictionary(reader1, b_field));
>   // To use terms from field c of index2
>   spellchecker.indexDictionary(new LuceneDictionary(reader2, c_field));
>   String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
>
>
> ...or am i missing something here?
>
> (disclaimer: i've never acctually used SpellChecker, just skimmed the
> code)
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Multi-Index Spellchecker

Mark Miller-3
Uggg. Okay...ignore my last e-mail. I was working from memory and I have
non. I have to go back and look at my code.

On 11/20/06, Mark Miller <[hidden email]> wrote:

>
> Thanks Hoss,
>
> I hadn't looked at the indexDictionary method yet. It does not appear to
> be what I am looking for though...I should have been more explicit -
> I am using the spellchecker for a 'did you mean search', so I am not
> using a dedicated spell check index. Instead I am passing the index that
> I am searching and so I
> do not want to add a dictionary to that index. The index must not be
> modified...just have suggested words puled from it.
>
> I want to be able to apply my 'did you mean' check across multiple
> indexes in the case of a multisearcher being used.
>
> - Mark
>
> Chris Hostetter wrote:
> > : Does anyone have any interested in making the spellchecker work across
> more
> > : than one index? Does the coder of the spellchecker have any
> advice/dont do
> > : that moron info etc ?
> >
> > Doesn't it already? ... the SpellChecker class doesn't seem to care if
> you
> > call indexDictionary more then once ... so you can make multiple
> > LuceneDictionary instances from your multiple indexes, and add all of
> > them...
> >
> >   SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
> >   // To use terms from field a of index1
> >   spellchecker.indexDictionary(new LuceneDictionary(reader1, a_field));
> >   // To use terms from field b of index1
> >   spellchecker.indexDictionary(new LuceneDictionary(reader1, b_field));
> >   // To use terms from field c of index2
> >   spellchecker.indexDictionary(new LuceneDictionary(reader2, c_field));
> >   String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
> >
> >
> > ...or am i missing something here?
> >
> > (disclaimer: i've never acctually used SpellChecker, just skimmed the
> > code)
> >
> >
> > -Hoss
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Multi-Index Spellchecker

Mark Miller-3
Okay Hoss...you are correct. I had forgotten that I am not using a live
Index for the 'did you mean' spellcheck index, but create a snapshot
instead. indexDictionary is exactly what I need. Thanks,

Mark

On 11/20/06, Mark Miller <[hidden email]> wrote:

>
> Uggg. Okay...ignore my last e-mail. I was working from memory and I have
> non. I have to go back and look at my code.
>
> On 11/20/06, Mark Miller < [hidden email]> wrote:
> >
> > Thanks Hoss,
> >
> > I hadn't looked at the indexDictionary method yet. It does not appear to
> >
> > be what I am looking for though...I should have been more explicit -
> > I am using the spellchecker for a 'did you mean search', so I am not
> > using a dedicated spell check index. Instead I am passing the index that
> > I am searching and so I
> > do not want to add a dictionary to that index. The index must not be
> > modified...just have suggested words puled from it.
> >
> > I want to be able to apply my 'did you mean' check across multiple
> > indexes in the case of a multisearcher being used.
> >
> > - Mark
> >
> > Chris Hostetter wrote:
> > > : Does anyone have any interested in making the spellchecker work
> > across more
> > > : than one index? Does the coder of the spellchecker have any
> > advice/dont do
> > > : that moron info etc ?
> > >
> > > Doesn't it already? ... the SpellChecker class doesn't seem to care if
> > you
> > > call indexDictionary more then once ... so you can make multiple
> > > LuceneDictionary instances from your multiple indexes, and add all of
> > > them...
> > >
> > >   SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
> > >   // To use terms from field a of index1
> > >   spellchecker.indexDictionary(new LuceneDictionary(reader1,
> > a_field));
> > >   // To use terms from field b of index1
> > >   spellchecker.indexDictionary(new LuceneDictionary(reader1,
> > b_field));
> > >   // To use terms from field c of index2
> > >   spellchecker.indexDictionary(new LuceneDictionary(reader2,
> > c_field));
> > >   String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
> > >
> > >
> > > ...or am i missing something here?
> > >
> > > (disclaimer: i've never acctually used SpellChecker, just skimmed the
> > > code)
> > >
> > >
> > > -Hoss
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> > >
> >
>
>