diff --git a/Feedback.txt b/Feedback.txt new file mode 100644 index 0000000..88bfdb3 --- /dev/null +++ b/Feedback.txt @@ -0,0 +1 @@ +it was not helpful diff --git a/feedbackwords.txt b/feedbackwords.txt new file mode 100644 index 0000000..5811496 --- /dev/null +++ b/feedbackwords.txt @@ -0,0 +1,3 @@ +not helpful +unhelpful +waste of time \ No newline at end of file diff --git a/lonely.txt b/lonely.txt new file mode 100644 index 0000000..548cacf --- /dev/null +++ b/lonely.txt @@ -0,0 +1,5 @@ +i feel unwanted +my friends dont like me +my frinds leave me out +i feel left out +alone \ No newline at end of file diff --git a/negative.txt b/negative.txt new file mode 100644 index 0000000..3b24cae --- /dev/null +++ b/negative.txt @@ -0,0 +1,4 @@ +i want to die +i feel like dying +i want to end it all +i am suicidal diff --git a/peachesstory.py b/peachesstory.py new file mode 100644 index 0000000..82c7ca1 --- /dev/null +++ b/peachesstory.py @@ -0,0 +1,78 @@ +#assuming the rest is done +#if someone just wants to be listened to make sure it replies to certain words to make sure they are being listened to +#advice box, if they say certain things it will detect the words + +#yes = open("yes.txt","r") +#yeswords = yes.read() +#if answer == yeswords: + #print("whatever the yes is for this") + +def unsatisfied_service(): #asks why they aren't happy with their service + answer = str(input("I'm sorry to hear that, why aren't you happy with your service?")) + a = answer.split(". ") + fb = open("feedbackwords.txt","r") + fbwords = fb.read().splitlines() + for word in a: + if any((True for word in a if word in fbwords)): + print("We work hard to make sure our services are helpful. I'm sorry that I was unable to help") + yn = str(input("Would you like your feedback to be recorded?")) + if yn.lower() == "yes": + feedback = open("Feedback.txt","w+") + feedback.write(answer + "\n") # writes answer to file and makes a new line + feedback.close() + print("Your feedback has been recorded, thank you for answering") + else: + ("Thank you for telling us. Your data HAS NOT been recorded") + #INSERT REMINDER TO TALK TO A SPECIALIST (ASMAA) + +def advice(): #when the option for advice is selected + #make it so if they enter keywords it'll autogenerate advice + print("Feel free to vent here and I will listen to you and give you advice") + box = input("") + word_search = [] #https://www.techbeamers.com/python-add-lists-join-concatenate/#:~:text=Python%20Add%20Lists%20%E2%80%93%2010%20Ways%20to%20Join%2FConcatenate,...%206%20itertools.chain%20%28%29%20to%20combine%20lists%20 + word = box.split(". ") + word_search.extend(word) + answer = str(input("I'm happy to keep listening, would you like to continue?")) + while answer.lower() != 'no': #loops so that they can keep venting until they enter the word 'finished' + box = input("") + word = box.split(". ") + word_search.extend(word) + answer = str(input("Thank you for telling me, would you like to continue?")) + else: + print(word_search) + neg = open("negative.txt","r") #stuff that the AI cannot handle for ethical reasons + negative = neg.read().splitlines() + lonely = open("lonely.txt","r") #stuff that the AI cannot handle for ethical reasons + lonelyword = lonely.read().splitlines() + school = open("school.txt","r") #stuff that the AI cannot handle for ethical reasons + schoolword = school.read().splitlines() + for word in word_search: + if any((True for word in word_search if word in negative)): #https://stackoverflow.com/questions/740287/how-to-check-if-one-of-the-following-items-is-in-a-list + print('''I'm sorry to hear that. May I implore you to contact your local hotline. I am unable to help you further. You need medical attention. +Here is a link to all hotlines: https://faq.whatsapp.com/3243110509092762/?locale=en_US''') #why is indenting like this. + if any((True for word in word_search if word in lonely)): + print("Remember that there are people that love you") + if any((True for word in word_search if word in school)): + print("Your mental health is a priority. Work hard at school but make sure you are feeling okay") + + +def listen(): #when the option listen is selected + print("You mentioned you want someone to listen to you, feel free to vent here and I will listen, I won't say anything back :) Enter the phrase 'finished' when you are done") + box = input("") + answer = box.split() #splits the answer up so it can identify the word finsished + length = len(answer) - 1 + while answer[length].lower() != 'finished': #loops so that they can keep venting until they enter the word 'finished' + box = input("") + answer = box.split() #splits the answer up so it can identify the word finsished + length = len(answer) - 1 + else: + print("Thank you for venting to me") + answer = input("Are you happy with your service?") + if answer.lower() == 'yes': + print("*Asmaa part here*") #TO BE REPLACED WITH ASMAA'S FUNCTION + if answer.lower() == 'no': + unsatisfied_service() + + + +unsatisfied_service() diff --git a/school.txt b/school.txt new file mode 100644 index 0000000..4592d43 --- /dev/null +++ b/school.txt @@ -0,0 +1,4 @@ +im struggling in school +my grades are bad +im failing class +i got an F