Git Product home page Git Product logo

textidote's Introduction

TeXtidote: a correction tool for LaTeX documents and other formats

Travis Coverage Downloads

Have you ever thought of using a grammar checker on LaTeX files?

If so, you probably know that the process is far from simple. Since LaTeX documents contain special commands and keywords (the so-called "markup") that are not part of the "real" text, you cannot run a grammar checker directly on these files: it cannot tell the difference between markup and text. The other option is to remove all this markup, leaving only the "clear" text; however, when a grammar tool points to a problem at a specific line in this clear text, it becomes hard to retrace that location in the original LaTeX file.

TeXtidote solves this problem; it can read your original LaTeX file and perform various sanity checks on it: for example, making sure that every figure is referenced in the text, enforcing the correct capitalization of titles, etc. In addition, TeXtidote can remove markup from the file and send it to the Language Tool library, which performs a verification of both spelling and grammar in a dozen languages. What is unique to TeXtidote is that it keeps track of the relative position of words between the original and the "clean" text. This means that it can translate the messages from Language Tool back to their proper location directly in your source file.

You can see the list of all the rules checked by TeXtidote at the end of this file.

TeXtidote also supports spelling and grammar checking of files in the Markdown format.

Getting TeXtidote

You can either install TeXtidote by downloading it manually, or by installing it using a package.

Under Debian systems: install package

Under Debian systems (Ubuntu and derivatives), you can install TeXtidote using dpkg. Download the latest .deb file in the Releases page; suppose it is called textidote_X.Y.Z_all.deb. You can install TeXtidote by typing:

$ sudo apt-get install ./textidote_X.Y.Z_all.deb

The ./ is mandatory; otherwise the command won't work.

Manual download

You can also download the TeXtidote executable manually: this works on all operating systems. Simply make sure you have Java version 8 or later installed on your system. Then, download the latest release of TeXtidote; put the JAR in the folder of your choice.

Using TeXtidote

TeXtidote is run from the command line. The TeXtidote repository contains a sample LaTeX file called example.tex. Download this file and save it to the folder where TeXtidote resides. You then have the choice of producing three types of "reports" on the contents of your file: an "HTML" report (viewable in a web browser), a "console" report (viewable in a terminal) and a "single-line" report (typically destined to be consumed by other scripts, see below).

HTML report

To run TeXtidote and perform a basic verification of the file, run:

java -jar textidote.jar --output html example.tex > report.html

In Linux, if you installed TeXtidote using apt-get, you can also call it directly by typing:

textidote --output html example.tex > report.html

Here, the --output html option tells TeXtidote to produce a report in HTML format; the > symbol indicates that the output should be saved to a file, whose name is report.html. TeXtidote will run for some time, and print:

TeXtidote v0.8 - A linter for LaTeX documents
(C) 2018-2019 Sylvain Hallé - All rights reserved

Found 23 warnings(s)
Total analysis time: 2 second(s)

Once the process is over, switch to your favorite web browser, and open the file report.html (using the File/Open menu). You should see something like this:

Screenshot

As you can see, the page shows your original LaTeX source file, where some portions have been highlighted in various colors. These correspond to regions in the file where an issue was found. You can hover your mouse over these colored regions; a tooltip will show a message that describes the problem.

If you don't write any filename (or write -- as the filename), TeXtidote will attempt to read one from the standard input.

Plain report

To run TeXtidote and display the results directly in the console, simply omit the --output html option (you can also use --output plain), and do not redirect the output to a file:

java -jar textidote.jar example.tex

TeXtidote will analyze the file like before, but produce a report that looks like this:

* L25C1-L25C25 A section title should start with a capital letter. [sh:001]
  \section{a first section}
  ^^^^^^^^^^^^^^^^^^^^^^^^^
* L38C1-L38C29 A section title should not end with a punctuation symbol.
  [sh:002]
  \subsection{ My subsection. }
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* L15C94-L15C99 Add a space before citation or reference. [sh:c:001]
   things, like a citation\cite{my:paper} .The text

Each element of the list corresponds to a "warning", indicating that something in the text requires your attention. For each warning, the position in the original source file is given: LxxCyy indicates line xx, column yy. The warning is followed by a short comment describing the issue, and an excerpt from the line in question is displayed. The range of characters where the problem occurs is marked by the "^^^^" symbols below the text. Each of these warnings results from the evaluation of some "rule" on the text; an identifier of the rule in question is also shown between brackets.

Single line report

Another option to display the results directly in the console is the single line report:

java -jar textidote.jar --output singleline example.tex

Textidote will analyze the file like before, but this time the report looks like this:

example.tex(L25C1-L25C25): A section title should start with a capital letter. "\section{a first section}"
example.tex(L38C1-L38C29): A section title should not end with a punctuation symbol. "\subsection{ My subsection. }"
example.tex(L15C94-L15C99): Add a space before citation or reference. "things, like a citation\cite{my:paper} .The text"

Each line corresponds to a warning, and is parseable by regular expressions easily, e.g., for further processing in another tool. The file is given at the beginning of the line, followed by the position in parentheses. Then, the warning message is given, and the excerpt causing the warning is printed in double quotes (""). Note, that sometimes it may happen that a position cannot be determined. In this case, instead of LxxCyy, ? is printed.

You can disable the use of color in any form of command-line output using the --no-color switch.

Spelling, grammar and style

You can perform further checks on spelling and grammar, by passing the --check option at the command line. For example, to check text in English, you run:

java -jar textidote.jar --check en example.tex

The --check parameter must be accompanied by a two-letter code indicating the language to be used. Language Tool is a powerful library that can verify spelling, grammar, and even provide suggestions regarding style. TeXtidote simply passes a cleaned-up version of the LaTeX file to Language Tool, retrieves the messages it generates, and coverts the line and column numbers associated to each message back into line/column numbers of the original source file. For more information about the kind of verifications made by Language Tool, please refer to its website.

Additionally, the --firstlang lang option can be used to make Language Tool check for false friends in your first language. For example, to check a text in english, when your first language is german, you may run:

java -jar textidote.jar --check en --firstlang de example.tex

