Sudachi icon indicating copy to clipboard operation
Sudachi copied to clipboard

Dictionary file Loading support from jar

Open santosa-malika opened this issue 5 years ago • 6 comments

if the Dictionary file is kept inside some resource jar , then the MMap.class cannot read the Dictionary file,

so can this be modified to support BinaryDictionary.class.getClassLoader().getResourceAsStream("system_core.dic ") Then from InputStream we can get ByteBuffer using below logic ByteBuffer byteBuffer = ByteBuffer.allocate(initialStream.available()); ReadableByteChannel channel = newChannel(initialStream); IOUtils.readFully(channel, byteBuffer);

santosa-malika avatar Oct 23 '20 13:10 santosa-malika

I've received requests to read the dictionary from the jar, and I know how to do it, but I haven't come up with a spec for the config file and a clean implementation, so please wait a little longer.

kazuma-t avatar Oct 24 '20 14:10 kazuma-t

For Example :

  1. The Dictionary file “system_core.dic” & “sudachi.json” Is placed inside some jar , example $PROJECT_HOME/lib/resource.jar”
  2. The Sudachi Jar is inside $PROJECT_HOME/lib/sudachi-0.4.3.jar
  3. As the “system_core.dic” inside the jar , so the sudachi-0.4.3.jar cannot read the Dictionary file . when the system_core.dic inside $PROJECT_HOME/lib/ system_core.dic then its OK.
  4. So to support to when Dictionary file inside some jar like $PROJECT_HOME/lib/resource.jar/japanese_dictionary/system_core.dic I have raised above request .

santosa-malika avatar Oct 27 '20 03:10 santosa-malika

Dear, any update on the above request to support in the newer version .

santosa-malika avatar Jun 21 '21 05:06 santosa-malika

Dear, any update or plan on the above request to support in the newer version .

santosa-malika avatar Feb 10 '22 06:02 santosa-malika

Actually, it should work with the version in develop branch, however the functionality is not tested and will not be officially supported.

eiennohito avatar Feb 10 '22 06:02 eiennohito