amperser / proselint

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

Add rule with technical dictionary #142

Open suchow opened 9 years ago

suchow commented 9 years ago

https://github.com/azu/technical-word-rules

kylesezhi commented 8 years ago

I can read Japanese and am interested in taking this one on!

How do I test a new folder that I put in checks locally?

suchow commented 8 years ago

If you've cloned the repository and added a new directory to /proselint/checks/, then add a new line to proselint/.proselintrc with the name of the module.

kylesezhi commented 8 years ago

And .. how do I actually run my local version of proselint? 😊 python ./proselint test-text.md ?

kylesezhi commented 8 years ago

(Also if there is an IRC/Slack where I can bug you about this, I can do that.)

suchow commented 8 years ago

You can install the local version as a command-line utility by going into the proselint root directory and running python setup.py develop.

suchow commented 8 years ago

You'll want to first install the requirements pip install -r requirements.txt.

kylesezhi commented 8 years ago

Then I can use it normally as just proselint from any directory?

suchow commented 8 years ago

Yes.

suchow commented 8 years ago

And any changes to your local code will automatically be applied when you run proselint.

kylesezhi commented 8 years ago

One more question: is there a way to easily check a word's capitalization? For instance, if I find jAvAscRIpt, can I easily tell proselint to fix it to Javascript?

suchow commented 8 years ago

One way to tell if the capitalization of a word w is wrong with respect to some standard s is to check whether the following two conditions hold:

  1. When each is converted to lower case, the two words are equal: w.lower() == s.lower().

AND

  1. Two two strings are not equal: w != s.

If you have a list of technical words where each is correctly capitalized, you could first use our tools.existence_check() function with the ignore_case case flag set to true to find all the words that satisfy condition 1, then test for equality to filter out the non-errors that do not satisfy condition 2.

kylesezhi commented 8 years ago

615 Is my first attempt at this! Feedback appreciated.