The language codes you can use are:

  • de: (Germany) German, and the variants de_AT (Austrian) and de_CH (Swiss)
  • en: (US) English, and the variants en_CA (Canadian) and en_UK (British)
  • es: Spanish
  • fr: French
  • nl: Dutch
  • pt: Portuguese
  • pl: Polish

Using a dictionary

If you have a list of words that you want TeXtidote to ignore when checking spelling, you can use the --dict parameter to specify the location of a text file:

java -jar textidote.jar --check en --dict dico.txt example.tex

The file dico.txt must be a plain text file contain a list of words to be ignored, with each word on a separate line. (The list is case sensitive.)

If you already spell checked you file using Aspell and saved a local dictionary (as is done for example by the PaperShell environment), TeXtidote can automatically load this dictionary when invoked. More specifically, it will look for a file called .aspell.XX.pws in the folder where TeXtidote is started (this is the filename Aspell gives to local dictionaries). The characters XX are to be replaced with the two-letter language code. If such a file exists, TeXtidote will load it and mention it at the console:

Found local Aspell dictionary

Analyzing a file from the clipboard

If you omit a filename, TeXtidote analyzes the standard input. You can use this to copy a piece of code to the clipboard and analyze it without the need to save it as a file first. The procedure depends on your operating system.

  • In Linux, you can copy text and pipe it to TeXtidote using xclip: xclip -o | textidote [options...].
  • In Windows' PowerShell, the same can be done with GetClipboard: GetClipboard | textidote [options...]
  • In MacOS X, the same can be done with pbpaste: pbpaste | textidote [options...]

Ignoring rules

You may want to ignore some of TeXtidote's advice. You can do so by specifying rule IDs to ignore with the --ignore command line parameter. For example, the ID of the rule "A section title should start with a capital letter" is sh:001 (rule IDs are shown between brackets in the reports given by TeXtidote); to ignore warnings triggered by this rule, you call TeXtidote as follows:

java -jar textidote.jar --ignore sh:001 myfile.tex

If you want to ignore multiple rules, separate their IDs with a comma (but no space).

Ignoring environments

TeXtidote can be instructed to remove user-specified environments using the --remove command line parameter. For example:

$ java -jar textidote.jar --remove itemize myfile.tex

This command will remove all text lines between \begin{itemize} and \end{itemize} before further processing the file.

Ignoring macros

The same can be done with macros:

$ java -jar textidote.jar --remove-macros foo myfile.tex

This command will remove all occurrences of use-defined command \foo in the text. Alternate syntaxes like \foo{bar} and \foo[x=y]{bar} are also recognized and deleted.

Replacing strings

Before TeXtidote analyses a file, you can ask it to apply a set of find/replace operations (for example, to replace a macro by some predefined character string). You can write these patterns into a text file and pass them to the program at the command line:

$ java -jar textidote.jar --replace replacements.txt

Here, replacements.txt is the file that contains the find/replace patterns, fomatted as follows:

# Empty lines beginning with a pound sign are ignored
# Search and replace patterns are separated by a tab
find	replace
foo		bar
# Patterns can also be regular expressions
abc\d+[^x]	123

Replacement rules are applied line-wise, so multiline replacements are not possible.

Reading a sub-file

By default, TeXtidote ignores everything before the \begin{document} command. If you have a large document that consists of multiple included LaTeX "sub-files", and you want to check one such file that does not contain a \begin{document}, you must tell TeXtidote to read all the file using the --read-all command line option. Otherwise, TeXtidote will ignore the whole file and give you no advice.

TeXtidote also automatically follows sub-files that are embedded from a main document using \input{filename} and \include{filename} (braces are mandatory). Any such non-commented instruction will add the corresponding filename to the running queue. If you want to exclude an \input from being processed, you must surround the line with ignore begin/end comments (see below, Helping TeXtidote).

TeXtidote takes into account the %!TEX root = ... directive for following sub-files. You can also use --root argument to specify it separatedly. However, if your usecase requires a more complex handling of sub-files you can use many of the available tools to pre-process your project. Some suggestions are listed here.

Removing markup

You can also use TeXtidote just to remove the markup from your original LaTeX file. This is done with the option --clean:

java -jar textidote.jar --clean example.tex

By default, the resulting "clean" file is printed directly at the console. To save it to a file, use a redirection:

java -jar textidote.jar --clean example.tex > clean.txt

You will see that TeXtidote performs a very aggressive deletion of LaTeX markup:

  • All figure, table and tabular environments are removed
  • All equations are removed
  • All inline math expressions ($...$) are replaced by "X"
  • All \cite commands are replaced by "0"
  • All \ref commands are replaced by "[0]"
  • Commands that alter text (\textbf, \emph, \uline, \footnote) are removed (but the text is kept)
  • Virtually all other commands are simply deleted

Surprisingly, the result of applying these modifications is a text that is clean and legible enough for a spelling or grammar checker to provide sensible advice.

As was mentioned earlier, TeXtidote keeps a mapping between character ranges in the "cleaned" file, and the same character ranges in the original LaTeX document. You can get this mapping by using the --map option:

java -jar textidote.jar --clean --map map.txt example.tex > clean.txt

The --map parameter is given the name of a file. TeXtidote will put in this file the list of correspondences between character ranges. This file is made of lines that look like this:

L1C1-L1C24=L1C5-L128
L1C26-L1C28=L1C29-L1C31
L2C1-L2C10=L3C1-L3C10
...

The first entry indicates that characters 1 to 24 in the first line of the clean file correspond to characters 5 to 28 in the first line of the original LaTeX file --and so on. This mapping can have "holes": for example, character 25 line 1 does not correspond to anything in the original file (this happens when the "cleaner" inserts new characters, or replaces characters from the original file by something else). Conversely, it is also possible that characters in the original file do not correspond to anything in the clean file (this happens when the cleaner deletes characters from the original).

Character encodings

TeXtidote uses the OS default encoding when reading files (e.g. utf-8 in Linux, cp1252 in Windows). You can override this setting using the --encoding command line option:

java -jar textidote.jar --encoding cp1252 example.tex

Using a configuration file

If you need to run TeXtidote with many command line arguments (for example: you load a local dictionary, ignore a few rules, apply replacements, etc.), it may become tedious to invoke the program with a long list of arguments every time. TeXtidote can be "configured" by putting those arguments in a text file called .textidote in the directory from which it is called. Here is an example of what such a file could contain:

