HunspellJNA icon indicating copy to clipboard operation
HunspellJNA copied to clipboard

Connect dictionary in current path

Open javitolin opened this issue 11 years ago • 1 comments

Hi! How can I want to connect a dictionary to the api and then make a jar (single jar) that will work no mether where it is run, without the dic file. I understand that I have to put the dic file inside the project, and then extract the jar file with the dic file inside. This I can do. But how can I connect the dic to the Hunspell? I have tried: String workingDir = System.getProperty("user.dir"); dict = Hunspell.getInstance().getDictionary(workingDir+"/US.dic"); But doesn't works... Thanks!

javitolin avatar Apr 01 '14 13:04 javitolin

This is what LanguageTool does and it works:

dictionary = Hunspell.getInstance().getDictionary("/complete/path/en_US");

It would of course be better if one could somehow use the file from inside the JAR without extracting it.

danielnaber avatar May 01 '14 14:05 danielnaber