lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: SpellChecker and Lucene 2.1
Date Thu, 15 Mar 2007 16:29:46 GMT

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message