LanguageTool plugin issue [was Re: vim, spell check, smart quotes]

75 views
Skip to first unread message

Chris Lott

unread,
Oct 7, 2012, 1:02:55 PM10/7/12
to vim...@googlegroups.com
On Sat, Oct 6, 2012 at 10:15 PM, Dominique Pellé
<dominiq...@gmail.com> wrote:
>
> Or you can also use the LanguageTool plugin
> which not only does grammar checking in Vim but
> now also does spell checking (since LanguageTool
> version 1.8) using either Hunspell of FSA (Finate
> State Automaton http://stevehanov.ca/blog/index.php?id=115)
> dictionaries:
>
> http://www.vim.org/scripts/script.php?script_id=3223

This looks like the most intriguing route. However, after installation
of the plugin, I get the following error:

java -jar /Users/chrislott/Dropbox/apps/unix/languagetool/LanguageTool.jar
-c utf-8 -d WHITESPACE_RULE,EN_QUOTES -l en --api /var/f
olders/y3/tfx06t6d0kx425gqyhrgv4nw0000gp/T/v6Jgs8o/0] failed with error: 1

Any idea how to troubleshoot this?

c
--
Chris Lott <ch...@chrislott.org>

Dominique Pellé

unread,
Oct 7, 2012, 2:26:23 PM10/7/12
to vim...@googlegroups.com
Chris Lott <ch...@chrislott.org> wrote:


Not sure what it is. That seems to be a problem with
the installation of LanguageTool or Java, but not with Vim.
Anyway, does this work for you from the shell command
line for example:

$ echo "This is is a test." | \
   java -jar languagetool//dist/LanguageTool.jar -l en-US

Expected text language: English (US)
Working on STDIN...
1.) Line 1, column 6, Rule ID: ENGLISH_WORD_REPEAT_RULE
Message: Possible typo: you repeated a word
Suggestion: is
This is is a test.
     ^^^^^        
Time: 104ms for 1 sentences (9.6 sentences/sec)

By the way, spell checking with LanguageTool only
happens if the region is selected. In other word with
language en-US or en-UK (but not with "en").
In Vim setting:  :spelllang=en_us  should be enough
for the plugin to pass the right language to LanguageTool.

Regards
-- Dominique


-- Dominique

ping

unread,
Oct 8, 2012, 1:32:37 PM10/8/12
to vim...@googlegroups.com, Dominique Pellé


On 10/07/2012 02:26 PM, Dominique Pell� wrote:
> Chris Lott <ch...@chrislott.org <mailto:ch...@chrislott.org>> wrote:
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php



not to interupt the original thread, but after testing this myself in my
ubuntu 64bit, I got compile error and build also failed. This turns out
to be not VIM related...


ping@640g-laptop:~$ which ant
/usr/bin/ant
ping@640g-laptop:~$ cd bin/
ping@640g-laptop:~/bin$ cd languagetool/

ping@640g-laptop:~/bin/languagetool$ ls
build.properties build.xml CHANGES.txt COPYING.txt docs
i18n_update.sh jnlp libs openoffice README.txt src tests

ping@640g-laptop:~/bin/languagetool$ ant
Unable to locate tools.jar. Expected to find it in
/usr/lib/jvm/java-6-sun-1.6.0.26/lib/tools.jar
Buildfile: /home/ping/bin/languagetool/build.xml
[taskdef] Could not load definitions from resource tasks.properties.
It could not be found.

clean:

init:
[echo] Apache Ant(TM) version 1.8.2 compiled on December 3 2011
[mkdir] Created dir: /home/ping/bin/languagetool/build
[mkdir] Created dir: /home/ping/bin/languagetool/build/classes
[mkdir] Created dir: /home/ping/bin/languagetool/build/META-INF
[mkdir] Created dir: /home/ping/bin/languagetool/dist

compile:

BUILD FAILED
/home/ping/bin/languagetool/build.xml:318: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-sun-1.6.0.26/jre"

Total time: 1 second


ping@640g-laptop:~/bin/languagetool$ sudo apt-get install openjdk-6-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-6-jdk is already the newest version.
openjdk-6-jdk set to manually installed.
The following packages were automatically installed and are no longer
required:
logcheck-database logtail
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.




ping@640g-laptop:~/bin/languagetool$ locate tools.jar
/data/backup/RedBack/sqldeveloper/ide/extensions/oracle.ide.externaltools.jar
/data/backup/RedBack/sqldeveloper/ide/lib/javatools.jar
/data/backup/RedBack/sqldeveloper/jdk/lib/tools.jar
/data/backup/spirent/spirentsoft/Spirent_TestCenter_3.60/Spirent_TestCenter_Application_Linux/results_reporter/lib/hibernate-tools.jar
/linux32/usr/lib/jvm/java-1.5.0-gcj-4.4/lib/tools.jar
/linux32/usr/lib/jvm/java-6-openjdk/lib/tools.jar
/usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar
/usr/local/Evermore/EIOffice/Jre/lib/ext/tools.jar
/usr/share/java/aspectjtools.jar
ping@640g-laptop:~/bin/languagetool$



google "/home/ping/bin/languagetool/build.xml:318: Unable to find a
javac compiler;
com.sun.tools.javac.Main is not on the classpath." gave me a lot of
matching, looks a common issue, but none of them tell me how to fix
exactly.
Reply all
Reply to author
Forward
0 new messages