Could not export dictionary

When executing command
“java -cp languagetool-standalone.jar org.languagetool.dev.DictionaryExporter org/languagetool/resource/en/english.dict >dictionary.dump”
as described here:
wiki.languagetool.org/developing-a-tagger-dictionary
I receive following error:
“Could not find or load main class org.languagetool.dev.DictionaryExporter”

You need a recent snapshot version for that from Index of /snapshots/

I downloaded most recent snapshot (LanguageTool-20131123-snapshot.zip)

The file is now called languagetool.jar instead of languagetool-standalone.jar.

Thank you very much.

In folder languagetool/languagetool-standalone/target/LanguageTool-3.4-SNAPSHOT/LanguageTool-3.4-SNAPSHOT

I executed:
java -cp languagetool.jar org.languagetool.dev.POSDictionaryBuilder dictionary.dump org/languagetool/resource/en/english.info

Leading to this error:
Error: Could not find or load main class org.languagetool.dev.POSDictionaryBuilder

I’ve tried editing testrules.sh to make sure the necessary resource should be in the path. I’ve also searched down the POSDictionaryBuilder.java and added it to the path (though this seems a bit funny since the CPATH env variable contains only .JAR files).

The files used were just freshly compiled from the updated repository.

@arysin, I think you moved the code, could you update Developing a tagger dictionary - LanguageTool Wiki?

Right now I’m playing around with the dictionary as well. Yes, there were changes that should go to the Wiki (I already asked for it at the developers mailing list)

But for now, you can have a look at my lab, in dictionary.sh I have embedded dictionary manipulation: extraction and building both dictionary and synthesizer.

At line 40 is what you are looking for:

function dict_build {
  java -cp ../languagetool-tools.jar org.languagetool.tools.POSDictionaryBuilder \
  -i dictionary.dump \
  --info ../dist/org/languagetool/resource/es/spanish.info \
  -o ../dist/org/languagetool/resource/es/spanish.dict
#  -freq freq.xml
}

Please replace your dictionary as required
HTH

I’ve updated the Wiki now, the commands at Developing a tagger dictionary - LanguageTool Wiki should work now.

Thanks!

I tried the updated instructions.

Juan, I also tried your dict_build function.

However I continue to be completely stuck with this:

java -cp ../languagetool-tools.jar org.languagetool.tools.POSDictionaryBuilder

Error: Error: Could not find or load main class org.languagetool.tools.POSDictionaryBuilder

Where is it? And where do I execute this command to begin with?

I’ve been running this in languagetool-standalone/target/LanguageTool-3.4-SNAPSHOT/LanguageTool-3.4-SNAPSHOT and other similar places.

This works for me:

wget https://languagetool.org/download/snapshots/LanguageTool-20160429-snapshot.zip
unzip LanguageTool-20160429-snapshot.zip
cd LanguageTool-3.4-SNAPSHOT/
(create a dictionary.dump file)
java -cp languagetool.jar org.languagetool.tools.POSDictionaryBuilder -i dictionary.dump -info org/languagetool/resource/en/english.info -o output.dict

It worked!

I think maybe I messed something up while working on my fork. I will recompile and compare the compilation output to see what might have gone wrong, so that I can restore my fork.

Thanks for all your help!