Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
I wrote a script to automatically apply Grammarly corrections (github.com/isneuu)
35 points by isneu on Feb 1, 2022 | hide | past | favorite | 78 comments


The title makes it sound like its fixing 100s of Grammarly errors, as if Grammarly wasn't providing correct english responses.

But as i understand, its enabling a 'I'm Feeling Lucky' kinda blanket fix on a document.

Consider revising title.


"Apply" sounds like a more correct word, then: "I wrote a script to automatically apply 100s of Grammarly corrections"


Thank you mcv. I changed the title in my Github. Couldn't do here. Anyway, thanks. And nice username.


Fixed above. Er, applied above. Thanks.


Wow! Thank you very much!


Yup, I suggested another title because I first interpreted it as "correct all of the Grammarly autocorrupts".


Apologies for the misunderstanding. I'm corrected by helpful members of this community to do better.


I was initially excited by that because I’ve had the misfortune of being given documents where someone basically did an “apply all” with Grammarly, which introduced a large number of significant errors. The author wasn’t a native speaker and assumed they hadn’t learned all of the rules correctly and made the mistake of trusting the tool.


It must have added unexpected work on your shoulders. Errors are definitely much better than wrong fixes. Good luck with your future work.


In a supreme twist of irony, he should write a script to correct this.


haha great idea


I definitely could have done a better job. Thank you for your suggestion. I will attempt a clearer title from now onwards. I couldn't edit my HN post but I have edited the Github title. Thank you again!


That wouldn't work for me because many of Grammarly's corrections in my documents are clearly wrong. I'm using the Pro version. Grammarly is good for making suggestions but unusable for blind spell checking. It just doesn't know enough words, and some of its grammatical and style features also sometimes go astray.


This is my experience as well. I primarily use it to add missing commas, articles, etc. Sometimes it gives good suggestions for conciseness but I usually accept only about 50% of these suggestions.


That is great. I do a lot of reading before and only leave rooms for general suggestions such as punctuation, caps, spellings. I'd say I accept about 90%-95% of the suggestions.


Particularly in technical or STEM related writing I sometimes need to repeat a word more than what Grammarly likes, and can’t replace it with a synonym because it has a specific meaning (eg “training” in the context of AI). I also try to avoid passive voice as much as possible, but sometimes when talking about software, techniques or processes, it’s the clearest way.

Still, I’m quite happy to have Grammarly’s suggestions.


Cheers @elondaits :)


I'm glad someone else said this. Would you agree that Grammarly is significantly worse than it used to be? This has been my experience lately-- that it makes nonsensical suggestions.

Not to mention it doesn't work with HN or FB.


mmHm... I see your use case. I hope you find a way to improve your efficiency while working. Cheers!


Speaking of Grammarly, are there any good offline tools of similar scope and competency?

I don't really relish the fact that these services have access to potentially very personal information.

Even with the best of intentions, there is no guarantee that now or later some of the information ends up being used in novel and shady ways.


https://github.com/errata-ai/vale

Linters for prose exist.


Haven't tried it myself, but LanguageTool offers a selfhosted variant, that their software can easily switch to.

https://languagetool.org/

https://dev.languagetool.org/http-server


Having found myself doing some proofreading work, I rolled up a few regexes to locate common errors which sped up my workflow and increased my accuracy considerably.


Good luck with your search @renaud!


I'd say this "applies all Grammarly suggestions".


I see. I will attempt more appropriate headlines now onwards. Thank you for sharing. It seems news.yc doesn't allow me to edit the headlines now else would have definitely changed!


Considerable improvement


What does it do when Grammarly disagrees with its self?


Hi Yaur. I had an instance when it started going back and forth between two suggestions that couldn't be fixed. I run the script and I also monitor what's going on to avoid such cases.


Grammarly is wrong so often that I wouldn’t want to automatically apply fixes. My typical Grammarly workflow involves a rejecting most of its suggestions and approving the small proportion that actually make sense.


Mostly agree with you but I'll say it this way: make sure you RE-READ your writing after applying Grammarly's suggestions. I ask this question throughout the re-read: would a human write like this? If not, I toss the suggestion or rewrite. But the suggestions certainly help illuminate moments when neither my writing nor Grammarly's suggestions make sense.


a is predominently singulair, it is grating to see it in collocation with an adverbial phrase involving a quantifier "most", though in the sense that the rejecting is supposed to be one simple train of thought, it has a certain sense of understatement in this case. Still, it's lacking grammatical agreement with the "suggestions", which is a fairly common problem in fact.

