SpellChecker and Lucene 2.1

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

SpellChecker and Lucene 2.1

rjohara
Is there a SpellChecker.jar compatible with Lucene 2.1.  After  
updating to Lucene 2.1, I seem to have lost the ability to create a  
spell index using spellchecker-2.0-rc1-dev.jar.  Any help would be  
greatly appreciated.

Thanks,
Ryan

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

Reply | Threaded
Open this post in threaded view
|

Re: SpellChecker and Lucene 2.1

Karl Wettin

14 mar 2007 kl. 21.47 skrev Ryan O'Hara:

> Is there a SpellChecker.jar compatible with Lucene 2.1.  After  
> updating to Lucene 2.1, I seem to have lost the ability to create a  
> spell index using spellchecker-2.0-rc1-dev.jar.  Any help would be  
> greatly appreciated.

Can you explain the problem more detailed? Exceptions? API changes?

--
karl

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

Reply | Threaded
Open this post in threaded view
|

Re: SpellChecker and Lucene 2.1

rjohara
My question basically was is there a spellchecker-2.*1*-rc1-dev.jar?

The problems I'm having...

Exception:

java.lang.NullPointerException
         at  
org.apache.lucene.search.spell.SpellChecker.indexDictionary
(SpellChecker.java:298)
         at DidYouMeanIndexer.createSpellIndex(DidYouMeanIndexer.java:
52)
         at DidYouMeanIndexer.main(DidYouMeanIndexer.java:38)

Code:

public void createSpellIndex(String field,
                                  Directory originalIndexDirectory,
                                  Directory spellIndexDirectory) {
         IndexReader indexReaderOriginal = null;
         try {
             indexReaderOriginal = IndexReader.open
(originalIndexDirectory);
             LuceneDictionary dictionary = new LuceneDictionary
(indexReaderOriginal, field);
             //*tried closing indexReaderOriginal here too*
            SpellChecker spellChecker = new SpellChecker(spellIndexDirectory);
             spellChecker.indexDictionary(dictionary);
         } catch (Exception e){
             printError(e);
         } finally {
             try {
                 indexReaderOriginal.close();
             } catch (Exception e){
                 e.printStackTrace();
             }
         }
     }

When I close indexReaderOriginal after the Dictionary is closed, I  
get the same exact exception.

Thanks in advance,
Ryan

On Mar 15, 2007, at 1:34 AM, karl wettin wrote:

>
> 14 mar 2007 kl. 21.47 skrev Ryan O'Hara:
>
>> Is there a SpellChecker.jar compatible with Lucene 2.1.  After  
>> updating to Lucene 2.1, I seem to have lost the ability to create  
>> a spell index using spellchecker-2.0-rc1-dev.jar.  Any help would  
>> be greatly appreciated.
>
> Can you explain the problem more detailed? Exceptions? API changes?
>
> --
> karl
>
> ---------------------------------------------------------------------
> 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: SpellChecker and Lucene 2.1

Karl Wettin

15 mar 2007 kl. 15.33 skrev Ryan O'Hara:

> My question basically was is there a spellchecker-2.*1*-rc1-dev.jar?

There has been changes since 2.0. You can also take a look at this:

https://issues.apache.org/jira/browse/LUCENE-632

>
> The problems I'm having...
>
> Exception:
>
> java.lang.NullPointerException
>         at  
> org.apache.lucene.search.spell.SpellChecker.indexDictionary
> (SpellChecker.java:298)
>         at DidYouMeanIndexer.createSpellIndex
> (DidYouMeanIndexer.java:52)
>         at DidYouMeanIndexer.main(DidYouMeanIndexer.java:38)

Do you have the source of SpellChecker.java available too? What is on  
and around 298?

And what line of code below is row 52?


>
> Code:
>
> public void createSpellIndex(String field,
>                                  Directory originalIndexDirectory,
>                                  Directory spellIndexDirectory) {
>         IndexReader indexReaderOriginal = null;
>         try {
>             indexReaderOriginal = IndexReader.open
> (originalIndexDirectory);
>             LuceneDictionary dictionary = new LuceneDictionary
> (indexReaderOriginal, field);
>             //*tried closing indexReaderOriginal here too*
>    SpellChecker spellChecker = new SpellChecker
> (spellIndexDirectory);
>             spellChecker.indexDictionary(dictionary);
>         } catch (Exception e){
>             printError(e);
>         } finally {
>             try {
>                 indexReaderOriginal.close();
>             } catch (Exception e){
>                 e.printStackTrace();
>             }
>         }
>     }
>
> When I close indexReaderOriginal after the Dictionary is closed, I  
> get the same exact exception.

--
karl


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

Reply | Threaded
Open this post in threaded view
|

Re: SpellChecker and Lucene 2.1

Chris Hostetter-3
In reply to this post by rjohara

: My question basically was is there a spellchecker-2.*1*-rc1-dev.jar?

There *should* be a spellchecker 2.1 jar in the contrib/spellchecker/
directory of the 2.1 release.




-Hoss


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

Reply | Threaded
Open this post in threaded view
|

Re: SpellChecker and Lucene 2.1

rjohara
Thanks a ton, Hoss.  I just did an ant on the contrib/spellchecker  
directory and it produced a jar file in the LUCENE_HOME/build/  
directory.  Replacing the old jar file with the new jar file fixed my  
errrors as I suspected.  Thanks, again.

-Ryan

On Mar 15, 2007, at 1:38 PM, Chris Hostetter wrote:

>
> : My question basically was is there a spellchecker-2.*1*-rc1-dev.jar?
>
> There *should* be a spellchecker 2.1 jar in the contrib/spellchecker/
> directory of the 2.1 release.
>
>
>
>
> -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]