On Mon, 27 Sep 2010, Robert Muir wrote:
On Sun, Sep 26, 2010 at 10:05 PM, Andi Vajda <va...@apache.org> wrote:
Doing so causes this complaint to be emitted while building the
wrappers:
WARNING: Can not find lexical dictionary directory!
WARNING: This will cause unpredictable exceptions in your application!
WARNING: Please refer to the manual to download the dictionaries.
What's the trick to have the lexical dictionary directory found ?
A quick glance at the javadocs [1] doesn't seem to say.
Andi..
[1] http://lucene.apache.org/java/3_0_2/api/contrib-smartcn/index.html
the way this analyzer loads resources is a bit hairy. take a look at
WordDictionary.getInstance() for example.
so when this is called, it first checks, in this order:
* from inside the jar itself: resources/.../hmm/coredict.mem [this should
always succeed!]
* from the AnalyzerProfile thing, which is whats emitting the error.
try {
singleInstance.load();
} catch (IOException e) {
String wordDictRoot = AnalyzerProfile.ANALYSIS_DATA_DIR;
singleInstance.load(wordDictRoot);
So when you are building the wrappers, is it just that you are causing java
to load this AnalyzerProfile some other way manually?
because as soon as you try to load AnalyzerProfile its going to emit these
warnings...
if pylucene is just loading this class itself (to make it accessible via
python), i think this is just harmless?
Yes, that's most likely it. JCC loads each and every public class unless
told not to to generate wrappers for it. If this AnalyzerProfile class is
not necessary from Python, it should be put on the --exclude list.
Thanks for the tip !
Andi..