--output html --read-all
--replace replacements.txt
--dict mydict.txt
--ignore sh:001,sh:d:001
--check en mytext.tex

As you can see, arguments can be split across multiple lines. You can then call TeXtidote without any arguments like this:

textidote > report.html

If you call TeXtidote with command line arguments, they will be merged with whatever was found in .textidote. You can also tell TeXtidote to explicitly ignore that file and only take into account the command line arguments using the --no-config argument.

Markdown input

TeXtidote also supports files in the Markdown format. The only difference is that rules specific to LaTeX (references to figures, citations) are not evaluated.

Simply call TeXtidote with a Markdown input file instead of a LaTeX file. The format is auto-detected by looking at the file extension. However, if you pass a file through the standard input, you must tell TeXtidote that the input file is Markdown by using the command line parameter --type md. Otherwise, TeXtidote assumes by default that the input file is LaTeX.

Helping TeXtidote

It order to get the best results when using TeXtidote, it is advisable that you follow a few formatting conventions when writing your LaTeX file:

  • Avoid putting multiple \begin{environment} and/or \end{environment} on the same line
  • Keep the arguments of a command on a single line. Commands (such as \title{}) that have their opening and closing braces on different lines are not recognized by TeXtidote and will result in garbled output and nonsensical warnings.
  • Do not hard-wrap your paragraphs. It is easier for TeXtidote to detect paragraphs if they have no hard carriage returns inside. (If you need word wrapping, it is preferable to enable it in your text editor.)
  • Put headings like \section or \paragraph alone on their line and separate them from the text below by a blank line.

As a rule, it is advisable to first see what your text looks like using the --clean option, to make sure that TeXtidote is performing checks on something that makes sense.

If you realize that a portion of LaTeX markup is not handled properly and messes up the rest of the file, you can tell TeXtidote to ignore a region using a special LaTeX comment:

% textidote: ignore begin
Some weird LaTeX markup that TeXtidote does not
understand...
% textidote: ignore end

The lines between textidote: ignore begin and textidote: ignore end will be handled by TeXtidote as if they were comment lines.
When you are using markdown you can also selectively ignore parts of the document:

<!-- textidote: ignore begin -->
This should be ignored
<!-- textidote: ignore end -->

Linux shortcuts

To make using TeXtidote easier, you can create shortcuts on your system. Here are a few recommended tips.

First, we recommend you create a folder called /opt/textidote and put the big textidote.jar file there (this requires root privileges). This step is already taken care of if you installed the TeXtidote package using apt-get.

Command line shortcut

(This step is not necessary if TeXtidote has been installed with apt-get.) In/usr/local/bin, create a file called textidote with the following contents:

#! /bin/bash
java -jar /opt/textidote/textidote.jar "$@"

Make this file executable by typing at the command line:

sudo chmod +x /usr/local/bin/textidote

(These two operations also require root privileges.) From then on, you can invoke TeXtidote on the command line from any folder by simply typing textidote, e.g.:

textidote somefile.tex

Desktop shortcut

If you use a desktop environment such as Gnome or Xfce, you can automate this even further by creating a TeXtidote icon on your desktop. First, create a file called /opt/textidote/textidote-desktop.sh with the following contents, and make this file executable:

#!/bin/bash
if [ -x /usr/bin/notify-send ]; then
  err() { notify-send -a TeXtidote -i /opt/textidote/textidote-icon.svg "$*"; }
else
  err() { printf "%s\n" "$*" >&2; }
fi

