You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2009/08/26 16:57:59 UTC

[jira] Commented: (LUCENE-1817) it is impossible to use a custom dictionary for SmartChineseAnalyzer

    [ https://issues.apache.org/jira/browse/LUCENE-1817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747963#action_12747963 ] 

Robert Muir commented on LUCENE-1817:
-------------------------------------

I am looking at this today. One thing about this code that should also be corrected ASAP is that if you have a custom dictionary directory in .DCT format, the load() method will actually call save()

This will create a corresponding .MEM file in the same directory after loading the dictionary in DCT format.

I really do not think load() methods should be creating or writing to files.


> it is impossible to use a custom dictionary for SmartChineseAnalyzer
> --------------------------------------------------------------------
>
>                 Key: LUCENE-1817
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1817
>             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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org