lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] Commented: (LUCENE-1817) it is impossible to use a custom dictionary for SmartChineseAnalyzer
Date Wed, 26 Aug 2009 15:03:59 GMT


Uwe Schindler commented on LUCENE-1817:

In my opinion, the loader should be able to load either .mem files (which should realy be
named *.ser, because they are serialized java objects) or DCT format files (maybe autodetect)
or two separate methods. If you want to quicker load the files later, you could also save
the DCT as a serialized object after that, but this should be left to the user and not done

> it is impossible to use a custom dictionary for SmartChineseAnalyzer
> --------------------------------------------------------------------
>                 Key: LUCENE-1817
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/analyzers
>            Reporter: Robert Muir
>            Priority: Minor
> it is not possible to use a custom dictionary, even though there is a lot of code and
javadocs to allow this.
> This is because the custom dictionary is only loaded if it cannot load the built-in one
(which is of course, in the jar file and should load)
> {code}
> public synchronized static WordDictionary getInstance() {
>     if (singleInstance == null) {
>       singleInstance = new WordDictionary(); // load from jar file
>       try {
>         singleInstance.load();
>       } catch (IOException e) { // loading from jar file must fail before it checks the
AnalyzerProfile (where this can be configured)
>         String wordDictRoot = AnalyzerProfile.ANALYSIS_DATA_DIR;
>         singleInstance.load(wordDictRoot);
>       } catch (ClassNotFoundException e) {
>         throw new RuntimeException(e);
>       }
>     }
>     return singleInstance;
>   }
> {code}
> I think we should either correct this, document this, or disable custom dictionary support...

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message