[SOLVED] Grammar Checker app in python using gingerit


I tried to create a grammar checking app in python using gingerit and flask. It shows some error the home page is displaying fine but after I enter the data and hit enter It shows:”Internal Error -500″ And I think the error is in the index.html page.


from gingerit.gingerit import GingerIt
from flask import Flask, request, render_template, redirect
app= Flask (_name_) 
def sent():
   if request.method == "GET": 
       return render_template("index.html")
       if not request.form["SENT"]: 
             return redirect("/")
@app.route('/sent correct', methods=["GET", "POST"]) 
def sent_correct():
  if request.method == 'POST':
    text = request.form["SENT"]
    parser = GingerIt() 
     result = parser.parse(text)['result'] 
    return render_template('index.html", output1=result)



You can install Gingerit from PyPl using the following command:

pip install gingerit


  • After installing and importing the gingerit package, it can be used to correct the grammatical and spelling mistakes of the given input text.
  • Pass the text to parse() function from gingerit package, it returns a dictionary of outputs with keys as: ‘corrections’, ‘text’, ‘result’.

This Content is from Stack Overflow. Question asked by Kavi  , This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 4.0.

people found this article helpful. What about you?