[ $# -lt 1 ] && err "At least one file should be provided as input" && exit
dir=$(dirname "$1")

pushd "$dir" || err "$dir does not exist" && exit
java -jar /opt/textidote/textidote.jar --check en --output html "$@" > /tmp/textidote.html
popd || exit

xdg-open /tmp/textidote.html &

This script enters into the directory of the file passed as an argument, calls TeXtidote, sends the HTML report to a temporary file, and opens the default web browser to show that report.

Then, on your desktop (typically in your ~/Desktop folder), create another file called TeXtidote.desktop with the following contents:

[Desktop Entry]
Version=1.0
Type=Application
Name=TeXtidote
Comment=Check text with TeXtidote
Exec=/opt/textidote/textidote-desktop.sh %F
Icon=/opt/textidote/textidote-icon.svg
Path=
Terminal=false
StartupNotify=false

This will create a new desktop shortcut; make this file executable. From then on, you can drag LaTeX files from your file manager with your mouse and drop them on the TeXtidote icon. After the analysis, the report will automatically pop up in your web browser. Voilà!

MacOS Shortcut

On MacOS, first open Automator, select Application, double-click on the Run Shell Script item in the library, select to receive input as arguments and enter the following:

[ $# -lt 1 ] && echo "At least one file should be provided as input" 1>&2 && exit 1
dir=$(dirname "$1")

cd "$dir" || (echo "$dir does not exist" 1>&2 && exit 1)
java -jar /path/to/textidote.jar --check en --output html "$@" > /tmp/textidote.html || true

open /tmp/textidote.html

Remember to modify /path/to/textidote.jar to the correct location. Finally, go to File->Save to create the shortcut. You can add this application to the Dock or the location you prefer. From then on, you can drag LaTeX files with your mouse and drop them on the created app. After the analysis, the report will automatically pop up in your web browser. Voilà!

Tab completions

You can auto-complete the commands you type at the command-line using the TAB key (as you are probably used to). If you installed TeXtidote using apt-get, auto-completion for Bash comes built-in. You can also enable auto-completion for other shells as follows.

Zsh

Users of Zsh can also enable auto-completion; in your ~/.zshrc file, add the line

source /opt/textidote/textidote.zsh

(Create the file if it does not exist.) You must then restart your Zsh shell for the changes to take effect.

Visual Studio Code integration

Users of Visual Studio Code can integrate TeXtidote by calling it with the --output singleline and --no-color options and parse its results. Moreover, user cphyc also wrote a nice build task.

Emacs integration

Emacs users can benefit from TeXtidote through flycheck.
A dedicated flycheck-checker can be defined as in the following init.el/.emacs snippet. Replace ~/PATH/TO/textidote.jar with the correct path for your system.

(flycheck-define-checker tex-textidote
  "A LaTeX grammar/spelling checker using textidote.

  See https://github.com/sylvainhalle/textidote"
  :modes (latex-mode plain-tex-mode)
  :command ("java" "-jar" (eval (expand-file-name "~/PATH/TO/textidote.jar"))
            "--read-all"
            "--output" "singleline"
            "--no-color"
            "--check"   (eval (if ispell-current-dictionary (substring ispell-current-dictionary 0 2) "en"))
            ;; Try to honor local aspell dictionary and replacements if they exist
            "--dict"    (eval (expand-file-name "~/.aspell.en.pws"))
            "--replace" (eval (expand-file-name "~/.aspell.en.prepl"))
            ;; Using source ensures that a single temporary file in a different dir is created
            ;; such that textidote won't process other files. This serves as a hacky workaround for
            ;; https://github.com/sylvainhalle/textidote/issues/200.
            source)
  :error-patterns ((warning line-start (file-name)
                            "(L" line "C" column "-" (or (seq "L" end-line "C" end-column) "?") "): "
                            (message (one-or-more (not "\""))) (one-or-more not-newline) line-end)))
(add-to-list 'flycheck-checkers 'tex-textidote)

Rules checked by TeXtidote

Here is a list of the rules that are checked on your LaTeX file by TeXtidote. Each rule has a unique identifier, written between square brackets.

Language Tool

In addition to all the rules below, the --check xx option activates all the rules verified by Language Tool (more than 2,000 grammar and spelling errors). Note that the verification time is considerably longer when using that option.

If the --check option is used, you can add the --languagemodel xx option to find errors using n-gram data. In order to do so, xx must be a path pointing to an n-gram-index directory. Please refer to the LanguageTool page (link above) on how to use n-grams and what this directory should contain.

Style

  • A section title should start with a capital letter. [sh:001]
  • A section title should not end with a punctuation symbol. [sh:002]
  • A section title should not be written in all caps. The LaTeX stylesheet takes care of rendering titles in caps if needed. [sh:003]
  • Use a capital letter when referring to a specific section, chapter or table: 'Section X'. [sh:secmag, sh:chamag, sh:tabmag]
  • A (figure, table) caption should end with a period. [sh:capperiod]

Citations and references

  • There should be one space before a \cite or \ref command [sh:c:001], and no space after [sh:c:002].
  • Do not use 'in [X]' or 'from [X]': the syntax of a sentence should not be changed by the removal of a citation. [sh:c:noin]
  • Do not mix \cite and \citep or \citet in the same document. [sh:c:mix]
  • When citing more than one reference, do not use multiple \cite commands; put all references in the same \cite. [sh:c:mul, sh:c:mulp]

Figures

  • Every figure should have a label, and every figure should be referenced at least once in the text. [sh:figref]
  • Use a capital letter when referring to a specific figure: 'Figure X'. [sh:figmag]

Structure

  • A section should not contain a single sub-section. More generally, a division of level n should not contain a single division of level n+1. [sh:nsubdiv]
  • The first heading of a document should be the one with the highest level. For example, if a document contains sections, the first section cannot be preceded by a sub-section. [sh:secorder]
  • There should not be a jump down between two non-successive section levels (e.g. a \section followed by a \subsubsection without a \subsection in between). [sh:secskip]
  • You should avoid stacked headings, i.e. consecutive headings without text in between. [sh:stacked]

Hard-coding

  • Figures should not refer to hard-coded local paths. [sh:relpath]
  • Do not refer to sections, figures and tables using a hard-coded number. Use \ref instead. [sh:hcfig, sh:hctab, sh:hcsec, sh:hccha]
  • You should not break lines manually in a paragraph with \\. Either start a new paragraph or stay in the current one. [sh:nobreak]
  • If you are writing a research paper, do not hard-code page breaks with \newpage. [sh:nonp]

LaTeX subtleties

  • Use a backslash or a comma after the last period in "i.e.", "e.g." and "et al."; otherwise LaTeX will think it is a full stop ending a sentence. [sh:010, sh:011]
  • There should not be a space before a semicolon or a colon. If in your language, typographic rules require a space here, LaTeX takes care of inserting it without your intervention. [sh:d:005, sh:d:006]

Potentially suspicious

  • There should be at least N words between two section headings (currently N=100). [sh:seclen]

Hints for using CI (Continuous Integration)

TeXtidote returns the number of warnings as exit code. GitHub and Gitlab exspect a default exit code auf 0 or else the pipeline will fail. To circumvent this you have disable this feature.

Github

continue-on-error: true

See more at GitHub documentation

Gitlab

allow_failure: true

See more at Gitlab documentation

Building TeXtidote

First make sure you have the following installed:

  • The Java Development Kit (JDK) to compile. TeXtidote requires version 8 of the JDK (and probably works with later versions).
  • Ant to automate the compilation and build process

Download the sources for TeXtidote from GitHub or clone the repository using Git:

git clone [email protected]:sylvainhalle/textidote.git

Compiling

First, download the dependencies by typing:

ant download-deps

Then, compile the sources by simply typing:

ant

This will produce a file called textidote.jar in the folder. This file is runnable and stand-alone, or can be used as a library, so it can be moved around to the location of your choice.

In addition, the script generates in the docs/doc folder the Javadoc documentation for using TeXtidote.

Testing

TeXtidote can test itself by running:

ant test

Unit tests are run with jUnit; a detailed report of these tests in HTML format is available in the folder tests/junit, which is automatically created. Code coverage is also computed with JaCoCo; a detailed report is available in the folder tests/coverage.

About the author

TeXtidote was written by Sylvain Hallé, Full Professor in the Department of Computer Science and Mathematics at Université du Québec à Chicoutimi, Canada.

Like TeXtidote?

TeXtidote is free software licensed under the GNU General Public License 3. It is released as postcardware: if you use and like the software, please tell the author by sending a postcard of your town at the following address:

Sylvain Hallé
Department of Computer Science and Mathematics
Univerité du Québec à Chicoutimi
555, boulevard de l'Université
Chicoutimi, QC
G7H 2B1 Canada

If you like TeXtidote, you might also want to look at PaperShell, a template environment for writing scientific papers in LaTeX.

References to TeXtidote

Some evidence that TeXtidote is used by actual humans:

  • Someone developed an extension for Vim
  • A demo video shows how to use it (and I was not involved in this)
  • TeXtidote is part of the formulas in Homebrew
  • Number of downloads and GitHub stars ;-)

Why is it called TeXtidote?

TeXtidote is a play on Antidote, which is a spelling/grammar checker well known to French-speaking users and works with word processors. So TeXtidote is like a version of Antidote for TeX.

textidote's People

Contributors

acorbe avatar albertz avatar ashwinvis avatar bong0 avatar bratekarate avatar chenrui333 avatar chenyuheng avatar comanderkai77 avatar daniel-vera-g avatar dezeroku avatar dipzza avatar epabion avatar erikbjare avatar fischer96 avatar ibirisol avatar jsoref avatar ldeakin avatar lkempf avatar matthiaslohr avatar mayjs avatar mgskjaeveland avatar ms-jpq avatar neil-lindquist avatar pierremarchand20 avatar real-or-random avatar sylvainhalle avatar theconner avatar toolcreator avatar vmartinv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

textidote's Issues

Specify custom environment names to ignore

Through a new command line switch. So, typing

textidote --ignore foo ...

will be such that environments \begin{foo}...\end{foo} will be taken out from the file before analyzing.

Related to comments first written in issue #31.

Line -1 does not exist

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Line -1 does not exist
        at ca.uqac.lif.textidote.as.AnnotatedString.getLine(AnnotatedString.java:630)
        at ca.uqac.lif.textidote.rules.RegexRule.evaluate(RegexRule.java:121)
        at ca.uqac.lif.textidote.Linter.evaluateAll(Linter.java:125)
        at ca.uqac.lif.textidote.Main.mainLoop(Main.java:269)
        at ca.uqac.lif.textidote.Main.main(Main.java:85)

Exception when running on a .tex

$ java -jar ~/textidote.jar --read-all --check en main.tex
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
TeXtidote v0.4 - A linter for LaTeX documents
(C) 2018 Sylvain Hallé - All rights reserved

Exception in thread "main" java.util.EmptyStackException
	at java.util.Stack.peek(Stack.java:102)
	at ca.uqac.lif.textidote.rules.CheckSubsections.evaluate(CheckSubsections.java:97)
	at ca.uqac.lif.textidote.Linter.evaluateAll(Linter.java:126)
	at ca.uqac.lif.textidote.Main.mainLoop(Main.java:318)
	at ca.uqac.lif.textidote.Main.main(Main.java:93)

A simple repro :

\documentclass{article}
\begin{document}
\section{A}
\chapter{B}
\end{document}

Another:

\documentclass{article}
\begin{document}
\section{A}
\paragraph{B}
\end{document}

Add warning on `~:`

You should not manually force a space before a punctuation sign; if one is needed LaTeX takes care of this by itself.

Problem processing German texts

I just discovered your tool through a link on researchgate.net and I do like it a lot. Great work!

I installed version 0.5.1 and tried to run a sample file

textidote --html --check de sample.tex >sample.html

In this case I get the following error message:

TeXtidote v0.5.1 - A linter for LaTeX documents
(C) 2018 Sylvain Hallé - All rights reserved

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.languagetool.language.German.getRelevantRules(German.java:168)
	at org.languagetool.language.GermanyGerman.getRelevantRules(GermanyGerman.java:43)
	at org.languagetool.JLanguageTool.getAllBuiltinRules(JLanguageTool.java:279)
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:186)
	at org.languagetool.JLanguageTool.<init>(JLanguageTool.java:157)
	at org.languagetool.MultiThreadedJLanguageTool.<init>(MultiThreadedJLanguageTool.java:76)
	at org.languagetool.MultiThreadedJLanguageTool.<init>(MultiThreadedJLanguageTool.java:67)
	at org.languagetool.MultiThreadedJLanguageTool.<init>(MultiThreadedJLanguageTool.java:51)
	at ca.uqac.lif.textidote.rules.CheckLanguage.<init>(CheckLanguage.java:85)
	at ca.uqac.lif.textidote.Main.mainLoop(Main.java:313)
	at ca.uqac.lif.textidote.Main.main(Main.java:96)