It's understandable that a rigid rule of grammar would advise against it. It's called grammarly, not semanticly.


Well, thank you, but that error was the result of a quick rephrasing. I modified one aspect of the sentence to maintain parallelism between the two gerunds without making sure it still made grammatical sense. I should have removed the article. I'm more diligent in a professional context than I am in off-the-cuff HN comments.

(To return the favour, "a is predominently singulair, it is grating to see it in collocation..." includes a comma splice and a misspelling — singulair.)


What are some examples of suggestions Grammarly makes that you have to reject?


From the document I'm working on now:

- Your sentence may be unclear or hard to follow. Consider rephrasing. (the suggested rephrasing makes no sense and is ungrammatical).

- Add a comma (the suggestion is to add a comma between "the" and "most" in the phrase "the most common")

- Choose a different word (the suggestion is to exchange "heavy" for "cumbersome" when the topic is the weight of steel chain).

- Variety (the suggestion is to swap "hooks" for "angles" when the topic is lifting hooks that attach to steel chains)

Plus, I regularly see crap such as in this image. I've no idea what it thinks it's doing.

https://i.postimg.cc/BvRfnfnP/image.png

Other oddities include Grammarly disagreeing with itself. I apply a suggestion, and then Grammarly flags its own change and suggests I change it back to the original or to something else.


Variety in the context of technical document is wrong by default. You are not supposed to use variety of terms, you are supposed to pick one and stick with it.


Indeed, which prompts me to mention one of the most annoying things about Grammarly. It irritates me no end when I deliver technical writing for a client and they respond with a list of "errors" of that sort after they have run it through Grammarly.


Pretty interesting conversation. Thank you Veen for starting it! :)


What kind of documents are you typing that you wouldn’t want to learn from your mistakes? If you apply more than a handful of “fixes” at once, you cannot see what changed, right? And you also don’t know if the sentences still make sense? Or am I missing something here?


Sounds so odd, right? I use it to apply fixes for transcription of YouTube videos. There, YouTube uses lower case for things without commas, caps, and periods. I use another tool called https://pinetools.com/remove-line-breaks to add those things. Overall, it provides a good output. I do have to monitor so that it doesn't mess some things. Some use cases have tighter deadlines, relatively easier and non-serious suggestions.

Regarding learning from mistakes, I vote that Grammarly definitely teaches us to write better.


This is probably more for people pasting in a whole document and wanting to accept all suggestions all at once. Then they can review document after.


You are right! In such use cases, this is a huge time-saver! :D


Off topic, but an interesting tidbit is that the grammar checking backend is built in lisp [1] and has been discussed on HN previously [2]:

[1] https://www.grammarly.com/blog/engineering/running-lisp-in-p...

[2] https://hn.algolia.com/?q=grammarly+lisp


Wow! I only knew this now! Thank you. This language is older than my dad. Haha. The founder made it when he was in MIT. This made me wonder if I'll ever do something that will empower people to make something useful in the future. :) (This comment would be a pretty cool foreshadowing if my life were a movie haha)


Sure, "one click fix" then you wonder why it replaced place/product/people name with stuff that doesn't make sense.

Grammarly probably should have a limited "autofix" for the most basic stuff, surely. But just "fix all" causes more problems than solves it.


I agree. It definitely has some "wait what?!" moments. Its that in our subjective experience while using the app, I've largely had suggestions that could do just fine if implemented without my approval. But yes, there are cases where the "fix all" could cause more problems that it solves. :)


They are obviously using us to train the system so that they can do that in a year or two.


Wow! I came across a new information!


Interesting idea, but I wouldn't use it, because at 10-20% of Grammarly's corrections are wrong.

It even includes endless loops.


Umm hmm... I see so that's your experience. I did come across an instance of endless loops through the tool. My approach is to keep an eye on the kind of suggestions it gives to make sure it doesn't do weird stuff.


Curiosity: why Grammarly and not LanguageTool?

For me: English isn't my native language and LanguageTool have all languages I need.


Having used both, I find Grammarly much better for English texts. It has things like tone analysis, and in general has more in depth checks than LanguageTool.

LanguageTool, on the other hand, supports more languages and is cheaper than Grammarly. It isn't bad for English texts, and will definitely help you with your writing, but not as much as Grammarly.

It really depends on your needs. I use LanguageTool for my everyday needs, but when I'm writing a blog article, I make sure to run it through Grammarly.


