comeon dave pls click here >http://pastebin.com/56q8L0gH

{ "Wikipedia_Article" : { "description" : "I can coach you in writing a truly objective Wikipedia article!", "responses" : [ "Too much conjecture! Stick to the facts pal.", "You are getting into subjective territory - try removing any traces of opinion from your text", "Don't rely on unreliable sources", "I get the feeling you are trying to court controversy. Perhaps you are biased, or trying to rile up a minority group", "You are doing reasonably well, but I fear that the Wiki moderators may remove your contributions", "A fine addition to the Wikipedia canon!", "Very nice, your writing is devoid of fictitious generalities" ] }, "Love_Letter": { "description" : "I will help you make your dear lover swoon!", "responses" : [ "You will not impress your lover with such banale language", "Your attempts at romance are lacklustre. Perhaps read the poetry of Ovid for some inspiration.", "This is reads like something I would find on a Dr Who fan fiction forum", "Your deep passion is wonderful, and an inspiration.", "Yes, wonderful! If your current relationship falls through, I will marry you myself." ] }, "Complaint": { "description" : "With my coaching, your letter of complaint will get you a refund or possibly some coupons", "responses" : [ "You need to be more threatening. You will never attain redress with this pushover attitude.", "I don't see you getting any refunds. You must be more direct and affirmative.", "You are writing well, but perhaps need to be more demanding with your complaint.", "Yes, strong language always gets you results in business." ] }, "Diary": { "description" : "Write a personal account of your day, for future review by yourself or your grandchildren", "responses" : [ "You should be honest with your diary - more emotional language required.", "Your attitude to your self is very neutral. You must release personal thought from the chalice of your mind", "Don't be afraid to reveal your true self. Feel free to explore your neuroses through your diary.", "I think you're holding back, just a little. You should make more frequent use of words such as 'feel', 'opinion', 'think', and 'consider'", "Considerably enlightening, I can see you are channeling your emotional state", "So truthful and honest, bravo!" ] } }


#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# personalities.json #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ {
"pessimist" : ["that's suitably grim", "too happy"], "optimist": ["Chin up, buddy!", "I like your positive attitude"] }
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


# +-----------------------------------------------------------------------------+ # | ______ ___ _____ _____ ___________ _ _ _____ _____ ___ _____ _ _ | # | | ___ \/ _ \_ _|_ _| ___| ___ \ \ | / __ \ _ |/ _ \/ __ \| | | | | # | | |_/ / /_\ \| | | | | |__ | |_/ / \| | / \/ | | / /_\ \ / \/| |_| | | # | | __/| _ || | | | | __|| /| . ` | | | | | | _ | | | _ | | # | | | | | | || | | | | |___| |\ \| |\ | \__/\ \_/ / | | | \__/\| | | | | # | \_| \_| |_/\_/ \_/ \____/\_| \_\_| \_/\____/\___/\_| |_/\____/\_| |_/ | # | | # +-----------------------------------------------------------------------------+
from pattern.en import sentiment, modality, parse, Sentence import json from math import floor personality_types = ['pessimist', 'optimist']                                                           
personalities = json.load(open('personalities.json')) for key in personalities: print key class Coach: responses = '' def __init__(self, personality): self.personality = personality print 'Initialized the {} coach'.format(self.personality) def loadPersonalities(self, json): self.responses = json print self.responses def getInput(self): return raw_input() def getSubjectivity(self, text): p = parse(text, tokenize=True, lemmata=True) return sentiment(Sentence(p))[1] #does sentence() make a difference? def getPolarity(self, text): p = parse(text, tokenize=True, lemmata=True) return sentiment(Sentence(p))[0] def getModality(self, text): p = parse(text, tokenize=True, lemmata=True) return modality(Sentence(p)) def calcResponseStrength(paramVal): return floor(floor(paramVal*10)/granularity) def activate(self): userInput = self.getInput() if(self.personality==personality_types[0]): pol = self.getPolarity(userInput) print pol, self.responses[self.personality][0] c = Coach('pessimist') c.loadPersonalities(personalities) while True: c.activate() break

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++













#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#PROTOTYPE NEUTRALITY COACH v2015 #!/usr/bin/python from pattern.en import sentiment, parse, Sentence, modality from os import system WARNING = '\033[93m' OKBLUE = '\033[94m' ENDC = '\033[0m' t='' wl = '' threshold = 0.4 while True: t = raw_input() if t == 'exit': break p = parse(t, tokenize=True, lemmata=True) s = sentiment(Sentence(p)) m = modality(Sentence(p)) if s[1] > threshold: print WARNING+' SUBJECTIVITY={}\nATTENTION: YOU ARE BEING TOO SUBJECTIVE. PLEASE REMOVE OPINION AND RESUBMIT'.format(s[1])+ENDC for w in t.split(' '): if sentiment(w)[1] > threshold: wl = wl+w+' ' print WARNING+' TRY REMOVING THE FOLLOWING WORDS: ' print wl print ENDC wl = '' else: print OKBLUE+' SUBJECTIVITY={}\nAdding line to document'.format(s[1])+ENDC
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++