You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to put together a prototype that leverages LanguageTool to check the grammar and style of strings and comments in source code files (Python, in my example).
There is a tool that preprocesses the source code and extracts all relevant strings into a separate file, called result.txt. This file is then fed into LanguageTool like so java -jar languagetool-commandline.jar -l en-US --line-by-line --disable WHITESPACE_RULE result.txt.
Generally, it works, but there are a lot of complaints that could have been avoided, if I could explicitly tell LanguageTool which words are correct as they are. For example, consider this output:
2.) Line 187, column 90, Rule ID: MORFOLOGIK_RULE_EN_US premium: false prio=-10
Message: Possible spelling mistake found.
Suggestion: bad Request
...ed names representing failure info, such as `badRequest`. Defaults to `None`. - `tex...
^^^^^^^^^^
3.) Line 189, column 61, Rule ID: MORFOLOGIK_RULE_EN_US premium: false prio=-10
Message: Possible spelling mistake found.
...s`: A list of or a single text used for the `PKIStatusText` structure. Defaults to `"This text ...
^^^^^^^^^^^^^
In the business logic of my program, the terms "badRequest" and "PKIStatusText" are correct.
I've read that I can address this problem by updating my spelling.txt in org\languagetool\resource\en\hunspell. Although it does the trick, my concern is that I am making a global change. The terms in question are fine for program X, but they're not applicable to another program I work on. Ideally, there ought to be a way to pass the path to my custom spelling.txt as an argument to languagetool-commandline.jar, such that I can apply different exceptions to different projects.
How can this be accomplished? Or perhaps there is a better alternative that I am unaware of?
The text was updated successfully, but these errors were encountered:
I don't think there's such a feature. Your best bet is to think of LT as a library and use its output as the input for your own filtering layer that removes these matches.
I am trying to put together a prototype that leverages LanguageTool to check the grammar and style of strings and comments in source code files (Python, in my example).
There is a tool that preprocesses the source code and extracts all relevant strings into a separate file, called
result.txt
. This file is then fed into LanguageTool like sojava -jar languagetool-commandline.jar -l en-US --line-by-line --disable WHITESPACE_RULE result.txt
.Generally, it works, but there are a lot of complaints that could have been avoided, if I could explicitly tell LanguageTool which words are correct as they are. For example, consider this output:
In the business logic of my program, the terms "badRequest" and "PKIStatusText" are correct.
I've read that I can address this problem by updating my spelling.txt in
org\languagetool\resource\en\hunspell
. Although it does the trick, my concern is that I am making a global change. The terms in question are fine for program X, but they're not applicable to another program I work on. Ideally, there ought to be a way to pass the path to my customspelling.txt
as an argument tolanguagetool-commandline.jar
, such that I can apply different exceptions to different projects.How can this be accomplished? Or perhaps there is a better alternative that I am unaware of?
The text was updated successfully, but these errors were encountered: