amperser / proselint

A linter for prose.
http://proselint.com
BSD 3-Clause "New" or "Revised" License
4.36k stars 179 forks source link

Add a rule on the passive voice #534

Open hansbogert opened 8 years ago

hansbogert commented 8 years ago

In some fields it's not advised to use the passive voice. There are two packages for Emacs which do mark uses of passive voice: Writegood and text-linter.

Can we also have a passive voice linter for proselint?

suchow commented 8 years ago

Yes, although I think this will be quite hard to do well. Garner notes six contexts where the passive is okay, then goes on to say "Still, professional editors find that these six situations account for only about 15% to 20% of the contexts in which the passive appears. That means you ought to have a presumption against the passive, unless it falls into one of the categories just listed."

Can you send a link to text-linter? I'm not familiar with it and I would be curious to see how they approach the problem.

kylesezhi commented 8 years ago

This is one implementation: https://github.com/btford/passive-voice/blob/master/passive.js

keshav-elevio commented 7 years ago

I think StanfordDependencyParser can detect active and passive voice. I agree with suchow, its very subjective

hansbogert commented 7 years ago

I owe you a link to text-linter: http://textlint.lukas-renggli.ch/?_s=iEd0KmEO5Oc7Z5r7&_k=0Jc_q_IGmeHVkHPS

ghost commented 7 years ago

You simply determine if sentence contains the words is, was, be, or variations should be adequate.

suchow commented 7 years ago

@srukle If only it were so simple — you also need a past participle, and sometimes the be or get verb is only implied:

Recently I heard it suggested by a friend that too many books appear with endnotes.

Garner, Bryan (2009-07-28). Garner's Modern American Usage (p. 612). Oxford University Press. Kindle Edition.

DancingQuanta commented 7 years ago

This vim plugin vim-wordy seems to cover passive voices and many other things, focusing on usage of words. Some inspiration could be gained from this.

RyanMcCarl commented 6 years ago

I created a simple regex-based solution that should catch most cases: https://github.com/amperser/proselint/pull/802

I'm open to suggestions for improving it.

Example: Passive voice regex test 2018-06-12.pdf

RyanMcCarl commented 5 years ago

@suchow The simple regex-based passive voice check I made works pretty well and catches most cases. Please feel free to try it out and integrate it if you like.

https://github.com/RyanMcCarl/proselint/blob/master/proselint/checks/passive_voice/passive_voice.py https://github.com/amperser/proselint/pull/802