Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equations incorrectly Dummied in LTex-French #27

Closed
bilelomrani1 opened this issue Mar 11, 2020 · 1 comment
Closed

Equations incorrectly Dummied in LTex-French #27

bilelomrani1 opened this issue Mar 11, 2020 · 1 comment
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch

Comments

@bilelomrani1
Copy link

bilelomrani1 commented Mar 11, 2020

Describe the bug
When writing in French, math is not correctly handled by the parser. It raises a FR_SPELLING_RULE at the end of every equation, both inline and envs.

Steps to reproduce
Steps to reproduce the behavior:

Lint the following .tex file:

\documentclass{article}

\begin{document}

Pour un ordonnancement de $N-k+1$ questions $i_k, \dots, i_N$, notons $J_k(i_k, \dots, i_N)$. Pour tout $k$ nous avons la relation
\begin{align}
    J_k(i_k, \dots, i_{N+1}) &=  p_{i_k} \left( R_{i_k} + J_{k+1}(i_{k+1}, \dots, i_{N+1}) \right) - (1-p_{i_k}) F_{i_k} & \text{si $i_k \neq \Delta$}, \\
    J_k(i_k, \dots, i_{N+1}) &= 0 & \text{si $i_k = \Delta$}
\end{align}

\end{document}

The linter raises 8 spelling errors at the end of each equation and inside the align environment.

Expected behavior
The parser should dummy the equations like it is the case for the english support.

Outputs
Here is the LTeXLanguage Server output

mars 11, 2020 7:27:38 PM org.bsplines.languagetool_languageserver.LanguageToolLanguageServer initialize
INFOS: Setting locale to fr
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
mars 11, 2020 7:27:44 PM org.bsplines.languagetool_languageserver.LanguageToolLanguageServer lambda$validateDocument$3
INFOS: Checking the following text in language fr via LanguageTool: "\n\n\n\nPour un ordonnancement de Dummy0 questions ...Dummy1, notons ...Dummy2. Pour tout Dummy3 nous av"... (truncated to 100 characters)
mars 11, 2020 7:27:48 PM org.bsplines.languagetool_languageserver.LanguageToolLanguageServer lambda$validateDocument$3
INFOS: Obtained 8 rule matches
mars 11, 2020 7:27:48 PM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
INFOS: Unsupported notification method: $/setTraceNotification
mars 11, 2020 7:27:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
AVERTISSEMENT: Unmatched cancel notification for request id 1
mars 11, 2020 7:27:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
AVERTISSEMENT: Unmatched cancel notification for request id 2
mars 11, 2020 7:27:48 PM org.bsplines.languagetool_languageserver.LanguageToolLanguageServer lambda$validateDocument$3
INFOS: Checking the following text in language fr via LanguageTool: "\n\n\n\nPour un ordonnancement de Dummy0 questions ...Dummy1, notons ...Dummy2. Pour tout Dummy3 nous av"... (truncated to 100 characters)
mars 11, 2020 7:27:48 PM org.bsplines.languagetool_languageserver.LanguageToolLanguageServer lambda$validateDocument$3
INFOS: Obtained 8 rule matches

LTeX configuration
settings.json:

{
    "languageTool.language": "fr",
    "ltex.language": "fr",
}
@bilelomrani1 bilelomrani1 added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Mar 11, 2020
@bilelomrani1 bilelomrani1 changed the title Equations incorrectly Dummy-fied in LTex-French Equations incorrectly Dummied in LTex-French Mar 11, 2020
@valentjn valentjn added 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Mar 12, 2020
@valentjn valentjn self-assigned this Mar 12, 2020
@valentjn
Copy link
Owner

@bilelomrani1 Thanks for the extensive bug report!

The problem was that the French LT rules didn't ignore Dummy0, Dummy1, etc., like the English and German rules do (which are the only ones that I can test, really). Using Jimmy-0, Jimmy-1, etc., seems to work just fine 😉 In addition, I fixed an additional bug that occurred when using \dots in math mode. With these fixes, I now get zero rule matches for your example. The fixes have been released in LTEX version 4.7.10.

PS: languageTool.language is not an LTEX setting, these all start with ltex.

@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants