kshitij10000 commited on
Commit
b456333
Β·
1 Parent(s): da86563

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from spellchecker import SpellChecker
3
+ from language_tool_python import LanguageTool
4
+ st.title("πŸ“ Spelling and Grammar Checker")
5
+ st.markdown("# Welcome to the Spelling and Grammar Checker! βœ¨πŸ“š")
6
+ input_text = st.text_area("Enter your text:")
7
+
8
+ if st.button("Check Spelling and Grammar πŸš€"):
9
+ # Initialize spell checker
10
+ spell = SpellChecker()
11
+ words = input_text.split()
12
+ # Correct spelling using PySpellChecker
13
+ corrected_words = [spell.correction(word) for word in words]
14
+ corrected_text = " ".join(corrected_words)
15
+ tool = LanguageTool('en-US')
16
+ # Perform grammar and contextual correction
17
+ grammar_corrected_text = tool.correct(corrected_text)
18
+ st.subheader("βœ… Corrected Text:")
19
+ st.write(grammar_corrected_text)