Sorry for the late reply.
I've been away on a business trip last week.
And thank you for the patch. I'll merge your patch to the code tree.
Actually, I was trying to revamp the analyzers so that they reuse tokenizers.
CJKAnalyzer2 has already been modified to reuse the tokenizer it creates.
Please see
http://code.google.com/p/cmecab-java/source/browse/trunk/src/net/moraleboost/lucene/analysis/ja/CJKAnalyzer2.java
As for the bad performance of LocalProtobufMeCabAnalyzer, could you
tell me how much text you fed to the tokenizer?
Long text may cause OutOfMemoryError or std::bad_alloc because
LocalProtobufMeCabTokenizer buffers all tokens it creates.
If you want to tokenize very long text, I recommend that you use
StandardMeCabTokenizer or break the text into several chunks and
tokenize them one-by-one.
Regards,
Kohei Taketa
--
このメールは Google グループのグループ「cmecab-java-users」の登録者に送られています。
このグループに投稿するには、cmecab-j...@googlegroups.com にメールを送信してください。
このグループから退会するには、cmecab-java-us...@googlegroups.com にメールを送信してください。
詳細については、http://groups.google.com/group/cmecab-java-users?hl=ja からこのグループにアクセスしてください。
Obviously, decoding bytestrings to Java strings (CharsetUtils.decode)
is taking very long time. This is reasonable because encoding
conversion between incompatible character sets is an inherently
expensive operation.
However, there may be room for optimization. For example, if native
code can convert encodings (with libiconv or something) faster than
Java, we can reduce total parsing time by moving encoding conversion
code into the native library. I'll try some possible solutions later.
By the way, I've revamped the trunk code to support the Lucene 2.9+
API. It also supports reusing tokenizers (see
StandardMeCabAnalyzer.reuseableTokenizer() .) It would be appreciated
if you could try it out.
Regards,
Kohei Taketa
Regards,
Kohei Taketa
--
このメールは Google グループのグループ「cmecab-java-users」の登録者に送られています。
このグループに投稿するには、cmecab-j...@googlegroups.com にメールを送信してください。
このグループから退会するには、cmecab-java-us...@googlegroups.com にメールを送信してください。
詳細については、http://groups.google.com/group/cmecab-java-users?hl=ja からこのグループにアクセスしてください。