Caused by: java.lang.IllegalArgumentException: 'de' is not a language code known to LanguageTool. Supported language codes are: ast-ES, be-BY, br-FR, ca-ES, ca-ES-valencia, da-DK, el-GR, en, en-AU, en-CA, en-GB, en-NZ, en-US, en-ZA, eo, es, fa, fr, gl-ES, it, ja-JP, nl, pl-PL, pt, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sr, sv, uk-UA, zh-CN. The list of languages is read from META-INF/org/languagetool/language-module.properties in the Java classpath. See http://wiki.languagetool.org/java-api for details.
	at org.languagetool.Languages.getLanguageForShortCode(Languages.java:151)
	at org.languagetool.rules.de.OldSpellingData.<init>(OldSpellingData.java:49)
	at org.languagetool.rules.de.OldSpellingRule.<clinit>(OldSpellingRule.java:35)
	... 11 more

I also tried the country codes de_AT and de_CH as specified on https://github.com/sylvainhalle/textidote, but they did not work either.

textidote works good with English tex files and language specification, i.e., --check en. So there are no error messages triggered when English texts are processed.

Error on specifying --check language

I get an error when I use the --check argument

It happens not matter what I specify (en, or en_UK etc)

TeXtidote v0.5.1 - A linter for LaTeX documents
(C) 2018 Sylvain Hallé - All rights reserved

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/languagetool/JLanguageTool : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
	at ca.uqac.lif.textidote.Main.mainLoop(Main.java:313)
	at ca.uqac.lif.textidote.Main.main(Main.java:96)

Add the option to analyse inputs

Hello

It would be useful if the code also processed included sub files via the \input command

For example at the moment a master document such as

\documentclass[11pt]{article}
\begin{document}

\section{Introduction}
\input{Intro.tex}

\section{Conclusion}
\input{Conclusion.tex}

\end{document}

would only analyse section headers. The paragraphs etc which are contained in sub files Intro.tex and Conclusion.tex are ignored. At the moment textidote has to be run individually on each independent file which takes time. A feature enhancement would take sub files into account.