Grammarly has a much bigger advertising budget - relatively few people heard about LanguageTool.


Depends on where you live…


I get grammerly ads on youtube constantly.


And I never get any Grammarly ads.

Again, depends on where you live…


Hi scim-knox-twox! Dope name! I used Grammarly because it's the tool I use.

I just discovered Language Tool from your comment. I see similarities between the two apps. mmhm, how's LT for your needs?


Hey, thanks!

I'm using LT since last year and for me everything works like it should :) It's open source (I generally don't like Big-Tech), and I'm probably gonna get Premium soon.

And big plus for me: more than 30 supported languages.

I'm even using LT right now for this comment ;)


That's amazing! I wish you all the very best ahead! :)


i do not use grammarly. been using languagetool in my libreoffice/kde neon but someday it works, someday it does not work. other than that, when it works it just works as advertised.


I never had any problems.


I am surprised no one ever gamified English exercises tailoring the learning experience on the basis of mistakes done by each individual user. You can identify clearly all your weakness, Grammarly fix the, why not building up exercises to fix them at its root?


dear __boos, I absolutely agree. Seeing how Grammarly suggests fixing in your writing has improved my writing too. How about we see this tool as something to apply when the job needs done and the suggestions are usually acceptable? Regarding those exercises portion, I am out of ideas as of now.


Grammarly ads say that they will help you to appear more articulate than you are, so that you can land jobs where articulacy is required. It stumps me a bit, always.


Everyone has seen those Grammarly ads haha. Nice to hear your thoughts elb2020


Yeah, well, if we could have "one-click" to fix it all, that'd be fantastic! Just felt like sharing here.


Appreciate showing this, I get how a one-click moment is what you need. Though my limited usage of Grammarly (few days). Even I have picked up a few - hmmm's in what it wants to change.


I agree. For example, I had a text that said "grandpa grandma" and it suggested "grandpa's grandma!" Clearly not what I had in mind haha. But I am very happy that in my writing, it has showed me almost 98% proper fixes! I love that part of it.


Hi! I tweeted Grammarly and they shared it's a part of their premium feature. I agree. That would save A LOT of time!


Sorry but how to use this? And could author make it a firefox plugin? That would be very handy!


Or you can make a bookmarklets like I just learned from one comment here.

Follow this process to make that bookmarklet:

https://www.freecodecamp.org/news/what-are-bookmarklets/

and paste the code:

javascript: (() => {

  function refreshData()
{ x = 3;

    try {
if (document.querySelector('.cards-replacements_labels-itemRemove') !== null) { var newclass = document.querySelector('.cards-replacements_labels-itemRemove');

newclass.click(); } else { var newclass = document.getElementsByClassName("cards-replacements_labels-itemInsert"); newclass = newclass[0]; newclass.click(); } } catch (error) { if ( document.getElementsByClassName("wrapper_fipkee2") !== null) {

var cli = document.getElementsByClassName("wrapper_fipkee2"); var vli = cli[0]; vli.click(); }

}

    setTimeout(refreshData, x*1000);
}

refreshData();

})();

I hope this helps! :)


Hi terry. It's easy. Copy the code from https://github.com/isneuu/autofix-grammarly-errors/blob/main...

For chrome or brave browser, go to your grammarly web, press F12 and paste that code. It will open what is called Console.

For Firefox, press F12, and you'll see tabs starting with "INSPECTOR, CONSOLE, ..." Press console and paste the code. I haven't tried it for firefox as my primary browser is chrome.

I've pasted the readme file for your convenience.

1. Go to Grammarly Web app 2. Go to Editor Settings, turn on "Auto-jump to the next suggestion" 3. I made it primarily for the "Correctness" tab in Grammarly. It also works for others.

Please know that I'm eager to reply to your queries here and help you. This tool definitely helps. :)


Anyone read the code and find the lack of formatting kind of odd?


Hi taf2, yeah, now that you've pointed it out, I kinda understand it. I wrote the code in Ubuntu's text editor. I was in a rush to get my job done in time.

However, now that you've pointed it out, I fixed it. Credit for this formatting goes to you :)


@isneu: I think you can make a bookmarklet out of your script


WOW! That's amazing! I just learned about bookmarklets, and made one for this script. It requires us to remove the comments. Else it works like a charm! I love it. Many thanks! :D


Weird headline wording suggests grammerly is wrong and this guy fixed it.


Now that a few have pointed, I definitely see it. Much appreciated what you took time to point out.

Also, nice username.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: