8000 GitHub - richardhapb/neospeller: Spell checking for different languages comments.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

richardhapb/neospeller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeoSpeller


ezgif-3d81514ffe89fb


An awesome project to help you spell and grammar better! Pass your code with comments through stdin and receive a corrected version through stdout.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing

About The Project

A command-line tool written in Rust that uses LLM API to correct spelling and grammar in code comments.

This is useful for developers who want to improve their spelling and grammar in their code comments. That can connect to your editor through a plugin or extension, or you can use it as a standalone tool.

The app uses at the moment the OpenAI GPT-4 mini, and only send to the model the comments, avoiding the code, that is important for reducing the cost of the service. I will add more models in the future, and the user will be able to choose the model to use.

Getting Started

You need two simple things to get started, an API key from OpenAI and make sure you have Rust installed in your machine. If you don't have Rust installed, you can install it using rustup.

Installation

  1. Clone the repo

    git clone https://github.com/richardhapb/neospeller.git
  2. Execute the installation script (that will request your password to install the binary in /usr/local/bin)

    cd neospeller
    ./install.sh
  3. Export the API key as an environment variable:

    export OPENAI_API_KEY="your-api-key"

Usage

You can use the app in two ways, passing the code through stdin or passing a file as an argument. A needed argument is --lang that is the language of the comments in the code. The language is used to extract the comments from the code, and the code is not sent to the model.

neospeller --lang python < file.py
neospeller --lang javascript < file.js

or

cat file.py | neospeller --lang python
cat file.js | neospeller --lang javascript

You can redirect the output to a file:

neospeller --lang python < file.py > corrected_file.py

or

cat file.py | neospeller --lang python > corrected_file.py

Also, you can use this neovim plugin to correct the comments in the current buffer: neospeller.nvim

Available languages and their respective codes:

  • Python (python)
  • Rust (rust)
  • Javascript (javascript)
  • CSS (css)
  • C (c)
  • Lua (lua)
  • Bash (bash)
  • Plain text (text)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git switch -c feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

About

Spell checking for different languages comments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0