LT only works on plain text, so you’ll need to either convert Markdown to plain text first, or tell LT what the markup is. As a developer, you can do that using AnnotatedTextBuilder (LanguageTool 6.0 API).
Writing “rules” always refers to detecting errors in natural language text, this has nothing to do with the format (Markdown, LaTeX etc.) of the text.
A simple example of checking plain text can be found at Java API - LanguageTool Wiki. Instead of plain text, you’d need to pass in AnnotatedText, created with the AnnotatedTextBuilder, as mentioned. Anyway, it’s still up to you to actually find out what’s markup and what’s text.
Feel free to ask questions here or on our mailing list (we won’t be able to provide general help with Java, though).
1.) Get the source from git
2.) Install Oracle Java-JDK-8
3.) Install maven2 / Ubuntu 14.04
4.) i call: mvn clean package in the root of source
5.) then i call: ./build.sh languagetool-standalone clean package
It seems to be that some LanguageTool files from oss.sonatype.org fails. I take a look and yes - there are only files in Version 2.3? And now; is it possible to easy rename this files to 2.7?
Failure-Diskription:
[INFO] ------------------------------------------------------------------------
[INFO] Building English module for LanguageTool
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/languagetool/languagetool-core/2.7-SNAPSHOT/languagetool-core-2.7-SNAPSHOT-tests.jar
[INFO] Unable to find resource ‘org.languagetool:languagetool-core:test-jar:tests:2.7-SNAPSHOT’ in repository sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.languagetool -DartifactId=languagetool-core -Dversion=2.7-SNAPSHOT -Dclassifier=tests -Dpackaging=test-jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.languagetool -DartifactId=languagetool-core -Dversion=2.7-SNAPSHOT -Dclassifier=tests -Dpackaging=test-jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.languagetool:language-en:jar:2.7-SNAPSHOT
2) org.languagetool:languagetool-core:test-jar:tests:2.7-SNAPSHOT
1 required artifact is missing.
for artifact:
org.languagetool:language-en:jar:2.7-SNAPSHOT
Maven Central contains the latest release, i.e. 2.6. Maven looks there and at your local repository and cannot find 2.7-SNAPSHOT. To work around this, call “mvn install” once in the top folder (speed it up by using “mvn install -DskipTests”), it will install 2.7-SNAPSHOT in the local repository. Not sure why this is needed once (maybe it helps if you don’t set “clean” but just call “./build.sh languagetool-standalone package”).
What i do:
1.) “mvn install” - that was the point!
2.) then i call: “./build.sh languagetool-standalone package” → most perfect i get a build
3.) then i call: “mvn install -DskipTests” to build the whole project
It looks like the same problem; but a other dependency:
INFO] ------------------------------------------------------------------------
[INFO] Building LanguageTool Wikipedia tools
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Unable to get dependency information: Unable to read the metadata file for artifact ‘org.apache.lucene:lucene-test-framework:jar’: Cannot find parent: org.apache.lucene:lucene-parent for project: org.apache.lucene:lucene-test-framework:jar:null for project org.apache.lucene:lucene-test-framework:jar:null
org.apache.lucene:lucene-test-framework:jar:4.9.0