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

Incorrect warning about "a" versus "an" when using digits as adjective #226

Open
neil-lindquist opened this issue Apr 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@neil-lindquist
Copy link
Contributor

neil-lindquist commented Apr 17, 2023

Textidote gives a warning that "an" should be used instead of "a" when preceding math mode.

With the following latex file,

\documentclass{article}
\begin{document}
This gives a \(30\times\) improvement.
\end{document}

I get

$ java -jar textidote.jar-0.9.jar --check en --no-color textidote-mwe.tex                                                                                                                                         
TeXtidote v0.9 - A linter for LaTeX documents and others                                                                                                                                                          
(C) 2018-2021 Sylvain Hall▒ - All rights reserved                                                                                                                                                                 
                                                                                                                                                                                                                  
Found 1 warning(s)                                                                                                                                                                                                
Total analysis time: 3 second(s)                                                                                                                                                                                  
                                                                                                                                                                                                                  
* L3C12-L3C12 Use 'an' instead of 'a' if the following                                                                                                                                                            
  word starts with a vowel sound, e.g. 'an article', 'an hour'.. Suggestions:                                                                                                                                     
  [an] (11) [lt:en:EN_A_VS_AN]                                                                                                                                                                                    
  This gives a \(30\times\) improvement.                                                                                                                                                                          
             ^                                                                                                                                                                                                    

Using $30\times$ instead of \(30\times\) gives the same warning, but 30\times (without math mode) doesn't result in any warnings. So, it looks like this is an issue with how math mode is detexified.

I've reproduced this with both the 0.9 draft and the 0.8.2 release.

@sylvainhalle
Copy link
Owner

Inline math is converted to the single character "X" for the purpose of grammar checking. This choice is unfortunate as the grammar checker then expects you to write "an X" and not "a X".

I suppose that if we replace "X" by something like "P", it should not trigger this warning.

@sylvainhalle sylvainhalle added the bug Something isn't working label Apr 17, 2023
@neil-lindquist
Copy link
Contributor Author

"P" would probably reduce the frequency of the issue, but there's still 1, 8, etc. Maybe there's a reasonable way to pull initial digits out of inline math? I.e., $30\times$ would become something like 30X.

But, this rabbit hole might not be worth going down, given that proper grammar for inline math is complicated and Latex doesn't have much semantic information to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants