Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary file Loading support from jar #134

Open
santosa-malika opened this issue Oct 23, 2020 · 5 comments
Open

Dictionary file Loading support from jar #134

santosa-malika opened this issue Oct 23, 2020 · 5 comments

Comments

@santosa-malika
Copy link

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);

@kazuma-t
Copy link
Member

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.

@santosa-malika
Copy link
Author

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
Copy link
Author

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

@santosa-malika
Copy link
Author

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

@eiennohito
Copy link
Collaborator

eiennohito commented Feb 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants