Back to LanguageTool Homepage - Privacy - Imprint

Could not export dictionary


(DSblizzard) #1

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"


(Daniel Naber) #2

You need a recent snapshot version for that from http://languagetool.org/download/snapshots/?C=M;O=D


(DSblizzard) #3

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


(Daniel Naber) #4

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


(DSblizzard) #5

Thank you very much.


(Eirik Birkeland) #6

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.


(Daniel Naber) #7

@arysin, I think you moved the code, could you update http://wiki.languagetool.org/developing-a-tagger-dictionary?


(Juan Martorell) #8

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


(Daniel Naber) #9

I've updated the Wiki now, the commands at http://wiki.languagetool.org/developing-a-tagger-dictionary should work now.


(Eirik Birkeland) #10

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.


(Daniel Naber) #11

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

(Eirik Birkeland) #12

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!