Giter VIP home page Giter VIP logo

grammatical's Introduction

Grammatical

Pink Bubble Tea with cute eyes and smile, using a typewriter, digital art

Corrects the spelling and grammar of your text using ChatGPT.

Motivation

I have been using this CLI tool internally for a while now. It is not only good at correcting spelling and grammar in your text, but it is also excellent at simplifying complex technical language. Additionally, it perfectly complements Grammarly.

Install

python3 -m pip install grammatical

Usage

This tool requires access to the OpenAI API. It utilizes the gpt-3.5-turbo model. When the spelling and grammar have been corrected, the resulting text will be automatically copied to the clipboard.

Usage: grammatical [OPTIONS]

  Corrects the spelling and grammar of your text using ChatGPT.

Options:
  --text TEXT               Text input for grammar correction
                            If --text flag is used, a prompt will be displayed to enter the text.
                            By default, the most recent text from the clipboard will be used.

  --api_key TEXT            OpenAI API Key
                            By default, key from the OPENAI_API_KEY env var will be used.

  --tone TEXT               Tone of the grammar correction  [default: "social media"]
                            This can be tuned in based on the context of the text.
                            E.g. "formal/informal setting", "academia", "reddit", etc.

  --simplify                Simplify the text

  -i, --input_format TEXT   Specify the input format  [default: text]
                            Useful when working with files like LaTeX, Markdown.

  -o, --output_format TEXT  Specify the output format  [default: text]
                            Useful when working with files like LaTeX, Markdown.

  --help                    Show this message and exit.

Example

Using the defaults:

[09:34][~] # Text in clipboard: I walk to the store and I bought milk
[09:34][~] grammatical
Modified Text:
"I walked to the store and bought milk."
Text copied to clipboard.
[09:34][~]

With options:

[14:39][~] # Text in clipboard: This tool does need access to [OpenAI's API](https://openai.com/pricing). It uses the `gpt-3.5-turbo` model.
[14:40][~] grammatical --tone "documentation" -i "markdown" -o "markdown"
Modified Text:
 This tool requires access to [OpenAI's API](https://openai.com/pricing), utilizing the `gpt-3.5-turbo` model.
Text copied to clipboard.
[14:40][~]

My MacOS Workflow

For my macOS workflow, I have created a new Application in Automator that runs "Grammatical" for convenience. I have also dragged it to the Dock.

Here is the AppleScript that I am using:

tell application "Terminal"
    activate
    do script "grammatical"
end tell

If you are mostly concerned with the defaults, I highly recommend doing this.

License

Under MIT License. The logo is made using Midjourney and licensed under CC BY-NC 4.0.

grammatical's People

Contributors

pncnmnp avatar

Stargazers

Violet avatar Sorto avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.