Many thanks

Rewrite `AnnotatedString`

This class is somewhat buggy, see #50.

It could be rewritten in a simpler way, since there are a few features that complicate its implementation and that are not even used by TeXtidote. Namely:

  • multi-line ranges. No transformation of the text ever inserts or deletes line breaks elsewhere than at the end of a line. Therefore, ranges could be limited to a single line, which would make computations about relative positions much easier and less error-prone.

Gramma before math

The grammar check does not handle math correctly. I don't know if this will make unwanted other issues, but textidote gives grammar mistake when writing.

  • an $2$-strong digraph

without math environment the grammar is correct (at least in my tests)

  • an 8-strong digraph
  • a 2-strong digraph

Use the report.html to work with browser extensions like grammarly

I would like to thank Sylvain for this very useful tool.

After producing the report.html I got the idea of trying the Grammarly and Ginger chrome extensions on the HTML file but didn't work. Even opening the file with Jupyterlab, the extensions failed. I did a test online and Grammarly homepage picked up some mistakes that went through me.

I would appreciate if the textidote HTML file could work with these chrome extensions.

Best Regards,
André

TeXtidote config file

Rather than specify all parameters through the command line, TeXtidote could automatically look for a default file (e.g. .textidote or _textidote) that contains the command line arguments. When started, TeXtidote would first look for such a file and parse the command line arguments there. If any arguments are specified at the "real" command line, they would overwrite the corresponding argument in the file.

In counterpart, a command-line switch should be added to force TeXtidote to ignore that file when asked.

\ldots

Textidote considers that \ldots is a spelling mistake and it does not seem possible to include it inside the dictionary

Produce a hash of the analysis

Principle: someone verifies a text with the tool, sends you the PDF and some "ID" produced by TeXtidote. The recipient can verify the ID "fits" with the PDF that comes with it.

Goal: your students assure you they used TeXtidote on their text, but when you run TeXtidote on it by yourself, you find plenty of errors. Having them send you the ID would at least guarantee they ran it on the PDF they are sending you.

NullPointerException with --check

When I run textidote.jar --html --check en my.tex I get

TeXtidote v0.4 - A linter for LaTeX documents
(C) 2018 Sylvain Hallé - All rights reserved

Exception in thread "main" java.lang.NullPointerException
	at ca.uqac.lif.textidote.rules.CheckLanguage.evaluate(CheckLanguage.java:160)
	at ca.uqac.lif.textidote.Linter.evaluateAll(Linter.java:131)
	at ca.uqac.lif.textidote.Main.mainLoop(Main.java:314)
	at ca.uqac.lif.textidote.Main.main(Main.java:89)

It seems that this line is wrong:

Position start_src_pos = null, end_src_pos = null;

It should initialize variables with Position.NOWHERE, not null

Use of external language tool should be possible

I just downloaded and tested TeXtidote v0.6
It seems to be exactly the tool I was looking for, but it seems I cannot use my own language tool version with ngrams support enabled.
It would be nice if the user could either point textidote to an external language tool jar file, or to a running language tool instance (and connect to it maybe via its server feature), or point the built in language tool to an existing ngrams directory.

\cref and \Cref not recognized

Hello,

Seems like the commands from cleveref [1] are not properly detected, I get errors about unreferenced figures such as

* L364C12-L618C34 Figure fig:resampling_example is never referenced in the 
  text [sh:figref] 
      \label{fig:resampling_example}
             ^^^^^^^^^^^^^^^^^^^^^^^

but they are properly referenced by cleveref, producing a false positive. It's probably missing a quick filter for matching the cleveref equivalent of \ref.

[1] https://ctan.org/pkg/cleveref

Screenshot does not correspont command

Hi.

A small correction, the screenshot under your description for HTML report does not correspond to the command in the section.

Command: $ textidote --html example.tex > report.html
Screenshot: $ textidote --check en --html example.tex > report.html

British english

Hello,

I was wondering whether British English will also be supported?
Right now American English seems to be the only way.

Support for Markdown

  • Autodetect by file extension
  • Override by command-line switch: --tex vs. --md
  • Rename current --detex option to --clean
  • Would be much easier to clean than LaTeX

Wrong line location (L1C1) when using trivial inline math

I found a lot of mistakes on L1C1, when checking my text. Especially visible when using HTML output:
screenshot from 2018-12-19 17 56 35

It seems that when you have inline math without symbols such as =, the location of any problem is L1C1-L1C1. The following is a minimal working example:

\documentclass[a4paper]{article}

\begin{document}

\section{Introduction}
This is a $MWE$. It demonstrates a bug when using inline math without math symbols and commands, like this: $a^b$.
\end{document}

Textidote's output when running textidote --check en mwe.tex is

TeXtidote v0.6 - A linter for LaTeX documents and others
(C) 2018 Sylvain Hallé - All rights reserved

Found 3 warning(s)
Total analysis time: 2 second(s)

* L5C2-L5C9 This section is very short (about 21 words). You should consider 
  merging it with another section or make it longer. [sh:seclen] 
  \section{Introduction}
   ^^^^^^^^
* L1C1-L1C1 Possible spelling mistake found (23) [lt:en:MORFOLOGIK_RULE_EN_US] 
  This is a MWE. It demonstrates a bug when using in
  ^
* L1C1-L1C1 Possible spelling mistake found (116) 
  [lt:en:MORFOLOGIK_RULE_EN_US] 
  This is a MWE. It demonstrates a bug when using in
  ^

StringIndexOutOfBoundsException when dictionary contains names including '

Hello,

When a dictionary includes names such as CONF'12 that correspond to acronyms of scientific conferences for example, textidote raises exceptions

