caderek / gramma Goto Github PK
View Code? Open in Web Editor NEWcommand-line grammar checker
Home Page: https://caderek.github.io/gramma/
License: ISC License
command-line grammar checker
Home Page: https://caderek.github.io/gramma/
License: ISC License
How can I help you?
I would like to know if there is any plan to maintain the project or not.
gramma listen "."
Explanation: Don't put a space before the full stop
The application recognizes a space.
The application does not recognize a space. Instead, for example, the explanation might mention starting the sentence from a dot.
Is there a way to limit checking to user messages? Currently, it checks the diff too.
Hi there,
I was wondering how I could run gramma when I am running VIM with a file open.
I would like gramma to run on the contents of my active text buffer (and then update the text buffer with the corrections).
I tried:
:w !gramma check
as described on: https://teddit.net/r/vim/comments/i3zwmk/grammar_check_for_vim_is_there_any_good_plugin_to/, but to no avail.
This looks like a wonderful tool, please assist :)
Is your feature request related to a problem? Please describe.
I have a script to setup my Arch Linux install, to install this via the script I would need to figure out how the script works then add npm support.
Describe the solution you'd like
A AUR package that let's me more easily install gramma.
Describe alternatives you've considered
Official Arch package or a 3rd party repo might be harder to do however.
In the section "Installation", there are put links for getting specific versions of the application. In general, this is not a bug; but these links are already outdated, and I am worrying that they will remain so. If they will, this may be confusing for the reader, and shall be considered a bug.
The section "Instalation" of the README contains links for getting specific versions of the application.
The section "Instalation" of the README does not contain links for getting specific versions of the application. Instead, there may be put information about getting new versions of the application from the page with releases.
I am interested in summarizing errors from texts in a simple way and not in identifying or implementing fixes. I don't see an option for this, but I am wondering if there is a way to output a single summary line with number of potential mistakes (total) and number of different error classes. Thanks for considering this!
This project has a separate official website: https://caderek.github.io/gramma/. But, I did not find it in the README or anywhere else in the project here (on GitHub). If I am right, then a user that encounters this project here probably has no chance to find its website.
The website https://caderek.github.io/gramma/ is not mentioned in the README or anywhere else in this project on GitHub.
The website https://caderek.github.io/gramma/ is mentioned in the README and/or in the field "Website" on the tab "Code" (next to the project title).
Describe the bug
Using any of the German Languages throws an error:
Details: invalid json response body at http://api.grammarbot.io/v2/check reason: Unexpected token E in JSON at position 0
To Reproduce
Using any of the following languages will throw the error: de de-De de-At de-CH
gramma config language de-DE
Expected behavior
To not throw an error
Desktop (please complete the following information):
After running the application without arguments, there appeared a blank line. The application seemed to not do anything. After pressing ENTER again, there appeared the following string in a new line:
No mistakes found!
After that, there appeared the command prompt, which may mean that the application terminates (I cannot be sure).
This behavior is not described in the documentation, and – for me – seems to be counterintuitive.
The documentation has no description about what happening and/or what is going to happen when run in the console without arguments.
The documentation contains the following information described:
Describe the bug
When running gramma against a markdown file using en-GB language, a new word is found.
Attempting to add it to the dictionary causes an npm error.
New files can be created in users home directory and in current working directory.
To Reproduce
gramma check -m -l "en-GB" Lessons.md
Language: English (GB)
Resolved: 0 | Pending: 12
---------------------------------
Rule: typos
Explanation: Possible spelling mistake found.
Context: # Lessons 1. [What is iRODS?](https://github.com/metadata-school/In...
Suggested fix: 1) rods 2) irons 3) iPods 4) prods
---------------------------------
? What do you want to do?
Enter: default (1)
1-4: choose fix
0: custom fix
i: ignore
l: add to local dictionary
g: add to global dictionary
n: next
› l
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.openSync (node:fs:577:10)
at Object.openSync (pkg/prelude/bootstrap.js:739:32)
at Object.writeFileSync (node:fs:2153:35)
at configure (/snapshot/gramma/src/actions/configure.js:87:6)
at checkInteractively (/snapshot/gramma/src/actions/checkInteractively.js:50:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async check (/snapshot/gramma/src/commands/check.js:32:31) {
code: 'ERR_INVALID_ARG_TYPE'
}
Expected behavior
New word is added to the local dictionary.
Desktop (please complete the following information):
How can I help you?
As title, I'm working behind a proxy and my working-well proxy doesn't seem to be taken by gramma, so doe it mean that it's not supported yet?
Environment: Linux Mint
Proxy Variables: http_proxy, https_proxy.
By the way the SW does looks awsome and with great potential right there. Thanks for your brilliant work ! @caderek
Describe the bug
When I gramma check
a file, it waits for a second and then stops, with no output.
To Reproduce
Try to gramma check
a file
Expected behavior
The gramma checking UI appearing.
Desktop (please complete the following information):
Additional context
This was tested on a web server via SSH. gramma listen
still works with its UI. A workaround I found was running gramma listen "`cat mistake.txt`"
, but you still need to copy the printed changes to the file after going through the wizard.
Is your feature request related to a problem? Please describe.
I'd like to be able to instruct gramma
to ignore a specific finding. I'm using Markdown with Pandoc and have some control sequences like \newpage
which gets picked up as an issue by gramma
/LanguageTool
. These cases make using gramma
difficult because on each run I have to tell it to ignore each and every one every time, or separate out files with these types of sequences.
Describe the solution you'd like
I'd like to be able to instruct gramma
to ignore specific findings by line (similar to most linters). I can see a few ways of accomplishing this.
The first would be to append a Markdown comment to the end of a line to instruct gramma to throw away the finding from the LanguageTool
server:
\newpage <!-- gramma:ignore -->
Another method could be to surround a block of text to control whether or not gramma returns findings, similar to Python's Black formatter.
<!-- gramma:off -->
\newpage
<!-- gramma:on -->
Not sure how this would be accomplished outside of Markdown as the concept of a comment may not work everywhere else this is used.
For my specific case, perhaps a flag for LaTeX could be implemented (--latex
); similar to the --markdown
flag to remove these false positives.
Could also take an approach similar to the VSCode LanguageTool extension and save a database of manually marked false positives as I've done for this case:
{"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\Q\\newpage\\E$"}
Describe alternatives you've considered
I can't think of any alternatives.
Is your feature request related to a problem? Please describe.
Currently, port number is hardcoded 8081
.
gramma/src/server/startServer.js
Lines 35 to 37 in 3023e3a
Describe the solution you'd like
I want to use another port number like following.
gramma server start --port 12345
Describe alternatives you've considered
PORT=12345 gramma server start
Additional context
📝 Current gramma server start
does not show the port number of languagetools server.
if the port number is conflicted, the user can not know the local server url.
$ gramma server start
Starting local API server...
Waiting for local API server...
Waiting for local API server...
API server started! PID: 55069
Describe the bug
command 'npx gramma server install' fails:
res.body.pipe(str).pipe(fileStream)
^
TypeError: res.body.pipe is not a function
To Reproduce
install gramma with node 18.16.0 & npm 9.5.1
Expected behavior
It should download the file
Desktop (please complete the following information):
Additional context
Seems to work if I replace this slice of code in downloadFile.js (L30):
return new Promise((resolve, reject) => {
res.body.pipe(str).pipe(fileStream)
res.body.on("error", (err) => {
reject(err)
})
fileStream.on("finish", () => {
bar.stop()
resolve()
})
})
by
await pipeline(res.body, str, fileStream)
bar.stop()
with const { pipeline } = require('node:stream/promises');
Run the application with the following command:
gramma check "."
Press the ESCAPE key.
The application terminates, and the output contains a stack trace, starting with the following:
(node:12393) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
...
I do not know whether all the described behavior or only part of it is a bug. The README does not contain information about possible behavior of any key. Possibilities of expected behavior are:
This key is not handled
) or to print nothing at all.This key is not handled
) or to print nothing at all.As I have observed, this behavior happen not only using gramma check
, but I have not checked all the possible cases, so I leave for the author finding the scope of this behavior.
UPDATE: This problem happens also with the combination CTRL+D. But, since I cannot currently make the application work, I cannot confirm whether the stack trace is the same. I will try that later.
gramma check
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
...
I do not consider this as a bug or an invalid behavior (it may be indeed the expected behavior). But in general, I think that there is no point to print such an information to a non-developer.
Instead, there might be added a flag -d
/--debug
which would enable all commands to print stack traces in case of a failure particular failures.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.