HunspellJNA
HunspellJNA copied to clipboard
Connect dictionary in current path
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!
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.