Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spelling program.
#1
I'm trying to create a program that checks your spelling. It will ask the user what word they want to spell and then they will type it out, this isn't a project I'm serious about as I'm just trying to learn how something like this would work, but my dad suggested that I add a feature where it would check the letters in the input and tell you how many you got right.

How would I go around doing something like this?

Word = 0
Answer = 0
Correct = 0
Incorrect = 0
Loop = True 
IfLoop = 0

while Loop:
    print("Choose a word.")
    Word = input("")

    print(f"Spell {Word}")
    Answer = input("")

    if Answer == Word:
        print("Correct! Well done!")
        Correct = Correct + 1
        print(f"Correct:{Correct}\nIncorrect:{Incorrect}")
    elif Answer != Word:
        print("Incorrect...")
        Incorrect = Incorrect + 1
        print(f"Correct:{Correct}\nIncorrect:{Incorrect}")

    IfLoop = int(input("Do you want to go again?\n1)Yes\n2)No\n"))
    if IfLoop == 1:
        Loop = True
    elif IfLoop == 2:
        Loop = False
        
Reply
#2
You might want to do this using a package like NLTK which can give all possible spellings and select one from sentence context.
https://www.nltk.org/
Reply
#3
(May-11-2019, 02:54 PM)Larz60+ Wrote: You might want to do this using a package like NLTK which can give all possible spellings and select one from sentence context. https://www.nltk.org/

Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Spelling correction jareyesluengo 0 1,431 Apr-07-2020, 02:44 PM
Last Post: jareyesluengo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020