textidote -read-all --check en_UK --dict d.txt t.txt
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_UK.UTF-8)
TeXtidote v0.5.1 - A linter for LaTeX documents
(C) 2018 Sylvain Hall? - All rights reserved

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 0, end 1, length 0
at java.lang.String.checkBoundsBeginEnd(java.base@9-internal/String.java:3119)
at java.lang.String.substring(java.base@9-internal/String.java:1907)
at org.languagetool.rules.spelling.SpellingCheckRule.lambda$updateIgnoredWordDictionary$0(SpellingCheckRule.java:108)
at java.util.stream.Collectors.lambda$groupingBy$49(java.base@9-internal/Collectors.java:1049)
at java.util.stream.ReduceOps$3ReducingSink.accept(java.base@9-internal/ReduceOps.java:169)
at java.util.HashMap$KeySpliterator.forEachRemaining(java.base@9-internal/HashMap.java:1600)
at java.util.stream.AbstractPipeline.copyInto(java.base@9-internal/AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(java.base@9-internal/AbstractPipeline.java:474)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(java.base@9-internal/ReduceOps.java:913)
at java.util.stream.AbstractPipeline.evaluate(java.base@9-internal/AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(java.base@9-internal/ReferencePipeline.java:511)
at org.languagetool.rules.spelling.SpellingCheckRule.updateIgnoredWordDictionary(SpellingCheckRule.java:108)
at org.languagetool.rules.spelling.SpellingCheckRule.addIgnoreTokens(SpellingCheckRule.java:100)
at ca.uqac.lif.textidote.rules.CheckLanguage.(CheckLanguage.java:94)
at ca.uqac.lif.textidote.Main.mainLoop(Main.java:313)
at ca.uqac.lif.textidote.Main.main(Main.java:96)

Simple text file 👍
simple test CONF'11 etc.

Simple dictionnary

CONF'11
CONF
abcde

how it works on Windows

Many thanks for the great tool.
I am a Windows user. I tried to run it as described i.e. install example.tex and the textdote.jar in the same folder and try to run the command from Texmaker user command. It says "Error : could not start the command : $ java -jar textidote.jar --html example.tex > report.html"

Could you please support me?

Many thanks in advance

best regards

Feras

Nullpointer exception when checking grammer with LanguageTool

Hello,

I've been trying to get this to work. However, the following error occurs when I set the English grammar check on. This happened for two computers running the latest version and the version before that.
image

Could you maybe check it out?

PS. Amazing that you are doing this project! Thumbs up

For manual download, the language tool check doesn't work.

I wonder if it's because textidote couldn't find the languagetool's jar.

You can also download the TeXtidote executable manually: this works on all operating systems. Simply make sure you have Java version 8 or later installed on your system. Then, download the latest release of TeXtidote; put the JAR in the folder of your choice.

Is there any instruction for where to put the languagetool?

(Note that I'm doing manual download as I'm using a Mac, not Linux.)

Thank you.

Line reference on html output

Hi again. Hope my 'issues' are helps to improve texidote.

It would be nice if the line references are also visible on the HTML output

Cheers

Simple tips could be ignored

Hello,

I'm writing a report in a certain research field where the term intersection is more accepted than crossroads. However, the spellings check says that all words which contain 'intersection' should be changed to some form of crossroad.

This is not my intention and hence I have 100 times the same notice in the html report.
Could there maybe be a function to disable this message?
Maybe also by adding this to the dictionary?

A caption should end with a period

Hi

It seems that the caption-check do not work correctly. I get et comment 'A caption should end with a period' both when it actually does and also when the caption is the empty-string

screenshot from 2018-08-01 12 24 07

Poor output for multiple files

Neither the plain text output of the HTML output works well with multiple files. The plain text output only lists the warnings without the file names, making it hard to find the location of the issue. The html output only displays the text from the last file listed and puts all the warnings on that text which makes the output unless for all files but the last.

How to build the package ?

I wanted to look into fixing my bug but I'm not an expert in Java, and simply running ant yields a lot of errors:

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Buildfile: /home/jcelerier/perso/textidote/build.xml

ant-contrib:
     [echo] ant-contrib is not installed. Downloading...
    [mkdir] Created dir: /home/jcelerier/perso/textidote/lib
      [get] Getting: http://sylvainhalle.github.io/AntRun/dependencies/ant-contrib-1.0b3-bin.zip
      [get] To: /home/jcelerier/perso/textidote/lib/ant-contrib-1.0b3-bin.zip
    [unzip] Expanding: /home/jcelerier/perso/textidote/lib/ant-contrib-1.0b3-bin.zip into /home/jcelerier/perso/textidote/lib

xmltask:
      [get] Getting: http://sylvainhalle.github.io/AntRun/dependencies/xmltask.jar
      [get] To: /home/jcelerier/perso/textidote/lib/xmltask.jar

init:
     [echo] Your extension folder is /usr/java/packages/lib/ext

check-rt:
     [echo] Local bootstrap JAR is not present

compile:
    [mkdir] Created dir: /home/jcelerier/perso/textidote/Source/Core/bin
    [javac] Compiling 30 source files to /home/jcelerier/perso/textidote/Source/Core/bin
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:51: error: cannot find symbol
    [javac] import ca.uqac.lif.util.CliParser;
    [javac]                        ^
    [javac]   symbol:   class CliParser
    [javac]   location: package ca.uqac.lif.util
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:52: error: package ca.uqac.lif.util.CliParser does not exist
    [javac] import ca.uqac.lif.util.CliParser.Argument;
    [javac]                                  ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:53: error: package ca.uqac.lif.util.CliParser does not exist
    [javac] import ca.uqac.lif.util.CliParser.ArgumentMap;
    [javac]                                  ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:24: error: package org.languagetool does not exist
    [javac] import org.languagetool.JLanguageTool;
    [javac]                        ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:25: error: package org.languagetool does not exist
    [javac] import org.languagetool.Language;
    [javac]                        ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:26: error: package org.languagetool does not exist
    [javac] import org.languagetool.MultiThreadedJLanguageTool;
    [javac]                        ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:27: error: package org.languagetool.rules does not exist
    [javac] import org.languagetool.rules.RuleMatch;
    [javac]                              ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:28: error: package org.languagetool.rules.spelling does not exist
    [javac] import org.languagetool.rules.spelling.SpellingCheckRule;
    [javac]                                       ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:47: error: cannot find symbol
    [javac] 	/*@ non_null @*/ protected JLanguageTool m_languageTool;
    [javac] 	                           ^
    [javac]   symbol:   class JLanguageTool
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:77: error: cannot find symbol
    [javac] 	public CheckLanguage(/*@ nullable @*/ Language lang, /*@ non_null @*/ List<String> dictionary) throws UnsupportedLanguageException
    [javac] 	                                      ^
    [javac]   symbol:   class Language
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:105: error: cannot find symbol
    [javac] 	public CheckLanguage(/*@ nullable @*/ Language lang) throws UnsupportedLanguageException
    [javac] 	                                      ^
    [javac]   symbol:   class Language
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:20: error: package org.languagetool does not exist
    [javac] import org.languagetool.Language;
    [javac]                        ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:21: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.AmericanEnglish;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:22: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.AustrianGerman;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:23: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.BritishEnglish;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:24: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.CanadianEnglish;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:25: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.Dutch;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:26: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.French;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:27: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.GermanyGerman;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:28: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.Portuguese;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:29: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.Spanish;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:30: error: package org.languagetool.language does not exist
    [javac] import org.languagetool.language.SwissGerman;
    [javac]                                 ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:45: error: cannot find symbol
    [javac] 	/*@ nullable @*/ public static Language getLanguageFromString(String s)
    [javac] 	                               ^
    [javac]   symbol:   class Language
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:104: error: cannot find symbol
    [javac] 		CliParser cli_parser = new CliParser();
    [javac] 		^
    [javac]   symbol:   class CliParser
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:104: error: cannot find symbol
    [javac] 		CliParser cli_parser = new CliParser();
    [javac] 		                           ^
    [javac]   symbol:   class CliParser
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:105: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("html").withDescription("\tFormats the report as HTML"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:106: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("no-color").withDescription("Disables colors in ANSI printing"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:107: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("check").withArgument("lang").withDescription("Checks grammar in language lang"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:108: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("dict").withArgument("file").withDescription("Load dictionary from file"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:109: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("detex").withDescription("Detex input file"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:110: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("map").withArgument("file").withDescription("Output correspondence map to file"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:111: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("read-all").withDescription("Don't ignore lines before \\begin{document}"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:112: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("replace").withArgument("file").withDescription("Apply replacement patterns from file"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:113: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("quiet").withDescription("Don't print any message"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:114: error: cannot find symbol
    [javac] 		cli_parser.addArgument(new Argument().withLongName("help").withDescription("\tShow command line usage"));
    [javac] 		                           ^
    [javac]   symbol:   class Argument
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/Main.java:115: error: cannot find symbol
    [javac] 		ArgumentMap map = cli_parser.parse(args);
    [javac] 		^
    [javac]   symbol:   class ArgumentMap
    [javac]   location: class Main
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:85: error: cannot find symbol
    [javac] 		m_languageTool = new MultiThreadedJLanguageTool(lang);
    [javac] 		                     ^
    [javac]   symbol:   class MultiThreadedJLanguageTool
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:90: error: package org.languagetool.rules does not exist
    [javac] 		for (org.languagetool.rules.Rule rule : m_languageTool.getAllActiveRules())
    [javac] 		                           ^
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:92: error: cannot find symbol
    [javac] 			if (rule instanceof SpellingCheckRule)
    [javac] 			                    ^
    [javac]   symbol:   class SpellingCheckRule
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:94: error: cannot find symbol
    [javac] 				((SpellingCheckRule) rule).addIgnoreTokens(dictionary);
    [javac] 				  ^
    [javac]   symbol:   class SpellingCheckRule
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:115: error: cannot find symbol
    [javac] 		List<RuleMatch> matches = null;
    [javac] 		     ^
    [javac]   symbol:   class RuleMatch
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/CheckLanguage.java:129: error: cannot find symbol
    [javac] 		for (RuleMatch rm : matches)
    [javac] 		     ^
    [javac]   symbol:   class RuleMatch
    [javac]   location: class CheckLanguage
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:49: error: cannot find symbol
    [javac] 			return new AmericanEnglish();
    [javac] 			           ^
    [javac]   symbol:   class AmericanEnglish
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:53: error: cannot find symbol
    [javac] 			return new CanadianEnglish();
    [javac] 			           ^
    [javac]   symbol:   class CanadianEnglish
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:57: error: cannot find symbol
    [javac] 			return new BritishEnglish();
    [javac] 			           ^
    [javac]   symbol:   class BritishEnglish
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:61: error: cannot find symbol
    [javac] 			return new French();
    [javac] 			           ^
    [javac]   symbol:   class French
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:65: error: cannot find symbol
    [javac] 			return new Spanish();
    [javac] 			           ^
    [javac]   symbol:   class Spanish
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:69: error: cannot find symbol
    [javac] 			return new GermanyGerman();
    [javac] 			           ^
    [javac]   symbol:   class GermanyGerman
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:73: error: cannot find symbol
    [javac] 			return new SwissGerman();
    [javac] 			           ^
    [javac]   symbol:   class SwissGerman
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:77: error: cannot find symbol
    [javac] 			return new AustrianGerman();
    [javac] 			           ^
    [javac]   symbol:   class AustrianGerman
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:81: error: cannot find symbol
    [javac] 			return new Dutch();
    [javac] 			           ^
    [javac]   symbol:   class Dutch
    [javac]   location: class LanguageFactory
    [javac] /home/jcelerier/perso/textidote/Source/Core/src/ca/uqac/lif/textidote/rules/LanguageFactory.java:85: error: cannot find symbol
    [javac] 			return new Portuguese();
    [javac] 			           ^
    [javac]   symbol:   class Portuguese
    [javac]   location: class LanguageFactory
    [javac] 52 errors
    [javac] 1 warning

BUILD FAILED
/home/jcelerier/perso/textidote/build.xml:188: Compile failed; see the compiler error output for details.

Spelling mistake suggestions

Hello, really helpful tool!

I noticed that when using "--check en" option, tooltips for "Possible spelling mistakes" are shown, but there are no suggestion on how to fix the mistakes.

The languagetool seems to provide those suggestions. Is it possible to include them in the tooltips? This would make error correction much simpler.

Treat align as equation

Hi again

align should be treated as equation (such that there does not come unnecessary grammar suggestions)

\begin{align}
\end{align}

Similarly, new theorems and other should be handled like standard theorem, lemma etc.

I guess some kind of ignoring grammar on \begin{xxx} and \end{xxx} whenever there is
\begin{xxx}__\end{xxx} in the text... ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.