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

An vs a with mathematics #92

Closed
tobiasdiez opened this issue Aug 10, 2020 · 5 comments
Closed

An vs a with mathematics #92

tobiasdiez opened this issue Aug 10, 2020 · 5 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@tobiasdiez
Copy link

Is your feature request related to a problem? Please describe.
When using mathematical expressions, the an-vs-a check leads to suboptimal results. For example,

This is an $n$-dimensional problem.

results in a warning (although it is grammatically correct as $n$ is pronounced "an").

Describe the solution you'd like
No warning message in the above example, but a warning if "a" is used instead.

Describe alternatives you've considered

Additional context

@tobiasdiez tobiasdiez added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label Aug 10, 2020
@valentjn
Copy link
Owner

This is a known issue, see first point of https://valentjn.github.io/vscode-ltex/docs/contributing-code-issues.html#known-issues-and-limitations. It's not possible to solve this without fully parsing LATEX with proper macro expansion etc. Even then, it would still be hard to decide (e.g., whether a u is really like uniform or rather like undecidable; actually, even LanguageTool warns for the correct This is a u-dimensional space.)

This is exactly what LTEX's Ignore in this sentence feature was invented for.

@valentjn valentjn added the 3-out-of-scope Issue resolution: Issue is out of LTeX's feature scope, or fixing this would be too complicated label Aug 10, 2020
@tobiasdiez
Copy link
Author

I agree that is not possible to have a solution that works in all cases without a complete parsing of Latex. But it should be fairly straightforward to support the most common single-letter expressions like $n$, $N$, \( n \)$, which I guess already cover a lot of cases.

Maybe its possible to use the dummy feature and replace these expressions by some word having the same sound as the single-letter. For example, use "antic" in place of "n", so that LangugeTools sees This is a antic-dimensional problem.?

@valentjn valentjn reopened this Aug 11, 2020
@valentjn valentjn removed the 3-out-of-scope Issue resolution: Issue is out of LTeX's feature scope, or fixing this would be too complicated label Aug 11, 2020
@valentjn valentjn self-assigned this Aug 11, 2020
@valentjn valentjn added this to the 6.3.0 milestone Aug 11, 2020
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Aug 11, 2020
@valentjn
Copy link
Owner

Fair enough, I thought this was about solving this in general. Thanks for the request.

@tobiasdiez
Copy link
Author

Thanks a lot for the quick implementation! Much appreciated.

@valentjn
Copy link
Owner

Fix released in 6.3.0.

me-johnomar added a commit to me-johnomar/ltex-ls that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants