lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zheng zheng xing (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-1817) it is impossible to use a custom dictionary for SmartChineseAnalyzer
Date Sat, 28 Jan 2012 01:03:40 GMT

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

zheng zheng xing commented on LUCENE-1817:
------------------------------------------

I am interested in working on adding the feature to allow use customized dictionary in text
file, not DCT file.
I have a couple of questions before trying on it.

In the package, I only saw .mem file. Where should I download .dct file and how to convert
from text file to dct file?

                
> 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: modules/analysis
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1817-mark-cn-experimental.patch, LUCENE-1817.patch, LUCENE-1817.patch,
dataFiles.zip
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message