Spaces:
Sleeping
Sleeping
File size: 637 Bytes
05d4d7d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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.") |