-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchumor.py
43 lines (36 loc) · 1.24 KB
/
chumor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from chumor import infoWeb
def main():
ans = 'n'
# Get prompt from user
prompt = input("Input prompt:")
# Pass expectation to function that creates graph of expectations
chumor = infoWeb(prompt)
chumor.getSubject()
# Get help from human to make sure subject matter is correct
print("Please confirm if subject is correct\n")
subject_matters = chumor.initialSearch()
for s in subject_matters:
potential_answer = s
print("Is ", potential_answer, " the subject of this sentence?\n")
ans = input("Input y for yes or n for no:")
if ans is "y":
chumor.confirmSubject(s)
print("Thank you for your assistance.")
break
# If list of subject matters were exhausted without finding a solution, exit program.
if ans is "n":
print("Subject failed to be found. Exiting.")
return 1
# Check if outcome subverts expectation
punch = input("Input outcome:")
# If outcome does not subvert expectations, exit program
if not (chumor.detectSubversion(punch)):
print("Humor ✘")
return
print("Humor ✔")
"""
if chumor.detectHumor():
print("Humor ✔")
"""
if __name__ == "__main__":
main()