valentjn / ltex-ls

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
787 stars 38 forks source link

Spurious spelling errors in Spanish formulas #167

Open saulaxel opened 2 years ago

saulaxel commented 2 years ago

When setting the languages to Spanish "es", math formulas start showing some spelling mistakes similar to "dumm", "dummy1" or "ina4".

This is the English document, which produces no errors when using ltex-cli en.tex

\documentclass{article}
\begin{document}
\section{Section}
$$x$$
\(x\)
\end{document}

The Spanish version is almost the same:

\documentclass{article}
\begin{document}
\section{Sección}
$$x$$
\(x\)
\end{document}

When executing with:

echo '{"ltex.language":"es"}' > config; ltex-cli --client-configuration=config --verbose es.tex

It produces the following diagnostics:

es.tex:4:4: info: 'Dumm': Se ha encontrado un posible error ortográfico. [MORFOLOGIK_RULE_ES]
$$x$$
   Use 'Durmió'
   Use 'Rummy'
es.tex:5:4: info: 'Ina1': Se ha encontrado un posible error ortográfico. [MORFOLOGIK_RULE_ES]
\(x\)
   Use 'Una'
   Use 'Final'
   Use 'Unas'
   Use 'Iba'
   Use 'Ana'

The same happens if the formula is empty or is a complex formula, but $$x$$ is just used as a demostration.

nacmartin commented 1 year ago

Also footcites produce this false positive in Spanish. A code like \footcite{Higuchi} is seen by Ltex as "Dummy1", and succesive footcites as "Dummy2", "Dummy3"... which are then marked as errors.

Is there a way to at least ignore all words that have the form Dummy\d+?

greg19 commented 1 year ago

This also happens in Polish.