## PROMPT 5: write function def


"""
Explanation: Now You Code In Class: Spell Checker
Let's build a rudimentary spell checker. The basic idea is as follows:

provide a list of correctly spelled words
check the itext words against the list of correctly spelled words
output any words not in the list, assuming they are misspelled.

Of course we cannot provide every possible word, but we'll try to fetch words from the internet in a later assignment. 
Advanced Concerns:

case sensitivity The should equal the
stripping punctuation orange. should equal orange
removing whitespace within should equal within

Approach
Let's take a problem simplification approach. This this approach we break the problem, into simpler problems, solve those, then add to the larger problem.

Write a function onlist(word, dictionary) which returns True when we find word in the text string dictionary.
Write tests to make sure 1. works
Use the function to implement our spelling checker.
Address advanced concerns with another function cleanup(word)
Write tests for 4 to make sure it works
Re-write the spell checker final version

Step 1a: Problem Analysis for onlist()
Inputs: 
PROMPT 1

Outputs: 
PROMPT 2

Algorithm (Steps in Program):
PROMPT 3

How many tests are required and why?
PROMPT 4

Step 1b: Code the function
End of explanation
"""


## PROMT 6: tests
dictionary = "a an the is or and"


"""
Explanation: Step 2: Write tests
Let's make sure the function works
End of explanation
"""


from IPython.display import display, HTML
from ipywidgets import interact_manual, widgets
dictionary = "a and an are apple bar car cat dog eat eats ate bird fish for is goes went was has the wheel food water walk swim talk talks walks swims flies tly in on at sky "

display(HTML("<H1>Spellchecker</h1>"))
@interact_manual(text=widgets.Textarea())
def main(text):
        # PROMPT 10 Write code here



"""
Explanation: Step 3a: Problem Analysis v1 program
Inputs: 
PROMPT 7

Outputs: 
PROMPT 8

Algorithm (Steps in Program):
PROMPT 9

Step 3b: Code for 1v program
End of explanation
"""


# HINT Punctuation
from string import punctuation 
punctuation

"""
Explanation: Step 4a: Address concerns with cleanup function
Let's write a cleanup() function to cleaned up the word:

case sensitivity The should equal the
stripping punctuation orange. should equal orange (see hint below)
removing whitespace within should equal within

Inputs: 
PROMPT 11

Outputs: 
PROMPT 12

Algorithm (Steps in Program):
PROMPT 13

How many tests are required and why?
PROMPT 14
End of explanation
"""


# PROMPT 15


"""
Explanation: Step 4b: Write cleanup function
End of explanation
"""


# PROMPT 16


"""
Explanation: Step 5: Write tests
Let's make sure the function works
End of explanation
"""


#PROMPT 17 (copy code cell from PROMPT 10 and edit)


# run this code to turn in your work!
from coursetools.submission import Submission
Submission().submit_now()

"""
Explanation: Step 6: Rewrite final program with cleanup
End of explanation
"""


