hancav's picture
app.py
05d4d7d
raw
history blame contribute delete
637 Bytes
import streamlit as st
from spellchecker import SpellChecker
spell = SpellChecker()
input_string = st.text_area('Please input a word with a typo for spell checking !!')
if input_string:
words = input_string.split()
corrections = {}
for word in words:
corrected_word = spell.correction(word)
if corrected_word != word:
corrections[word] = corrected_word
if corrections:
st.write("Suggested corrections:")
for original, corrected in corrections.items():
st.write(f"{original} -> {corrected}")
else:
st.write("No spelling mistakes found.")