text
stringlengths
37
1.41M
''' Reference: https://www.quora.com/Given-n-how-many-structurally-unique-BSTs-binary-search-trees-that-store-values-1-to-n-are-there ''' import math def bsts(n): if n == 0: return 1 dp = [0 for _ in range(n+1)] dp[0], dp[1] = 1, 1 for i in range(2,n+1): for j in range(1,i+1): dp[i] += dp[j-1] * dp[i-j] return dp[n] def bsts1(n): mem = [0 for _ in range(n+1)] return bsts1_helper(n, mem) def bsts1_helper(n, mem): if mem[n] != 0: return mem[n] if n == 0: return 1 for i in range(1,n+1): mem[n] += bsts1_helper(i-1, mem) * bsts1_helper(n-i, mem) return mem[n] def catalan_num(n): part1 = (math.factorial(2*n) / math.factorial(n)) /math.factorial(n) part2 = 1/float(n+1) return part1 * part2 if __name__ == "__main__": print(bsts(8)) print(catalan_num(8)) print(bsts1(8))
#import pdb def find(arr): ''' Find all triples (x, y, z) that meet the form x + y = z. ''' sort_arr = sorted(arr) result = [] #pdb.set_trace() # For each element in an array we find the corresponding x and y by two pointers. for i, ele in enumerate(sort_arr): p1 = 0 p2 = len(arr) - 1 while p1 < p2: # Filter the same index p1 = p1 + 1 if p1 == i else p1 p2 = p2 - 1 if p2 == i else p2 if p1 >= p2: break if sort_arr[p1] + sort_arr[p2] == ele: result.append((sort_arr[p1], sort_arr[p2], ele)) p1 += 1 p2 -= 1 elif sort_arr[p1] + sort_arr[p2] < ele: p1 += 1 else: p2 -= 1 return result if __name__ == "__main__": print(find([1, 4, 2, 3, 5])) print(find([4,5,2,3,7,9,8])) print(find([2,3]))
#http://introtopython.org/classes.html class Rocket(): def __init__(self): #The First thing you have to do is to define the __init__() method #The __init__ () method sets the values for any parameters that need to be defined when an object is first created. self.x = 0 self.y = 0 def moveUp(self): self.y += 1 def moveDown(self): self.y -= 1 #create a object in the class Rocket with the name myRocket #MOVE ROCKET BACK AND FORWARD # myRocket = Rocket() # print("Rocket altitude: ", myRocket.y) # # myRocket.moveUp() # print("Rocket altitude: ", myRocket.y) # # myRocket.moveDown() # print("Rocket altitude: ", myRocket.y) # # myRocket.moveUp() # print("Rocket altitude: ", myRocket.y) #ROCKET FLEET # myRockets = [] # for x in range (0, 5): # newRocket = Rocket() # myRockets.append(newRocket) # # for rocket in myRockets: # print(rocket) #ROCKET FLEET 1 LINE # myRockets = [Rocket() for x in range(0,5)] # # myRockets[0].moveUp() # # for rocket in myRockets: # print("Rocket altitude: ", rocket.y)
#Text + Variable x = "awesome" print("Python is " + x) #Variable + Variable x = "Python is " y = "awesome" z = x + y print(z) #Number + Number = Sum x = 5 y = 10 print(x + y) #output = 15 #Integer + String = Impossible / Integer + Text(keine Variable) = Impossible x = 5 y = "John" print(x + y) #ERROR
import sqlite3 def insertUser(email, password): conn = sqlite3.connect('signup.db') cur = conn.cursor() if isTaken(email, cur): return False else: cur.execute("INSERT INTO user (email,password) VALUES (?,?)",(email, password) ) cur.execute("INSERT INTO preferences (user_email) VALUES (?)",(email,) ) conn.commit() # msg = "Record successfully added" return True conn.close() # inserts preference variable into desired column of preferences table def toPref(var, column, user_id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("UPDATE preferences SET "+column+" = ? WHERE id = ?", (var, user_id,)) # cur.execute("UPDATE preferences SET age = 9 WHERE id = ?", (user_id,)) conn.commit() conn.close() def prefsInit(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("""UPDATE preferences SET sex = 0, age=1, city_id=306, city_name='San Francisco', budget=2, active=0, Asian=0, American=1, Breakfast=0, Bubble_Tea=0, Cafe=0, Fast_Food=0, Indian=0, Italian=0, Mediterranean=0, Mexican=1, Pizza=1 WHERE id = ?""", (int(id),)) conn.commit() conn.close() # // / / / / / / / / // / // / / / / / / / / / / / / / / / / / // // / // # params: user email # return: user signup ID def getID(em): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT id FROM user WHERE email = ?", (em,)) moo = cur.fetchall() return moo # params: user id # return: user email def getUser(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT email FROM user WHERE id = ?", (id,)) yoo = cur.fetchall() return yoo[0][0] # params: user id # return: (str[]) cuisine preferences def getCuis(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("""select 'Asian' from preferences where Asian = 1 AND id = """+id+""" union all select 'American' from preferences where American = 1 AND id = """+id+""" union all select 'Breakfast' from preferences where Breakfast = 1 AND id = """+id+""" union all select 'Bubble_Tea' from preferences where Bubble_Tea = 1 AND id = """+id+""" union all select 'Cafe' from preferences where Cafe = 1 AND id = """ +id+ """ union all select 'Fast_Food' from preferences where Fast_Food = 1 AND id = """+id+""" union all select 'Indian' from preferences where Indian = 1 AND id = """+id+""" union all select 'Italian' from preferences where Italian = 1 AND id = """+id+""" union all select 'Mediterranean' from preferences where Mediterranean = 1 AND id = """+id+""" union all select 'Mexican' from preferences where Mexican = 1 AND id = """+id+""" union all select 'Pizza' from preferences where Pizza = 1 AND id = """ + id) boo = cur.fetchall() return boo def getCityID(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT city_id FROM preferences WHERE id =" +id) joo = cur.fetchall() return joo def getCityName(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT city_name FROM preferences WHERE id =" +id) xoo = cur.fetchall() return xoo def getBudget(id): conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT budget FROM preferences WHERE id =" +id) too = cur.fetchall() return too # return: (BOOL) T if exists/F if not def validateLogin(em, passw): # //TODO: check if email and password match conn = sqlite3.connect('signup.db') cur = conn.cursor() cur.execute("SELECT id from user WHERE EXISTS (SELECT email, password FROM user WHERE email =? AND password =?)", (em, passw,)) foo = cur.fetchall() return foo def retrieveUsers(): conn = sqlite3.connect("signup.db") cur = conn.cursor() cur.execute("SELECT email, password FROM user") users = cur.fetchall() conn.close() return users def isTaken(em, cur): cur.execute("SELECT * FROM user WHERE email =?", (em,)) doo = cur.fetchall() return doo
import numpy as np def frange(start, end=None, inc=None): """A range function, that does accept float increments...""" import math if end == None: end = start + 0.0 start = 0.0 else: start += 0.0 # force it to be a float if inc == None: inc = 1.0 count = int(math.ceil((end - start) / inc)) L = [None,] * count L[0] = start for i in xrange(1,count): L[i] = L[i-1] + inc return L def deg_to_rad(x): return x*2*np.pi/360
#!/usr/bin/python3 # -*- coding:utf-8 -*- # @Time : 2019/5/11 9:06 # @Author : robert # @FileName : calculator.py # @Software : PyCharm import re class Calculator(object): def add(self,arg_a,arg_b): return arg_a + arg_b def sub(self,arg_a,arg_b): return arg_a - arg_b def division(self,arg_a,arg_b): return arg_a/arg_b def multi(self,arg_a,arg_b): return arg_a * arg_b def run(self): while True: args = input('请输入运算公式:') ret = re.search(r'[^0-9+-/*]',args) if ret: print('只支持数字运算') continue if '+' in args: arg_list = args.split('+') arg_a = arg_list[0].strip() arg_b = arg_list[1].strip() if arg_a and arg_b: print(self.add(int(arg_a), int(arg_b))) else: print('输入不合法!useage: a +/*- b') continue elif '-' in args: arg_list = args.split('-') arg_a = arg_list[0].strip() arg_b = arg_list[1].strip() if arg_a and arg_b: print(self.sub(int(arg_a),int(arg_b))) else: print('输入不合法!useage: a +/*- b') continue elif '*' in args: arg_list = args.split('*') arg_a = arg_list[0].strip() arg_b = arg_list[1].strip() if arg_a and arg_b: print(self.multi(int(arg_a), int(arg_b))) else: print('输入不合法!useage: a +/*- b') continue elif '/' in args: arg_list = args.split('/') arg_a = arg_list[0].strip() arg_b = arg_list[1].strip() if arg_a and arg_b: print(self.division(int(arg_a), int(arg_b))) else: print('输入不合法!useage: a +/*- b') continue else: print('useage: a +/*- b') if __name__ == '__main__': calculator = Calculator() calculator.run()
# ''' # for i in range(1,10): # for j in range(10): # for k in range(10): # sum1 = 100 * i + 10 * j + k # sum2 = i * i * i + j * j * j + k * k * k # if sum1 == sum2: # print(sum1) # ''' # ''' # print('red\tyellow\tblue') # for red in range(0, 10): # for yellow in range(0, 10): # for green in range(0, 7): # if red + yellow + green == 8: # # 注意,下边不是字符串拼接,因此不用“+”哦~ # print(red,'\t', yellow,'\t', green) # ''' # list1 = [1, [1, 2, ['小甲鱼']], 3, 5, 8, 13, 18] # list2 = list1.copy() # list3 = list1 # list1.append('x') # print(list1) # print(list2) # print(list3) # list1.clear() # print(list1) # print(list2) # print(list3) # x = (1) # y = (2,) # print(x) # print(y) # x, y, z = 1, 2, 3 # print(type(x)) # h = x, y, z # print(type(h)) # # p = [i*i for i in range(10)] # q = (i*i for i in range(10)) # # print(p) # print(q.__next__()) # print(q.__next__()) # print(q.__next__()) # print(type(q)) # temp = ('小甲鱼', '黑夜', '迷途', '小布丁') # temp1 = temp[:2] + ('怡景',) + temp[2:] # print(temp) # print(temp1) # str1 = '<a href="http://www.fishc.com/dvd" target="_blank">鱼C资源打包</a>' # print(str1[20:-36]) # str1 = 'i2sl54ovvvb4e3bferi32s56h;$c43.sfc67o0cm99' # # print(str1[::3]) # str2 = '待卿长发及腰,我必凯旋回朝。\ # 昔日纵马任逍遥,俱是少年英豪。\ # 东都霞色好,西湖烟波渺。\ # 执枪血战八方,誓守山河多娇。\ # 应有得胜归来日,与卿共度良宵。\ # 盼携手终老,愿与子同袍。' # print(str2) # str3 = ('待卿长发及腰,我必凯旋回朝。' # '昔日纵马任逍遥,俱是少年英豪。' # '东都霞色好,西湖烟波渺。' # '执枪血战八方,誓守山河多娇。' # '应有得胜归来日,与卿共度良宵。' # '盼携手终老,愿与子同袍。') # print(str3) # str = r'hello\thello' # print(str) # str = r'hello\\hello\\' # print(str) # str = r'hello\\hello' # print(str) # import re # str1 = '<a href="http://www.fishc.com/dvd" target="_blank">鱼C资源打包</a>' # re.search('([\w]+.){1}',str1) # import re # # p = re.compile(r'<a href="(?!https?://)[^"]+">(?P<txt>.*?)</a>') # # input1 = '<a href="abc">link text</a>' # input2 = '<a href="http://outofmemory.cn">link text</a>' # # print(p.sub(r'\g<txt>',input1)) # print(p.search(input1)) # print(p.search(input2)) # print(re.sub(r'<a href="(?!https?://)[^"]+">(?P<txt>.*?)</a>', '\g<txt>', '<a href="abc">link text</a>')) # !/usr/bin/python # -*- coding: utf-8 -*- """ 【整理】Python中的re.search和re.findall之间的区别和联系 + re.finall中带命名的组,不带命名的组,非捕获的组,没有分组四种类型之间的区别 http://www.crifan.com/python_re_search_vs_re_findall Version: 2012-11-16 Author: Crifan """ # !/usr/bin/python # -*- coding: utf-8 -*- """ 【整理】Python中的re.search和re.findall之间的区别和联系 + re.finall中带命名的组,不带命名的组,非捕获的组,没有分组四种类型之间的区别 http://www.crifan.com/python_re_search_vs_re_findall Version: 2012-11-16 Author: Crifan """ # !/usr/bin/python # -*- coding: utf-8 -*- """ 【整理】Python中的re.search和re.findall之间的区别和联系 + re.finall中带命名的组,不带命名的组,非捕获的组,没有分组四种类型之间的区别 http://www.crifan.com/python_re_search_vs_re_findall Version: 2012-11-16 Author: Crifan """ import re # 提示: # 在看此教程之前,请先确保已经对下列内容已了解: # 【教程】详解Python正则表达式 # http://www.crifan.com/detailed_explanation_about_python_regular_express/ # 【教程】详解Python正则表达式之: (…) group 分组 # http://www.crifan.com/detailed_explanation_about_python_regular_express_about_group/ # 【教程】详解Python正则表达式之: (?P<name>…) named group 带命名的组 # http://www.crifan.com/detailed_explanation_about_python_regular_express_named_group/ searchVsFindallStr = """ pic url test 1 http://1821.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35f9d5g213.jpg pic url test 2 http://1881.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35ee46g213.jpg pic url test 2 http://1802.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae361ac6g213.jpg """ singlePicUrlP_noGroup = "http://\w+\.\w+\.\w+.+?/\w+?.jpg" # 不带括号,即没有group的 singlePicUrlP_nonCapturingGroup = "http://(?:\w+)\.(?:\w+)\.(?:\w+).+?/(?:\w+?).jpg" # 非捕获的组 == non-capturing group singlePicUrlP_namedGroup = "http://(?P<field1>\w+)\.(?P<field2>\w+)\.(?P<field3>\w+).+?/(?P<filename>\w+?).jpg" # 带命名的group == named group singlePicUrlP_unnamedGroup = "http://(\w+)\.(\w+)\.(\w+).+?/(\w+?).jpg" # 不带命名的group == unnamed group # 1. re.search # 通过search,只能获得单个的字符串 # 因为search不像findall,会去搜索所有符合条件的 foundSinglePicUrl = re.search(singlePicUrlP_namedGroup, searchVsFindallStr) # searc只会在找到第一个符合条件的之后,就停止搜索了 print("foundSinglePicUrl=", foundSinglePicUrl) # foundSinglePicUrl= <_sre.SRE_Match object at 0x01F75230> # 然后返回对应的Match对象 print("type(foundSinglePicUrl)=", type(foundSinglePicUrl)) # type(foundSinglePicUrl)= <type '_sre.SRE_Match'> if (foundSinglePicUrl): # 对应的,如果带括号了,即带group,是可以通过group来获得对应的值的 field1 = foundSinglePicUrl.group("field1") field2 = foundSinglePicUrl.group("field2") field3 = foundSinglePicUrl.group("field3") filename = foundSinglePicUrl.group("filename") group1 = foundSinglePicUrl.group(1) group2 = foundSinglePicUrl.group(2) group3 = foundSinglePicUrl.group(3) group4 = foundSinglePicUrl.group(4) # field1=1821, filed2=img, field3=pp, filename=u121516081_136ae35f9d5g213 print("field1=%s, filed2=%s, field3=%s, filename=%s" % (field1, field2, field3, filename)) # 此处也可以看到,即使group是命名了,但是也还是对应着索引号1,2,3,4的group的值的 # 两者是等价的,只是通过名字去获得对应的组的值,相对更加具有可读性,且不会出现搞混淆组的编号的问题 # group1=1821, group2=img, group3=pp, group4=u121516081_136ae35f9d5g213 print("group1=%s, group2=%s, group3=%s, group4=%s" % (group1, group2, group3, group4)) # 2. re.findall - no group # 通过findall,想要获得整个字符串的话,就要使用不带括号的,即没有分组 foundAllPicUrl = re.findall(singlePicUrlP_noGroup, searchVsFindallStr) # findall会找到所有的匹配的字符串 print("foundAllPicUrl=", foundAllPicUrl) # foundAllPicUrl= ['http://1821.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35f9d5g213.jpg', 'http://1881.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35ee46g213.jpg', 'http://1802.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae361ac6g213.jpg'] # 然后作为一个列表返回 print("type(foundAllPicUrl)=", type(foundAllPicUrl)) # type(foundAllPicUrl)= <type 'list'> if (foundAllPicUrl): for eachPicUrl in foundAllPicUrl: print("eachPicUrl=", eachPicUrl) # eachPicUrl= http://1821.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35f9d5g213.jpg # 此处,一般常见做法就是,针对每一个匹配到的,完整的字符串 # 再去使用re.search处理,提取我们所需要的值 foundEachPicUrl = re.search(singlePicUrlP_namedGroup, eachPicUrl) print("type(foundEachPicUrl)=", type(foundEachPicUrl)) # type(foundEachPicUrl)= <type '_sre.SRE_Match'> print("foundEachPicUrl=", foundEachPicUrl) # foundEachPicUrl= <_sre.SRE_Match object at 0x025D45F8> if (foundEachPicUrl): field1 = foundEachPicUrl.group("field1") field2 = foundEachPicUrl.group("field2") field3 = foundEachPicUrl.group("field3") filename = foundEachPicUrl.group("filename") # field1=1821, filed2=img, field3=pp, filename=u121516081_136ae35f9d5g213 print("field1=%s, filed2=%s, field3=%s, filename=%s" % (field1, field2, field3, filename)) # 3. re.findall - non-capturing group # 其实,此处通过非捕获的组,去使用findall的效果,其实和上面使用的,没有分组的效果,是类似的: foundAllPicUrlNonCapturing = re.findall(singlePicUrlP_nonCapturingGroup, searchVsFindallStr) # findall同样会找到所有的匹配的整个的字符串 print("foundAllPicUrlNonCapturing=", foundAllPicUrlNonCapturing) # foundAllPicUrlNonCapturing= ['http://1821.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35f9d5g213.jpg', 'http://1881.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35ee46g213.jpg', 'http://1802.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae361ac6g213.jpg'] # 同样作为一个列表返回 print("type(foundAllPicUrlNonCapturing)=", type(foundAllPicUrlNonCapturing)) # type(foundAllPicUrlNonCapturing)= <type 'list'> if (foundAllPicUrlNonCapturing): for eachPicUrlNonCapturing in foundAllPicUrlNonCapturing: print("eachPicUrlNonCapturing=", eachPicUrlNonCapturing) # eachPicUrlNonCapturing= http://1821.img.pp.sohu.com.cn/images/blog/2012/3/7/23/28/u121516081_136ae35f9d5g213.jpg # 此处,可以根据需要,和上面没有分组的例子中类似,再去分别处理每一个字符串,提取你所需要的值 # 4. re.findall - named group # 接着再来演示一下,如果findall中,使用了带命名的group(named group)的结果: foundAllPicGroups = re.findall(singlePicUrlP_namedGroup, searchVsFindallStr) # 则也是可以去查找所有的匹配到的字符串的 # 然后返回的是列表的值 print("type(foundAllPicGroups)=", type(foundAllPicGroups)) # type(foundAllPicGroups)= <type 'list'> # 只不过,列表中每个值,都是对应的,各个group的值了 print("foundAllPicGroups=", foundAllPicGroups) # foundAllPicGroups= [('1821', 'img', 'pp', 'u121516081_136ae35f9d5g213'), ('1881', 'img', 'pp', 'u121516081_136ae35ee46g213'), ('1802', 'img', 'pp', 'u121516081_136ae361ac6g213')] if (foundAllPicGroups): for eachPicGroups in foundAllPicGroups: # 此处,不过由于又是给group命名了,所以,就对应着 # (?P<field1>\w+) (?P<field2>\w+) (?P<field3>\w+) (?P<filename>\w+?) 这几个部分的值了 print("eachPicGroups=", eachPicGroups) # eachPicGroups= ('1821', 'img', 'pp', 'u121516081_136ae35f9d5g213') # 由于此处有多个group,此处类型是tuple,其中由上述四个group所组成 print("type(eachPicGroups)=", type(eachPicGroups)) # type(eachPicGroups)= <type 'tuple'> # 此处,可以根据需要,和上面没有分组的例子中类似,再去分别处理每一个字符串,提取你所需要的值 # 5. re.findall - unnamed group # 此处再来演示一下,findall中,如果使用带group,但是是没有命名的group(unnamed group)的效果: foundAllPicGroupsUnnamed = re.findall(singlePicUrlP_unnamedGroup, searchVsFindallStr) # 此处,肯定也是返回对应的列表类型 print("type(foundAllPicGroupsUnnamed)=", type(foundAllPicGroupsUnnamed)) # type(foundAllPicGroupsUnnamed)= <type 'list'> # 而列表中每个值,其实也是对应各个组的值的组合 print("foundAllPicGroupsUnnamed=", foundAllPicGroupsUnnamed) # foundAllPicGroupsUnnamed= [('1821', 'img', 'pp', 'u121516081_136ae35f9d5g213'), ('1881', 'img', 'pp', 'u121516081_136ae35ee46g213'), ('1802', 'img', 'pp', 'u121516081_136ae361ac6g213')] if (foundAllPicGroupsUnnamed): for eachPicGroupsUnnamed in foundAllPicGroupsUnnamed: # 可以看到,同样的,每个都是一个tuple变量 print("type(eachPicGroupsUnnamed)=", type(eachPicGroupsUnnamed)) # type(eachPicGroupsUnnamed)= <type 'tuple'> # 每个tuple中的值,仍是各个未命名的组的值的组合 print("eachPicGroupsUnnamed=",eachPicGroupsUnnamed) # eachPicGroupsUnnamed= ('1821', 'img', 'pp', 'u121516081_136ae35f9d5g213') # 此处,可以根据需要,和上面没有分组的例子中类似,再去分别处理每一个字符串,提取你所需要的值
# coding=utf-8 class Node(object): """节点类""" def __init__(self, val=-1, left=None, right=None): self.val = val self.left = left self.right = right class Tree(object): """树类""" def __init__(self): self.root = Node() def add(self, val): """为树添加节点""" node = Node(val) if self.root.val == -1: # 如果树是空的,则对根节点赋值 self.root = node else: myQueue = [] treeNode = self.root myQueue.append(treeNode) while myQueue: # 对已有的节点进行层次遍历 treeNode = myQueue.pop(0) if treeNode.left == None: treeNode.left = node return elif treeNode.right == None: treeNode.right = node return else: myQueue.append(treeNode.left) myQueue.append(treeNode.right) def levelOrder(self, root): ans, level = [], [root] while root and level: ans.append([node.val for node in level]) level = [kid for n in level for kid in (n.left, n.right) if kid] return ans if __name__ == '__main__': """主函数""" elem = range(10) # 生成十个数据作为树节点 tree = Tree() # 新建一个树对象 for val in elem: tree.add(val) # 逐个添加树的节点 print('层级遍历:') level = tree.levelOrder(tree.root) print(level)
import urllib import urllib2 import BeautifulSoup import re name=str(raw_input('enter your codeforces Id !!')) mainURL="http://www.codeforces.com/contests/with/" + name print mainURL response = urllib2.urlopen(mainURL) soup = BeautifulSoup.BeautifulSoup(str(response.read())) tab = 1 for grab in soup.findAll('a', href=re.compile('^/contest/')): tab=tab+1 if tab%2==0: print ("contest name : " + grab.text), else: print ("contest rank was -> ! " + grab.text)
''' this program will create in the current directory a simple XML file and then immediately read it, giving us some information. ''' #creating xml file to system from python import xml.etree.ElementTree as et menu_str = ''' <?xml version="1.0"?> <menu> <breakfast hours="7-11"> <item price="$6.00">burritos</item> <item price="$4.00">pancakes</item> </breakfast> <lunch hours="11-3"> <item price="$5.00">hamburger</item> </lunch> <dinner hours="3-10"> <item price="8.00">spaghetti</item> </dinner> </menu> '''[1:] menu_xml = et.XML(menu_str) tree = et.ElementTree(menu_xml) tree.write('menu.xml') #reading xml file in python #we can read xml by et.ElementTree(file=...) and et.parse(...) methods tree2 = et.ElementTree(file='menu.xml') root = tree2.getroot() print('') print('root tag:', root.tag) print('') for child in root: print('for {} ({}) we have:'.format(child.tag, child.attrib['hours'])) for grandchild in child: print(' {}\t{}'.format(grandchild.text, grandchild.attrib['price'])) print('') #another way of reading( et.parse ) #I won't iterate through menu children but print only root tag from xml.etree.ElementTree import parse tree3 = et.parse('menu.xml') root2 = tree3.getroot() print('root tag is also', root2.tag + ' (created through parse method")')
# week 1 homework # Stanley Lim # Data Mining # Everything should work correctly tuple1 = (1, 2, 3, 4, 5) list1 = [6,7,8,9,10] print ("tuple1: ", tuple1) print ("list1: ", list1) print("adding tuple[0] to list1[4]") list1[4] = list1[4] + tuple1[0] print ("new list1: ", list1) # convert tuple to list in order to add to list1 tuple1 = list(tuple1) print("adding tuple1 to list1") list1 = list1 + tuple1 print ("new list1: ", list1)
#class 1 class Person: #init constructor used def __init__(self,name,email): self.name = name self.email = email def display(self): print("Name: ", self.name) print("Email: ", self.email) #class 2(inherited) class Student(Person): StudentCount = 0 def __init__(self,name,email,student_id): Person.__init__(self,name,email) self.student_id = student_id Student.StudentCount +=1 def displayCount(self): print("Total Students:", Student.StudentCount) def display(self): print("Student Details:") Person.display(self) print("Student Id: ",self.student_id) #class 3 (inherited) class Librarian(Person): StudentCount = 0 def __init__(self,name,email,employee_id): #super call super().__init__(name,email) self.employee_id = employee_id def display(self): print("Librarian Details:") Person.display(self) print("Employee Id is: ",self.employee_id) #class 4 class Book(): def __init__(self, bookname, author, book_id): self.book_name = bookname self.author = author self.book_id = book_id def display(self): print("Details about the book") print("Book_Name: ", self.book_name) print("Author: ", self.author) print("Book_ID: ", self.book_id) #class 5 class Borrow_Book(Student,Book): def __init__(self, name, email, student_id, bookname, author, book_id): Student.__init__(self,name,email,student_id) Book.__init__(self, bookname, author, book_id) def display(self): print("Details of the borrowed book:") Student.display(self) Book.display(self) Libdetails= [] Libdetails.append(Student('Namrata', '[email protected]', 1234)) Libdetails.append(Student('Pujita', '[email protected]', 4567)) Libdetails.append(Librarian('Librarian1', '[email protected]', 7777)) Libdetails.append(Librarian('Librarian2', '[email protected]', 4353)) Libdetails.append(Book('Python', 'Author1', 12311)) Libdetails.append(Book('Software Engg', 'Author2', 12312)) Libdetails.append(Borrow_Book('Namrata', '[email protected]', 1234, 'Python', 'Author1', 12311)) for obj, item in enumerate(Libdetails): item.display() print("\n") if obj == len(Libdetails)-1: item.displayCount()
import numpy as np """ 使用take函数获取索引的值 通过索引访问矩阵的值,类似数组访问,不过区别是: 如果只提供行的索引,会返回整行 如果想要获得列可以先转置,然后提供行的索引 """ a = np.arange(0, 20).reshape((4, 5)) # 只提供行 print(a) print(a[3]) print(a[1, 4]) print(a.T[1]) # 通过索引访问矩阵的值 # x为行数,索引/列数 # y为列数,索引%列数 # 或者使用take(矩阵,索引)函数访问 print(a) x = int(np.argmax(a) / 5) y = np.argmax(a) % 5 print(x, y, a[x, y]) print(np.argmin(a), np.take(a, np.argmin(a)))
#!/usr/bin/env python """ @author: metalcorebear """ # Determine word affect based on the NRC emotional lexicon # Library is built on TextBlob from textblob import TextBlob from collections import Counter from nltk.stem.snowball import SnowballStemmer stemmer = SnowballStemmer("english") def build_word_affect(self): # Build word affect function affect_list = [] affect_dict = dict() affect_frequencies = Counter() lexicon_keys = self.lexicon.keys() for word in self.words: if word in lexicon_keys: affect_list.extend(self.lexicon[word]) affect_dict.update({word: self.lexicon[word]}) for word in affect_list: affect_frequencies[word] += 1 sum_values = sum(affect_frequencies.values()) affect_percent = {'fear': 0.0, 'anger': 0.0, 'anticipation': 0.0, 'trust': 0.0, 'surprise': 0.0, 'positive': 0.0, 'negative': 0.0, 'sadness': 0.0, 'disgust': 0.0, 'joy': 0.0} for key in affect_frequencies.keys(): affect_percent.update({key: float(affect_frequencies[key]) / float(sum_values)}) self.affect_list = affect_list self.affect_dict = affect_dict self.raw_emotion_scores = dict(affect_frequencies) self.affect_frequencies = affect_percent def top_emotions(self): emo_dict = self.affect_frequencies max_value = max(emo_dict.values()) top_emotions = [] for key in emo_dict.keys(): if emo_dict[key] == max_value: top_emotions.append((key, max_value)) self.top_emotions = top_emotions class NRCLex: """Lexicon source is (C) 2016 National Research Council Canada (NRC) and library is for research purposes only. Source: http://sentiment.nrc.ca/lexicons-for-research/""" lexicon = {'abacus': ['trust'], 'abandon': ['fear', 'negative', 'sadness'], 'abandoned': ['anger', 'fear', 'negative', 'sadness'], 'abandonment': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'abba': ['positive'], 'abbot': ['trust'], 'abduction': ['fear', 'negative', 'sadness', 'surprise'], 'aberrant': ['negative'], 'aberration': ['disgust', 'negative'], 'abhor': ['anger', 'disgust', 'fear', 'negative'], 'abhorrent': ['anger', 'disgust', 'fear', 'negative'], 'ability': ['positive'], 'abject': ['disgust', 'negative'], 'abnormal': ['disgust', 'negative'], 'abolish': ['anger', 'negative'], 'abolition': ['negative'], 'abominable': ['disgust', 'fear', 'negative'], 'abomination': ['anger', 'disgust', 'fear', 'negative'], 'abort': ['negative'], 'abortion': ['disgust', 'fear', 'negative', 'sadness'], 'abortive': ['negative', 'sadness'], 'abovementioned': ['positive'], 'abrasion': ['negative'], 'abrogate': ['negative'], 'abrupt': ['surprise'], 'abscess': ['negative', 'sadness'], 'absence': ['fear', 'negative', 'sadness'], 'absent': ['negative', 'sadness'], 'absentee': ['negative', 'sadness'], 'absenteeism': ['negative'], 'absolute': ['positive'], 'absolution': ['joy', 'positive', 'trust'], 'absorbed': ['positive'], 'absurd': ['negative'], 'absurdity': ['negative'], 'abundance': ['anticipation', 'disgust', 'joy', 'negative', 'positive', 'trust'], 'abundant': ['joy', 'positive'], 'abuse': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'abysmal': ['negative', 'sadness'], 'abyss': ['fear', 'negative', 'sadness'], 'academic': ['positive', 'trust'], 'academy': ['positive'], 'accelerate': ['anticipation'], 'acceptable': ['positive'], 'acceptance': ['positive'], 'accessible': ['positive'], 'accident': ['fear', 'negative', 'sadness', 'surprise'], 'accidental': ['fear', 'negative', 'surprise'], 'accidentally': ['surprise'], 'accolade': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'accommodation': ['positive'], 'accompaniment': ['anticipation', 'joy', 'positive', 'trust'], 'accomplish': ['joy', 'positive'], 'accomplished': ['joy', 'positive'], 'accomplishment': ['positive'], 'accord': ['positive', 'trust'], 'account': ['trust'], 'accountability': ['positive', 'trust'], 'accountable': ['positive', 'trust'], 'accountant': ['trust'], 'accounts': ['trust'], 'accredited': ['positive', 'trust'], 'accueil': ['positive'], 'accurate': ['positive', 'trust'], 'accursed': ['anger', 'fear', 'negative', 'sadness'], 'accusation': ['anger', 'disgust', 'negative'], 'accusative': ['negative'], 'accused': ['anger', 'fear', 'negative'], 'accuser': ['anger', 'fear', 'negative'], 'accusing': ['anger', 'fear', 'negative'], 'ace': ['positive'], 'ache': ['negative', 'sadness'], 'achieve': ['joy', 'positive', 'trust'], 'achievement': ['anticipation', 'joy', 'positive', 'trust'], 'aching': ['negative', 'sadness'], 'acid': ['negative'], 'acknowledgment': ['positive'], 'acquire': ['positive'], 'acquiring': ['anticipation', 'positive'], 'acrobat': ['fear', 'joy', 'positive', 'trust'], 'action': ['positive'], 'actionable': ['anger', 'disgust', 'negative'], 'actual': ['positive'], 'acuity': ['positive'], 'acumen': ['positive'], 'adapt': ['positive'], 'adaptable': ['positive'], 'adder': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'addiction': ['negative'], 'addresses': ['anticipation', 'positive'], 'adept': ['positive'], 'adequacy': ['positive'], 'adhering': ['trust'], 'adipose': ['negative'], 'adjudicate': ['fear', 'negative'], 'adjunct': ['positive'], 'administrative': ['trust'], 'admirable': ['joy', 'positive', 'trust'], 'admiral': ['positive', 'trust'], 'admiration': ['joy', 'positive', 'trust'], 'admire': ['positive', 'trust'], 'admirer': ['positive'], 'admissible': ['positive', 'trust'], 'admonition': ['fear', 'negative'], 'adorable': ['joy', 'positive'], 'adoration': ['joy', 'positive', 'trust'], 'adore': ['anticipation', 'joy', 'positive', 'trust'], 'adrift': ['anticipation', 'fear', 'negative', 'sadness'], 'adulterated': ['negative'], 'adultery': ['disgust', 'negative', 'sadness'], 'advance': ['anticipation', 'fear', 'joy', 'positive', 'surprise'], 'advanced': ['positive'], 'advancement': ['positive'], 'advantage': ['positive'], 'advantageous': ['positive'], 'advent': ['anticipation', 'joy', 'positive', 'trust'], 'adventure': ['anticipation', 'positive'], 'adventurous': ['positive'], 'adversary': ['anger', 'negative'], 'adverse': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'adversity': ['anger', 'fear', 'negative', 'sadness'], 'advice': ['trust'], 'advisable': ['positive', 'trust'], 'advise': ['positive', 'trust'], 'advised': ['trust'], 'adviser': ['positive', 'trust'], 'advocacy': ['anger', 'anticipation', 'joy', 'positive', 'trust'], 'advocate': ['trust'], 'aesthetic': ['positive'], 'aesthetics': ['joy', 'positive'], 'affable': ['positive'], 'affection': ['joy', 'positive', 'trust'], 'affiliated': ['positive'], 'affirm': ['positive', 'trust'], 'affirmation': ['positive'], 'affirmative': ['positive'], 'affirmatively': ['positive', 'trust'], 'afflict': ['fear', 'negative', 'sadness'], 'afflicted': ['negative'], 'affliction': ['disgust', 'fear', 'negative', 'sadness'], 'affluence': ['joy', 'positive'], 'affluent': ['positive'], 'afford': ['positive'], 'affront': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'afraid': ['fear', 'negative'], 'aftermath': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'aftertaste': ['negative'], 'aga': ['fear', 'positive', 'trust'], 'aggravated': ['anger', 'negative'], 'aggravating': ['anger', 'negative', 'sadness'], 'aggravation': ['anger', 'disgust', 'negative'], 'aggression': ['anger', 'fear', 'negative'], 'aggressive': ['anger', 'fear', 'negative'], 'aggressor': ['anger', 'fear', 'negative'], 'aghast': ['disgust', 'fear', 'negative', 'surprise'], 'agile': ['positive'], 'agility': ['positive'], 'agitated': ['anger', 'negative'], 'agitation': ['anger', 'negative'], 'agonizing': ['fear', 'negative'], 'agony': ['anger', 'fear', 'negative', 'sadness'], 'agree': ['positive'], 'agreeable': ['positive', 'trust'], 'agreed': ['positive', 'trust'], 'agreeing': ['positive', 'trust'], 'agreement': ['positive', 'trust'], 'agriculture': ['positive'], 'aground': ['negative'], 'ahead': ['positive'], 'aid': ['positive'], 'aiding': ['positive'], 'ail': ['negative', 'sadness'], 'ailing': ['fear', 'negative', 'sadness'], 'aimless': ['negative'], 'airport': ['anticipation'], 'airs': ['disgust', 'negative'], 'akin': ['trust'], 'alabaster': ['positive'], 'alarm': ['fear', 'negative', 'surprise'], 'alarming': ['fear', 'negative', 'surprise'], 'alb': ['trust'], 'alcoholism': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'alertness': ['anticipation', 'fear', 'positive', 'surprise'], 'alerts': ['anticipation', 'fear', 'surprise'], 'alien': ['disgust', 'fear', 'negative'], 'alienate': ['anger', 'disgust', 'negative'], 'alienated': ['negative', 'sadness'], 'alienation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'alimentation': ['positive'], 'alimony': ['negative'], 'alive': ['anticipation', 'joy', 'positive', 'trust'], 'allay': ['positive'], 'allegation': ['anger', 'negative'], 'allege': ['negative'], 'allegiance': ['positive', 'trust'], 'allegro': ['positive'], 'alleviate': ['positive'], 'alleviation': ['positive'], 'alliance': ['trust'], 'allied': ['positive', 'trust'], 'allowable': ['positive'], 'allure': ['anticipation', 'joy', 'positive', 'surprise'], 'alluring': ['positive'], 'ally': ['positive', 'trust'], 'almighty': ['positive'], 'aloha': ['anticipation', 'joy', 'positive'], 'aloof': ['negative'], 'altercation': ['anger', 'negative'], 'amaze': ['surprise'], 'amazingly': ['joy', 'positive', 'surprise'], 'ambassador': ['positive', 'trust'], 'ambiguous': ['negative'], 'ambition': ['anticipation', 'joy', 'positive', 'trust'], 'ambulance': ['fear', 'trust'], 'ambush': ['anger', 'fear', 'negative', 'surprise'], 'ameliorate': ['positive'], 'amen': ['joy', 'positive', 'trust'], 'amenable': ['positive'], 'amend': ['positive'], 'amends': ['positive'], 'amenity': ['positive'], 'amiable': ['positive'], 'amicable': ['joy', 'positive'], 'ammonia': ['disgust'], 'amnesia': ['negative'], 'amnesty': ['joy', 'positive'], 'amortization': ['trust'], 'amour': ['anticipation', 'joy', 'positive', 'trust'], 'amphetamines': ['disgust', 'negative'], 'amuse': ['joy', 'positive'], 'amused': ['joy', 'positive'], 'amusement': ['joy', 'positive'], 'amusing': ['joy', 'positive'], 'anaconda': ['disgust', 'fear', 'negative'], 'anal': ['negative'], 'analyst': ['anticipation', 'positive', 'trust'], 'anarchism': ['anger', 'fear', 'negative'], 'anarchist': ['anger', 'fear', 'negative'], 'anarchy': ['anger', 'fear', 'negative'], 'anathema': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'ancestral': ['trust'], 'anchor': ['positive'], 'anchorage': ['positive', 'sadness'], 'ancient': ['negative'], 'angel': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'angelic': ['joy', 'positive', 'trust'], 'anger': ['anger', 'negative'], 'angina': ['fear', 'negative'], 'angling': ['anticipation', 'negative'], 'angry': ['anger', 'disgust', 'negative'], 'anguish': ['anger', 'fear', 'negative', 'sadness'], 'animate': ['positive'], 'animated': ['joy', 'positive'], 'animosity': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'animus': ['anger', 'negative'], 'annihilate': ['anger', 'fear', 'negative'], 'annihilated': ['anger', 'fear', 'negative', 'sadness'], 'annihilation': ['anger', 'fear', 'negative', 'sadness'], 'announcement': ['anticipation'], 'annoy': ['anger', 'disgust', 'negative'], 'annoyance': ['anger', 'disgust', 'negative'], 'annoying': ['anger', 'negative'], 'annul': ['negative'], 'annulment': ['negative', 'sadness'], 'anomaly': ['fear', 'negative', 'surprise'], 'anonymous': ['negative'], 'answerable': ['trust'], 'antagonism': ['anger', 'negative'], 'antagonist': ['anger', 'negative'], 'antagonistic': ['anger', 'disgust', 'negative'], 'anthrax': ['disgust', 'fear', 'negative', 'sadness'], 'antibiotics': ['positive'], 'antichrist': ['anger', 'disgust', 'fear', 'negative'], 'anticipation': ['anticipation'], 'anticipatory': ['anticipation'], 'antidote': ['anticipation', 'positive', 'trust'], 'antifungal': ['positive', 'trust'], 'antipathy': ['anger', 'disgust', 'negative'], 'antiquated': ['negative'], 'antique': ['positive'], 'antiseptic': ['positive', 'trust'], 'antisocial': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'antithesis': ['anger', 'negative'], 'anxiety': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'anxious': ['anticipation', 'fear', 'negative'], 'apache': ['fear', 'negative'], 'apathetic': ['negative', 'sadness'], 'apathy': ['negative', 'sadness'], 'aphid': ['disgust', 'negative'], 'aplomb': ['positive'], 'apologetic': ['positive', 'trust'], 'apologize': ['positive', 'sadness', 'trust'], 'apology': ['positive'], 'apostle': ['positive', 'trust'], 'apostolic': ['trust'], 'appalling': ['disgust', 'fear', 'negative'], 'apparition': ['fear', 'surprise'], 'appeal': ['anticipation'], 'appendicitis': ['fear', 'negative', 'sadness'], 'applause': ['joy', 'positive', 'surprise', 'trust'], 'applicant': ['anticipation'], 'appreciation': ['joy', 'positive', 'trust'], 'apprehend': ['fear'], 'apprehension': ['fear', 'negative'], 'apprehensive': ['anticipation', 'fear', 'negative'], 'apprentice': ['trust'], 'approaching': ['anticipation'], 'approbation': ['positive', 'trust'], 'appropriation': ['negative'], 'approval': ['positive'], 'approve': ['joy', 'positive', 'trust'], 'approving': ['positive'], 'apt': ['positive'], 'aptitude': ['positive'], 'arbiter': ['trust'], 'arbitration': ['anticipation'], 'arbitrator': ['trust'], 'archaeology': ['anticipation', 'positive'], 'archaic': ['negative'], 'architecture': ['trust'], 'ardent': ['anticipation', 'joy', 'positive'], 'ardor': ['positive'], 'arduous': ['negative'], 'argue': ['anger', 'negative'], 'argument': ['anger', 'negative'], 'argumentation': ['anger'], 'argumentative': ['negative'], 'arguments': ['anger'], 'arid': ['negative', 'sadness'], 'aristocracy': ['positive'], 'aristocratic': ['positive'], 'armament': ['anger', 'fear'], 'armaments': ['fear', 'negative'], 'armed': ['anger', 'fear', 'negative', 'positive'], 'armor': ['fear', 'positive', 'trust'], 'armored': ['fear'], 'armory': ['trust'], 'aroma': ['positive'], 'arouse': ['anticipation', 'positive'], 'arraignment': ['anger', 'fear', 'negative', 'sadness'], 'array': ['positive'], 'arrears': ['negative'], 'arrest': ['negative'], 'arrival': ['anticipation'], 'arrive': ['anticipation'], 'arrogance': ['negative'], 'arrogant': ['anger', 'disgust', 'negative'], 'arsenic': ['disgust', 'fear', 'negative', 'sadness'], 'arson': ['anger', 'fear', 'negative'], 'art': ['anticipation', 'joy', 'positive', 'sadness', 'surprise'], 'articulate': ['positive'], 'articulation': ['positive'], 'artillery': ['fear', 'negative'], 'artisan': ['positive'], 'artiste': ['positive'], 'artistic': ['positive'], 'ascendancy': ['positive'], 'ascent': ['positive'], 'ash': ['negative'], 'ashamed': ['disgust', 'negative', 'sadness'], 'ashes': ['negative', 'sadness'], 'asp': ['fear'], 'aspiration': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'aspire': ['anticipation', 'joy', 'positive'], 'aspiring': ['anticipation', 'joy', 'positive', 'trust'], 'ass': ['negative'], 'assail': ['anger', 'fear', 'negative', 'surprise'], 'assailant': ['anger', 'fear', 'negative', 'sadness'], 'assassin': ['anger', 'fear', 'negative', 'sadness'], 'assassinate': ['anger', 'fear', 'negative'], 'assassination': ['anger', 'fear', 'negative', 'sadness'], 'assault': ['anger', 'fear', 'negative'], 'assembly': ['positive', 'trust'], 'assent': ['positive'], 'asserting': ['positive', 'trust'], 'assessment': ['surprise', 'trust'], 'assessor': ['trust'], 'assets': ['positive'], 'asshole': ['anger', 'disgust', 'negative'], 'assignee': ['trust'], 'assist': ['positive', 'trust'], 'assistance': ['positive'], 'associate': ['positive', 'trust'], 'association': ['trust'], 'assuage': ['positive'], 'assurance': ['positive', 'trust'], 'assure': ['trust'], 'assured': ['positive', 'trust'], 'assuredly': ['trust'], 'astonishingly': ['positive', 'surprise'], 'astonishment': ['joy', 'positive', 'surprise'], 'astray': ['fear', 'negative'], 'astringent': ['negative'], 'astrologer': ['anticipation', 'positive'], 'astronaut': ['positive'], 'astronomer': ['anticipation', 'positive'], 'astute': ['positive'], 'asylum': ['fear', 'negative'], 'asymmetry': ['disgust'], 'atheism': ['negative'], 'atherosclerosis': ['fear', 'negative', 'sadness'], 'athlete': ['positive'], 'athletic': ['positive'], 'atom': ['positive'], 'atone': ['anticipation', 'joy', 'positive', 'trust'], 'atonement': ['positive'], 'atrocious': ['anger', 'disgust', 'negative'], 'atrocity': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'atrophy': ['disgust', 'fear', 'negative', 'sadness'], 'attachment': ['positive'], 'attack': ['anger', 'fear', 'negative'], 'attacking': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'attainable': ['anticipation', 'positive'], 'attainment': ['positive'], 'attempt': ['anticipation'], 'attendance': ['anticipation'], 'attendant': ['positive', 'trust'], 'attention': ['positive'], 'attentive': ['positive', 'trust'], 'attenuated': ['negative'], 'attenuation': ['negative', 'sadness'], 'attest': ['positive', 'trust'], 'attestation': ['trust'], 'attorney': ['anger', 'fear', 'positive', 'trust'], 'attraction': ['positive'], 'attractiveness': ['positive'], 'auction': ['anticipation'], 'audacity': ['negative'], 'audience': ['anticipation'], 'auditor': ['fear', 'trust'], 'augment': ['positive'], 'august': ['positive'], 'aunt': ['positive', 'trust'], 'aura': ['positive'], 'auspicious': ['anticipation', 'joy', 'positive'], 'austere': ['fear', 'negative', 'sadness'], 'austerity': ['negative'], 'authentic': ['joy', 'positive', 'trust'], 'authenticate': ['trust'], 'authentication': ['trust'], 'authenticity': ['positive', 'trust'], 'author': ['positive', 'trust'], 'authoritative': ['positive', 'trust'], 'authority': ['positive', 'trust'], 'authorization': ['positive', 'trust'], 'authorize': ['trust'], 'authorized': ['positive'], 'autocratic': ['negative'], 'automatic': ['trust'], 'autopsy': ['disgust', 'fear', 'negative', 'sadness'], 'avalanche': ['fear', 'negative', 'sadness', 'surprise'], 'avarice': ['anger', 'disgust', 'negative'], 'avatar': ['positive'], 'avenger': ['anger', 'negative'], 'averse': ['anger', 'disgust', 'fear', 'negative'], 'aversion': ['anger', 'disgust', 'fear', 'negative'], 'avoid': ['fear', 'negative'], 'avoidance': ['fear', 'negative'], 'avoiding': ['fear'], 'await': ['anticipation'], 'award': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'awful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'awkwardness': ['disgust', 'negative'], 'awry': ['negative'], 'axiom': ['trust'], 'axiomatic': ['trust'], 'ay': ['positive'], 'aye': ['positive'], 'babble': ['negative'], 'babbling': ['negative'], 'baboon': ['disgust', 'negative'], 'baby': ['joy', 'positive'], 'babysitter': ['trust'], 'baccalaureate': ['positive'], 'backbone': ['anger', 'positive', 'trust'], 'backer': ['trust'], 'backward': ['negative'], 'backwards': ['disgust', 'negative'], 'backwater': ['negative', 'sadness'], 'bacteria': ['disgust', 'fear', 'negative', 'sadness'], 'bacterium': ['disgust', 'fear', 'negative'], 'bad': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'badge': ['trust'], 'badger': ['anger', 'negative'], 'badly': ['negative', 'sadness'], 'badness': ['anger', 'disgust', 'fear', 'negative'], 'bailiff': ['fear', 'negative', 'trust'], 'bait': ['fear', 'negative', 'trust'], 'balance': ['positive'], 'balanced': ['positive'], 'bale': ['fear', 'negative'], 'balk': ['negative'], 'ballad': ['positive'], 'ballet': ['positive'], 'ballot': ['anticipation', 'positive', 'trust'], 'balm': ['anticipation', 'joy', 'negative', 'positive'], 'balsam': ['positive'], 'ban': ['negative'], 'bandit': ['negative'], 'bane': ['anger', 'disgust', 'fear', 'negative'], 'bang': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'banger': ['anger', 'anticipation', 'fear', 'negative', 'surprise'], 'banish': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'banished': ['anger', 'fear', 'negative', 'sadness'], 'banishment': ['anger', 'disgust', 'negative', 'sadness'], 'bank': ['trust'], 'banker': ['trust'], 'bankrupt': ['fear', 'negative', 'sadness'], 'bankruptcy': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'banquet': ['anticipation', 'joy', 'positive'], 'banshee': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'baptism': ['positive'], 'baptismal': ['joy', 'positive'], 'barb': ['anger', 'negative'], 'barbarian': ['fear', 'negative'], 'barbaric': ['anger', 'disgust', 'fear', 'negative'], 'barbarism': ['negative'], 'bard': ['positive'], 'barf': ['disgust'], 'bargain': ['positive', 'trust'], 'bark': ['anger', 'negative'], 'barred': ['negative'], 'barren': ['negative', 'sadness'], 'barricade': ['fear', 'negative'], 'barrier': ['anger', 'negative'], 'barrow': ['disgust'], 'bartender': ['trust'], 'barter': ['trust'], 'base': ['trust'], 'baseless': ['negative'], 'basketball': ['anticipation', 'joy', 'positive'], 'bastard': ['disgust', 'negative', 'sadness'], 'bastion': ['anger', 'positive'], 'bath': ['positive'], 'battalion': ['anger'], 'batter': ['anger', 'fear', 'negative'], 'battered': ['fear', 'negative', 'sadness'], 'battery': ['anger', 'negative'], 'battle': ['anger', 'negative'], 'battled': ['anger', 'fear', 'negative', 'sadness'], 'battlefield': ['fear', 'negative'], 'bawdy': ['negative'], 'bayonet': ['anger', 'fear', 'negative'], 'beach': ['joy'], 'beam': ['joy', 'positive'], 'beaming': ['anticipation', 'joy', 'positive'], 'bear': ['anger', 'fear'], 'bearer': ['negative'], 'bearish': ['anger', 'fear'], 'beast': ['anger', 'fear', 'negative'], 'beastly': ['disgust', 'fear', 'negative'], 'beating': ['anger', 'fear', 'negative', 'sadness'], 'beautification': ['joy', 'positive', 'trust'], 'beautiful': ['joy', 'positive'], 'beautify': ['joy', 'positive'], 'beauty': ['joy', 'positive'], 'bedrock': ['positive', 'trust'], 'bee': ['anger', 'fear'], 'beer': ['joy', 'positive'], 'befall': ['negative'], 'befitting': ['positive'], 'befriend': ['joy', 'positive', 'trust'], 'beg': ['negative', 'sadness'], 'beggar': ['negative', 'sadness'], 'begging': ['negative'], 'begun': ['anticipation'], 'behemoth': ['fear', 'negative'], 'beholden': ['negative'], 'belated': ['negative'], 'believed': ['trust'], 'believer': ['trust'], 'believing': ['positive', 'trust'], 'belittle': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'belligerent': ['anger', 'fear', 'negative'], 'bellows': ['anger'], 'belt': ['anger', 'fear', 'negative'], 'bender': ['negative'], 'benefactor': ['positive', 'trust'], 'beneficial': ['positive'], 'benefit': ['positive'], 'benevolence': ['joy', 'positive', 'trust'], 'benign': ['joy', 'positive'], 'bequest': ['trust'], 'bereaved': ['negative', 'sadness'], 'bereavement': ['negative', 'sadness'], 'bereft': ['negative'], 'berserk': ['anger', 'negative'], 'berth': ['positive'], 'bestial': ['disgust', 'fear', 'negative'], 'betray': ['anger', 'disgust', 'negative', 'sadness', 'surprise'], 'betrayal': ['anger', 'disgust', 'negative', 'sadness'], 'betrothed': ['anticipation', 'joy', 'positive', 'trust'], 'betterment': ['positive'], 'beverage': ['positive'], 'beware': ['anticipation', 'fear', 'negative'], 'bewildered': ['fear', 'negative', 'surprise'], 'bewilderment': ['fear', 'surprise'], 'bias': ['anger', 'negative'], 'biased': ['negative'], 'biblical': ['positive'], 'bickering': ['anger', 'disgust', 'negative'], 'biennial': ['anticipation'], 'bier': ['fear', 'negative', 'sadness'], 'bigot': ['anger', 'disgust', 'fear', 'negative'], 'bigoted': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'bile': ['anger', 'disgust', 'negative'], 'bilingual': ['positive'], 'biopsy': ['fear', 'negative'], 'birch': ['anger', 'disgust', 'fear', 'negative'], 'birth': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'birthday': ['anticipation', 'joy', 'positive', 'surprise'], 'birthplace': ['anger', 'negative'], 'bitch': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'bite': ['negative'], 'bitterly': ['anger', 'disgust', 'negative', 'sadness'], 'bitterness': ['anger', 'disgust', 'negative', 'sadness'], 'bizarre': ['negative', 'surprise'], 'black': ['negative', 'sadness'], 'blackjack': ['negative'], 'blackmail': ['anger', 'fear', 'negative'], 'blackness': ['fear', 'negative', 'sadness'], 'blame': ['anger', 'disgust', 'negative'], 'blameless': ['positive'], 'bland': ['negative'], 'blanket': ['trust'], 'blasphemous': ['anger', 'disgust', 'negative'], 'blasphemy': ['anger', 'negative'], 'blast': ['anger', 'fear', 'negative', 'surprise'], 'blatant': ['anger', 'disgust', 'negative'], 'blather': ['negative'], 'blaze': ['anger', 'negative'], 'bleak': ['negative', 'sadness'], 'bleeding': ['disgust', 'fear', 'negative', 'sadness'], 'blemish': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'bless': ['anticipation', 'joy', 'positive', 'trust'], 'blessed': ['joy', 'positive'], 'blessing': ['anticipation', 'joy', 'positive', 'trust'], 'blessings': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'blight': ['disgust', 'fear', 'negative', 'sadness'], 'blighted': ['disgust', 'negative', 'sadness'], 'blind': ['negative'], 'blinded': ['negative'], 'blindfold': ['anticipation', 'fear', 'surprise'], 'blindly': ['negative', 'sadness'], 'blindness': ['negative', 'sadness'], 'bliss': ['joy', 'positive'], 'blissful': ['joy', 'positive'], 'blister': ['disgust', 'negative'], 'blitz': ['surprise'], 'bloated': ['disgust', 'negative'], 'blob': ['disgust', 'fear', 'negative'], 'blockade': ['anger', 'fear', 'negative', 'sadness'], 'bloodless': ['positive'], 'bloodshed': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'bloodthirsty': ['anger', 'disgust', 'fear', 'negative'], 'bloody': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'bloom': ['anticipation', 'joy', 'positive', 'trust'], 'blossom': ['joy', 'positive'], 'blot': ['negative'], 'blower': ['negative'], 'blowout': ['negative'], 'blue': ['sadness'], 'blues': ['fear', 'negative', 'sadness'], 'bluff': ['negative'], 'blunder': ['disgust', 'negative', 'sadness'], 'blur': ['negative'], 'blurred': ['negative'], 'blush': ['negative'], 'board': ['anticipation'], 'boast': ['negative', 'positive'], 'boasting': ['negative'], 'bodyguard': ['positive', 'trust'], 'bog': ['negative'], 'bogus': ['anger', 'disgust', 'negative'], 'boil': ['disgust', 'negative'], 'boilerplate': ['negative'], 'boisterous': ['anger', 'anticipation', 'joy', 'negative', 'positive'], 'bold': ['positive'], 'boldness': ['positive'], 'bolster': ['positive'], 'bomb': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'bombard': ['anger', 'fear', 'negative'], 'bombardment': ['anger', 'fear', 'negative'], 'bombed': ['disgust', 'negative'], 'bomber': ['fear', 'sadness'], 'bonanza': ['joy', 'positive'], 'bondage': ['fear', 'negative', 'sadness'], 'bonds': ['negative'], 'bonne': ['positive'], 'bonus': ['anticipation', 'joy', 'positive', 'surprise'], 'boo': ['negative'], 'booby': ['negative'], 'bookish': ['positive'], 'bookshop': ['positive'], 'bookworm': ['negative', 'positive'], 'boomerang': ['anticipation', 'trust'], 'boon': ['positive'], 'booze': ['negative'], 'bore': ['negative'], 'boredom': ['negative', 'sadness'], 'boring': ['negative'], 'borrower': ['negative'], 'bother': ['negative'], 'bothering': ['anger', 'negative', 'sadness'], 'bottom': ['negative', 'sadness'], 'bottomless': ['fear'], 'bound': ['negative'], 'bountiful': ['anticipation', 'joy', 'positive'], 'bounty': ['anticipation', 'joy', 'positive', 'trust'], 'bouquet': ['joy', 'positive', 'trust'], 'bout': ['anger', 'negative'], 'bovine': ['disgust', 'negative'], 'bowels': ['disgust'], 'boxing': ['anger'], 'boy': ['disgust', 'negative'], 'boycott': ['negative'], 'brag': ['negative'], 'brains': ['positive'], 'bran': ['disgust'], 'brandy': ['negative'], 'bravado': ['negative'], 'bravery': ['positive'], 'brawl': ['anger', 'disgust', 'fear', 'negative'], 'brazen': ['anger', 'negative'], 'breach': ['negative'], 'break': ['surprise'], 'breakdown': ['negative'], 'breakfast': ['positive'], 'breakneck': ['negative'], 'breakup': ['negative', 'sadness'], 'bribe': ['negative'], 'bribery': ['disgust', 'negative'], 'bridal': ['anticipation', 'joy', 'positive', 'trust'], 'bride': ['anticipation', 'joy', 'positive', 'trust'], 'bridegroom': ['anticipation', 'joy', 'positive', 'trust'], 'bridesmaid': ['joy', 'positive', 'trust'], 'brigade': ['fear', 'negative'], 'brighten': ['joy', 'positive', 'surprise', 'trust'], 'brightness': ['positive'], 'brilliant': ['anticipation', 'joy', 'positive', 'trust'], 'brimstone': ['anger', 'fear', 'negative'], 'bristle': ['negative'], 'broadside': ['anticipation', 'negative'], 'brocade': ['positive'], 'broil': ['anger', 'negative'], 'broke': ['fear', 'negative', 'sadness'], 'broken': ['anger', 'fear', 'negative', 'sadness'], 'brothel': ['disgust', 'negative'], 'brother': ['positive', 'trust'], 'brotherhood': ['positive', 'trust'], 'brotherly': ['anticipation', 'joy', 'positive', 'trust'], 'bruise': ['anticipation', 'negative'], 'brunt': ['anger', 'negative'], 'brutal': ['anger', 'fear', 'negative'], 'brutality': ['anger', 'fear', 'negative'], 'brute': ['anger', 'fear', 'negative', 'sadness'], 'buck': ['fear', 'negative', 'positive', 'surprise'], 'buddy': ['anticipation', 'joy', 'positive', 'trust'], 'budget': ['trust'], 'buffet': ['anger', 'negative'], 'bug': ['disgust', 'fear', 'negative'], 'bugaboo': ['anger', 'fear', 'negative', 'sadness'], 'bugle': ['anticipation'], 'build': ['positive'], 'building': ['positive'], 'bulbous': ['negative'], 'bulldog': ['positive'], 'bulletproof': ['positive'], 'bully': ['anger', 'fear', 'negative'], 'bum': ['disgust', 'negative', 'sadness'], 'bummer': ['anger', 'disgust', 'negative'], 'bunker': ['fear'], 'buoy': ['positive'], 'burdensome': ['fear', 'negative', 'sadness'], 'bureaucracy': ['negative', 'trust'], 'bureaucrat': ['disgust', 'negative'], 'burglar': ['disgust', 'fear', 'negative'], 'burglary': ['negative'], 'burial': ['anger', 'fear', 'negative', 'sadness'], 'buried': ['fear', 'negative', 'sadness'], 'burke': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'burlesque': ['surprise'], 'burnt': ['disgust', 'negative'], 'bursary': ['trust'], 'bury': ['sadness'], 'buss': ['joy', 'positive'], 'busted': ['anger', 'fear', 'negative'], 'butcher': ['anger', 'disgust', 'fear', 'negative'], 'butler': ['positive', 'trust'], 'butt': ['negative'], 'buttery': ['positive'], 'buxom': ['positive'], 'buzz': ['anticipation', 'fear', 'positive'], 'buzzed': ['negative'], 'bye': ['anticipation'], 'bylaw': ['trust'], 'cab': ['positive'], 'cabal': ['fear', 'negative'], 'cabinet': ['positive', 'trust'], 'cable': ['surprise'], 'cacophony': ['anger', 'disgust', 'negative'], 'cad': ['anger', 'disgust', 'negative'], 'cadaver': ['disgust', 'fear', 'negative', 'sadness', 'surprise'], 'cafe': ['positive'], 'cage': ['negative', 'sadness'], 'calamity': ['sadness'], 'calculating': ['negative'], 'calculation': ['anticipation'], 'calculator': ['positive', 'trust'], 'calf': ['joy', 'positive', 'trust'], 'callous': ['anger', 'disgust', 'negative'], 'calls': ['anticipation', 'negative', 'trust'], 'calm': ['positive'], 'camouflage': ['surprise'], 'camouflaged': ['surprise'], 'campaigning': ['anger', 'fear', 'negative'], 'canary': ['positive'], 'cancel': ['negative', 'sadness'], 'cancer': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'candid': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'candidate': ['positive'], 'candied': ['positive'], 'cane': ['anger', 'fear'], 'canker': ['anger', 'disgust', 'negative'], 'cannibal': ['disgust', 'fear', 'negative'], 'cannibalism': ['disgust', 'negative'], 'cannon': ['anger', 'fear', 'negative'], 'canons': ['trust'], 'cap': ['anticipation', 'trust'], 'capitalist': ['positive'], 'captain': ['positive'], 'captivate': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'captivating': ['positive'], 'captive': ['fear', 'negative', 'sadness'], 'captivity': ['negative', 'sadness'], 'captor': ['fear', 'negative'], 'capture': ['negative'], 'carcass': ['disgust', 'fear', 'negative', 'sadness'], 'carcinoma': ['fear', 'negative', 'sadness'], 'cardiomyopathy': ['fear', 'negative', 'sadness'], 'career': ['anticipation', 'positive'], 'careful': ['positive'], 'carefully': ['positive'], 'carelessness': ['anger', 'disgust', 'negative'], 'caress': ['positive'], 'caretaker': ['positive', 'trust'], 'caricature': ['negative'], 'caries': ['disgust', 'negative'], 'carnage': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'carnal': ['negative'], 'carnivorous': ['fear', 'negative'], 'carol': ['joy', 'positive', 'trust'], 'cartel': ['negative'], 'cartridge': ['fear'], 'cascade': ['positive'], 'case': ['fear', 'negative', 'sadness'], 'cash': ['anger', 'anticipation', 'fear', 'joy', 'positive', 'trust'], 'cashier': ['trust'], 'casket': ['fear', 'negative', 'sadness'], 'caste': ['negative'], 'casualty': ['anger', 'fear', 'negative', 'sadness'], 'cataract': ['anticipation', 'fear', 'negative', 'sadness'], 'catastrophe': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'catch': ['surprise'], 'catechism': ['disgust'], 'categorical': ['positive'], 'cater': ['positive'], 'cathartic': ['positive'], 'cathedral': ['joy', 'positive', 'trust'], 'catheter': ['negative'], 'caution': ['anger', 'anticipation', 'fear', 'negative'], 'cautionary': ['fear'], 'cautious': ['anticipation', 'fear', 'positive', 'trust'], 'cautiously': ['fear', 'positive'], 'cede': ['negative'], 'celebrated': ['anticipation', 'joy', 'positive'], 'celebrating': ['anticipation', 'joy', 'positive'], 'celebration': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'celebrity': ['anger', 'anticipation', 'disgust', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'celestial': ['anticipation', 'joy', 'positive'], 'cement': ['anticipation', 'trust'], 'cemetery': ['fear', 'negative', 'sadness'], 'censor': ['anger', 'disgust', 'fear', 'negative', 'trust'], 'censure': ['negative'], 'center': ['positive', 'trust'], 'centurion': ['positive'], 'cerebral': ['positive'], 'ceremony': ['joy', 'positive', 'surprise'], 'certainty': ['positive'], 'certify': ['trust'], 'cess': ['disgust', 'negative'], 'cessation': ['negative'], 'chaff': ['anger', 'fear', 'negative'], 'chafing': ['negative'], 'chagrin': ['disgust', 'negative', 'sadness'], 'chairman': ['positive', 'trust'], 'chairwoman': ['positive', 'trust'], 'challenge': ['anger', 'fear', 'negative'], 'champion': ['anticipation', 'joy', 'positive', 'trust'], 'chance': ['surprise'], 'chancellor': ['trust'], 'change': ['fear'], 'changeable': ['anticipation', 'surprise'], 'chant': ['anger', 'anticipation', 'joy', 'positive', 'surprise'], 'chaos': ['anger', 'fear', 'negative', 'sadness'], 'chaotic': ['anger', 'negative'], 'chaplain': ['trust'], 'charade': ['negative'], 'chargeable': ['fear', 'negative', 'sadness'], 'charger': ['positive'], 'charitable': ['anticipation', 'joy', 'positive', 'trust'], 'charity': ['joy', 'positive'], 'charm': ['positive'], 'charmed': ['joy', 'negative', 'positive'], 'charming': ['positive'], 'chart': ['trust'], 'chase': ['negative'], 'chasm': ['fear'], 'chastisement': ['negative'], 'chastity': ['anticipation', 'positive', 'trust'], 'chattering': ['positive'], 'chatty': ['negative'], 'cheap': ['negative'], 'cheat': ['anger', 'disgust', 'negative'], 'checklist': ['positive', 'trust'], 'cheer': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'cheerful': ['joy', 'positive', 'surprise'], 'cheerfulness': ['anticipation', 'joy', 'positive', 'trust'], 'cheering': ['joy', 'positive'], 'cheery': ['anticipation', 'joy', 'positive'], 'cheesecake': ['negative'], 'chemist': ['positive', 'trust'], 'cherish': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'cherry': ['positive'], 'chicane': ['anticipation', 'negative', 'surprise', 'trust'], 'chicken': ['fear'], 'chieftain': ['positive'], 'child': ['anticipation', 'joy', 'positive'], 'childhood': ['joy', 'positive'], 'childish': ['negative'], 'chilly': ['negative'], 'chimera': ['fear', 'surprise'], 'chirp': ['joy', 'positive'], 'chisel': ['positive'], 'chivalry': ['positive'], 'chloroform': ['negative'], 'chocolate': ['anticipation', 'joy', 'positive', 'trust'], 'choice': ['positive'], 'choir': ['joy', 'positive', 'trust'], 'choke': ['anger', 'negative', 'sadness'], 'cholera': ['disgust', 'fear', 'negative', 'sadness'], 'chop': ['negative'], 'choral': ['joy', 'positive'], 'chore': ['negative'], 'chorus': ['positive'], 'chosen': ['positive'], 'chowder': ['positive'], 'chronic': ['negative', 'sadness'], 'chronicle': ['positive', 'trust'], 'chuckle': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'church': ['anticipation', 'joy', 'positive', 'trust'], 'cider': ['positive'], 'cigarette': ['negative'], 'circumcision': ['positive'], 'circumvention': ['negative', 'positive'], 'citizen': ['positive'], 'civil': ['positive'], 'civility': ['positive'], 'civilization': ['positive', 'trust'], 'civilized': ['joy', 'positive', 'trust'], 'claimant': ['anger', 'disgust'], 'clairvoyant': ['positive'], 'clamor': ['anger', 'anticipation', 'disgust', 'negative', 'surprise'], 'clan': ['trust'], 'clap': ['anticipation', 'joy', 'positive', 'trust'], 'clarify': ['positive'], 'clash': ['anger', 'negative'], 'clashing': ['anger', 'fear', 'negative'], 'classic': ['positive'], 'classical': ['positive'], 'classics': ['joy', 'positive'], 'classify': ['positive'], 'claw': ['anger', 'fear', 'negative'], 'clean': ['joy', 'positive', 'trust'], 'cleaning': ['positive'], 'cleanliness': ['positive'], 'cleanly': ['positive'], 'cleanse': ['positive'], 'cleansing': ['positive'], 'clearance': ['positive', 'trust'], 'clearness': ['positive'], 'cleave': ['fear'], 'clerical': ['positive', 'trust'], 'clever': ['positive'], 'cleverness': ['positive'], 'cliff': ['fear'], 'climax': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'clock': ['anticipation'], 'cloister': ['negative'], 'closeness': ['joy', 'positive', 'trust'], 'closure': ['anticipation', 'joy', 'positive', 'sadness'], 'clothe': ['positive'], 'clouded': ['negative', 'sadness'], 'cloudiness': ['fear', 'negative'], 'cloudy': ['sadness'], 'clown': ['anticipation', 'joy', 'positive', 'surprise'], 'clue': ['anticipation'], 'clump': ['negative'], 'clumsy': ['disgust', 'negative'], 'coach': ['trust'], 'coalesce': ['trust'], 'coalition': ['positive'], 'coast': ['positive'], 'coax': ['trust'], 'cobra': ['fear'], 'cocaine': ['negative', 'sadness'], 'coerce': ['anger', 'disgust', 'fear', 'negative'], 'coercion': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'coexist': ['positive', 'trust'], 'coexisting': ['trust'], 'coffin': ['fear', 'negative', 'sadness'], 'cogent': ['positive', 'trust'], 'cognitive': ['positive'], 'coherence': ['positive'], 'coherent': ['positive'], 'cohesion': ['trust'], 'cohesive': ['positive', 'trust'], 'coincidence': ['surprise'], 'cold': ['negative'], 'coldly': ['negative'], 'coldness': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'colic': ['negative'], 'collaborator': ['trust'], 'collapse': ['disgust', 'fear', 'negative', 'sadness'], 'collateral': ['trust'], 'collectively': ['positive', 'trust'], 'collision': ['anger', 'negative'], 'collusion': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'colonel': ['positive', 'trust'], 'colossal': ['positive'], 'coma': ['fear', 'negative', 'sadness'], 'comatose': ['fear', 'negative', 'sadness'], 'combat': ['anger', 'fear', 'negative'], 'combatant': ['anger', 'fear', 'negative'], 'combative': ['anger', 'fear', 'negative'], 'comfort': ['anticipation', 'joy', 'positive', 'trust'], 'coming': ['anticipation'], 'commandant': ['positive', 'trust'], 'commanding': ['positive', 'trust'], 'commemorate': ['anticipation', 'joy', 'positive', 'sadness'], 'commemoration': ['anticipation', 'joy', 'positive'], 'commemorative': ['anticipation', 'positive'], 'commend': ['positive'], 'commendable': ['joy', 'positive', 'trust'], 'commentator': ['positive'], 'commerce': ['trust'], 'commission': ['trust'], 'committal': ['negative', 'sadness'], 'committed': ['positive', 'trust'], 'committee': ['trust'], 'commodore': ['positive', 'trust'], 'commonplace': ['anticipation', 'trust'], 'commonwealth': ['positive', 'trust'], 'commotion': ['anger', 'negative'], 'communicate': ['positive', 'trust'], 'communication': ['trust'], 'communicative': ['positive'], 'communion': ['joy', 'positive', 'trust'], 'communism': ['anger', 'fear', 'negative', 'sadness'], 'communist': ['negative'], 'community': ['positive'], 'commutation': ['positive'], 'commute': ['positive'], 'compact': ['trust'], 'companion': ['joy', 'positive', 'trust'], 'compass': ['trust'], 'compassion': ['fear', 'positive'], 'compassionate': ['positive'], 'compatibility': ['positive'], 'compatible': ['positive'], 'compelling': ['positive'], 'compensate': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'compensatory': ['positive'], 'competence': ['positive', 'trust'], 'competency': ['positive', 'trust'], 'competent': ['positive', 'trust'], 'competition': ['anticipation', 'negative'], 'complacency': ['positive'], 'complain': ['anger', 'negative', 'sadness'], 'complaint': ['anger', 'negative'], 'complement': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'complementary': ['positive'], 'completely': ['positive'], 'completeness': ['positive'], 'completing': ['anticipation', 'joy', 'positive'], 'completion': ['anticipation', 'joy', 'positive'], 'complexed': ['negative'], 'complexity': ['negative'], 'compliance': ['positive', 'trust'], 'compliant': ['positive'], 'complicate': ['anger', 'negative'], 'complicated': ['negative'], 'complication': ['negative'], 'complicity': ['negative', 'positive'], 'compliment': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'composed': ['positive'], 'composer': ['positive'], 'compost': ['disgust', 'negative'], 'composure': ['positive'], 'comprehend': ['positive'], 'comprehensive': ['positive'], 'compress': ['anger'], 'comptroller': ['trust'], 'compulsion': ['anger', 'negative'], 'compulsory': ['negative'], 'comrade': ['positive', 'trust'], 'conceal': ['negative', 'sadness'], 'concealed': ['anticipation', 'fear', 'negative', 'surprise'], 'concealment': ['anger', 'anticipation', 'fear', 'negative'], 'conceit': ['negative'], 'conceited': ['negative'], 'concentric': ['positive'], 'concerned': ['fear', 'sadness'], 'conciliation': ['joy', 'positive', 'trust'], 'concluding': ['positive'], 'concord': ['positive', 'trust'], 'concordance': ['positive', 'trust'], 'concussion': ['anger', 'negative', 'sadness'], 'condemn': ['anger', 'negative'], 'condemnation': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'condescending': ['negative'], 'condescension': ['anger', 'disgust', 'negative', 'sadness'], 'condolence': ['positive', 'sadness'], 'condone': ['positive'], 'conducive': ['positive'], 'conductivity': ['positive'], 'confederate': ['positive', 'trust'], 'confess': ['negative', 'positive', 'trust'], 'confession': ['anticipation', 'fear', 'negative', 'sadness', 'surprise'], 'confessional': ['fear', 'trust'], 'confide': ['trust'], 'confidence': ['fear', 'joy', 'positive', 'trust'], 'confident': ['joy', 'positive', 'trust'], 'confidential': ['trust'], 'confidentially': ['trust'], 'confine': ['anger', 'fear', 'negative', 'sadness'], 'confined': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'confinement': ['anger', 'fear', 'negative', 'sadness'], 'confirmation': ['trust'], 'confirmed': ['positive', 'trust'], 'confiscate': ['anger', 'negative', 'sadness'], 'confiscation': ['negative'], 'conflagration': ['anger', 'fear', 'negative'], 'conflict': ['anger', 'fear', 'negative', 'sadness'], 'conflicting': ['negative'], 'conformance': ['positive'], 'conformity': ['trust'], 'confound': ['negative'], 'confounded': ['negative'], 'confront': ['anger'], 'confuse': ['negative'], 'confusion': ['anger', 'fear', 'negative'], 'congenial': ['positive'], 'congestion': ['negative'], 'conglomerate': ['trust'], 'congratulatory': ['joy', 'positive'], 'congregation': ['positive', 'trust'], 'congress': ['disgust', 'trust'], 'congressman': ['trust'], 'congruence': ['positive', 'trust'], 'conjecture': ['anticipation'], 'conjure': ['anticipation', 'surprise'], 'conjuring': ['negative'], 'connective': ['trust'], 'connoisseur': ['joy', 'positive', 'trust'], 'conquest': ['anger', 'fear', 'negative'], 'conscience': ['positive', 'trust'], 'conscientious': ['positive', 'trust'], 'consciousness': ['positive'], 'consecration': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'consequent': ['anticipation'], 'conservation': ['anticipation', 'positive', 'trust'], 'conserve': ['positive'], 'considerable': ['positive'], 'considerate': ['positive', 'trust'], 'consistency': ['positive', 'trust'], 'console': ['positive', 'sadness'], 'consonant': ['positive'], 'consort': ['trust'], 'conspiracy': ['fear'], 'conspirator': ['anger', 'anticipation', 'disgust', 'fear', 'negative'], 'conspire': ['fear', 'negative'], 'constable': ['trust'], 'constancy': ['positive', 'trust'], 'constant': ['positive', 'trust'], 'constantly': ['trust'], 'consternation': ['anger', 'fear', 'negative'], 'constipation': ['disgust', 'negative'], 'constitute': ['trust'], 'constitutional': ['positive', 'trust'], 'constrain': ['fear', 'negative'], 'constrained': ['negative'], 'constraint': ['anger', 'fear', 'negative', 'sadness'], 'construct': ['positive'], 'consul': ['trust'], 'consult': ['trust'], 'consummate': ['positive'], 'contact': ['positive'], 'contagion': ['anticipation', 'disgust', 'fear', 'negative'], 'contagious': ['disgust', 'fear', 'negative'], 'contaminate': ['disgust', 'negative'], 'contaminated': ['disgust', 'fear', 'negative', 'sadness'], 'contamination': ['disgust', 'negative'], 'contemplation': ['positive'], 'contempt': ['anger', 'disgust', 'fear', 'negative'], 'contemptible': ['anger', 'disgust', 'negative'], 'contemptuous': ['anger', 'negative'], 'content': ['joy', 'positive', 'trust'], 'contentious': ['anger', 'disgust', 'fear', 'negative'], 'contingent': ['anticipation'], 'continuation': ['anticipation'], 'continue': ['anticipation', 'positive', 'trust'], 'contour': ['positive'], 'contraband': ['anger', 'disgust', 'fear', 'negative'], 'contracted': ['negative'], 'contradict': ['anger', 'negative'], 'contradiction': ['negative'], 'contradictory': ['negative'], 'contrary': ['negative'], 'contrasted': ['negative'], 'contravene': ['negative'], 'contravention': ['negative'], 'contribute': ['positive'], 'contributor': ['positive', 'trust'], 'controversial': ['anger', 'negative'], 'controversy': ['negative'], 'convenience': ['positive'], 'convenient': ['positive'], 'convent': ['positive', 'trust'], 'convention': ['positive'], 'convergence': ['anticipation'], 'conversant': ['positive'], 'conversational': ['positive'], 'convert': ['positive'], 'conveyancing': ['trust'], 'convict': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'conviction': ['negative'], 'convince': ['anticipation', 'positive', 'trust'], 'convinced': ['trust'], 'convincing': ['trust'], 'cool': ['positive'], 'coolness': ['positive'], 'coop': ['anger', 'disgust', 'negative'], 'cooperate': ['positive'], 'cooperating': ['positive', 'trust'], 'cooperation': ['positive', 'trust'], 'cooperative': ['positive', 'trust'], 'cop': ['fear', 'trust'], 'copy': ['negative'], 'copycat': ['anger', 'disgust', 'negative'], 'core': ['positive'], 'coronation': ['joy', 'positive', 'trust'], 'coroner': ['negative'], 'corporal': ['negative'], 'corporation': ['positive', 'trust'], 'corporeal': ['positive'], 'corpse': ['disgust', 'negative', 'sadness'], 'correction': ['negative'], 'corrective': ['positive'], 'correctness': ['trust'], 'correspondence': ['anticipation', 'positive'], 'corroborate': ['positive', 'trust'], 'corroboration': ['trust'], 'corrosion': ['negative'], 'corrosive': ['fear', 'negative'], 'corrupt': ['negative'], 'corrupting': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'corruption': ['disgust', 'negative'], 'corse': ['sadness'], 'cosmopolitan': ['positive', 'trust'], 'cosy': ['positive'], 'couch': ['sadness'], 'cough': ['disgust', 'negative'], 'council': ['anticipation', 'positive', 'trust'], 'counsel': ['positive', 'trust'], 'counsellor': ['anger', 'fear', 'negative', 'trust'], 'counselor': ['positive', 'trust'], 'count': ['positive', 'trust'], 'countdown': ['anticipation'], 'countess': ['positive'], 'countryman': ['trust'], 'county': ['trust'], 'coup': ['anger', 'surprise'], 'courage': ['positive'], 'courageous': ['fear', 'positive'], 'courier': ['trust'], 'coursing': ['negative'], 'court': ['anger', 'anticipation', 'fear'], 'courteous': ['positive'], 'courtesy': ['positive'], 'courtship': ['anticipation', 'joy', 'positive', 'trust'], 'cove': ['anticipation', 'disgust', 'fear', 'joy', 'positive'], 'covenant': ['positive', 'trust'], 'cover': ['trust'], 'covet': ['negative'], 'coward': ['disgust', 'fear', 'negative', 'sadness'], 'cowardice': ['fear', 'negative'], 'cowardly': ['fear', 'negative'], 'coy': ['fear'], 'coyote': ['fear'], 'crabby': ['anger', 'negative'], 'crack': ['negative'], 'cracked': ['anger', 'fear', 'negative'], 'cracking': ['negative'], 'cradle': ['anticipation', 'joy', 'positive', 'trust'], 'craft': ['positive'], 'craftsman': ['positive'], 'cramp': ['anticipation', 'negative'], 'cramped': ['negative'], 'crank': ['negative'], 'cranky': ['anger', 'negative'], 'crap': ['disgust', 'negative'], 'craps': ['anticipation'], 'crash': ['fear', 'negative', 'sadness', 'surprise'], 'crave': ['anticipation'], 'craving': ['anticipation'], 'crawl': ['disgust', 'negative'], 'crazed': ['anger', 'fear', 'negative'], 'crazy': ['anger', 'fear', 'negative', 'sadness'], 'creaking': ['negative'], 'cream': ['anticipation', 'joy', 'positive', 'surprise'], 'create': ['joy', 'positive'], 'creative': ['positive'], 'creature': ['disgust', 'fear', 'negative'], 'credence': ['positive', 'trust'], 'credential': ['positive', 'trust'], 'credibility': ['positive', 'trust'], 'credible': ['positive', 'trust'], 'credit': ['positive', 'trust'], 'creditable': ['positive', 'trust'], 'credited': ['positive'], 'creep': ['negative'], 'creeping': ['anticipation'], 'cremation': ['sadness'], 'crescendo': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'crew': ['trust'], 'crime': ['anger', 'negative'], 'criminal': ['anger', 'disgust', 'fear', 'negative'], 'criminality': ['anger', 'disgust', 'fear', 'negative'], 'cringe': ['disgust', 'fear', 'negative', 'sadness'], 'cripple': ['fear', 'negative', 'sadness'], 'crippled': ['negative', 'sadness'], 'crisis': ['negative'], 'crisp': ['negative', 'trust'], 'critic': ['negative'], 'criticism': ['anger', 'negative', 'sadness'], 'criticize': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'critique': ['positive'], 'critter': ['disgust'], 'crocodile': ['fear'], 'crook': ['negative'], 'cross': ['anger', 'fear', 'negative', 'sadness'], 'crouch': ['fear'], 'crouching': ['fear', 'negative'], 'crowning': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'crucial': ['positive', 'trust'], 'cruciate': ['negative'], 'crucifixion': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'crude': ['disgust', 'negative'], 'cruel': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'cruelly': ['anger', 'fear', 'negative'], 'cruelty': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'crumbling': ['negative', 'sadness'], 'crunch': ['anger', 'negative'], 'crusade': ['anger', 'fear', 'negative'], 'crushed': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'crushing': ['anger', 'disgust', 'fear', 'negative'], 'crusty': ['disgust', 'negative'], 'cry': ['negative', 'sadness'], 'crying': ['negative', 'sadness'], 'crypt': ['fear', 'negative', 'sadness'], 'crystal': ['positive'], 'cube': ['trust'], 'cuckold': ['disgust', 'negative'], 'cuckoo': ['negative'], 'cuddle': ['joy', 'positive', 'trust'], 'cue': ['anticipation'], 'culinary': ['positive', 'trust'], 'cull': ['negative'], 'culmination': ['positive'], 'culpability': ['negative'], 'culpable': ['negative'], 'culprit': ['negative'], 'cult': ['fear', 'negative'], 'cultivate': ['anticipation', 'positive', 'trust'], 'cultivated': ['positive'], 'cultivation': ['positive'], 'culture': ['positive'], 'cumbersome': ['negative', 'sadness'], 'cunning': ['negative', 'positive'], 'cupping': ['disgust', 'fear', 'negative', 'sadness'], 'cur': ['anger', 'disgust', 'fear', 'negative'], 'curable': ['positive', 'trust'], 'curiosity': ['anticipation', 'positive', 'surprise'], 'curl': ['positive'], 'curse': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'cursed': ['anger', 'fear', 'negative', 'sadness'], 'cursing': ['anger', 'disgust', 'negative'], 'cursory': ['negative'], 'cushion': ['positive'], 'cussed': ['anger'], 'custodian': ['trust'], 'custody': ['trust'], 'customer': ['positive'], 'cute': ['positive'], 'cutter': ['fear', 'negative'], 'cutters': ['positive'], 'cutthroat': ['anger', 'fear', 'negative'], 'cutting': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'cyanide': ['fear', 'negative'], 'cyclone': ['fear', 'negative', 'surprise'], 'cyst': ['fear', 'negative', 'sadness'], 'cystic': ['disgust'], 'cytomegalovirus': ['negative', 'sadness'], 'dabbling': ['anger', 'disgust', 'negative'], 'daemon': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'daft': ['disgust', 'negative'], 'dagger': ['fear', 'negative'], 'daily': ['anticipation'], 'damage': ['anger', 'disgust', 'negative', 'sadness'], 'damages': ['negative', 'sadness'], 'dame': ['anger', 'disgust', 'positive', 'trust'], 'damn': ['anger', 'disgust', 'negative'], 'damnation': ['anger', 'fear', 'negative', 'sadness'], 'damned': ['negative'], 'damper': ['negative'], 'dance': ['joy', 'positive', 'trust'], 'dandruff': ['negative'], 'dandy': ['disgust', 'negative'], 'danger': ['fear', 'negative', 'sadness'], 'dangerous': ['fear', 'negative'], 'dank': ['disgust'], 'dare': ['anticipation', 'trust'], 'daring': ['positive'], 'dark': ['sadness'], 'darken': ['fear', 'negative', 'sadness'], 'darkened': ['fear', 'negative', 'sadness'], 'darkness': ['anger', 'fear', 'negative', 'sadness'], 'darling': ['joy', 'positive', 'trust'], 'dart': ['fear'], 'dashed': ['anger', 'fear', 'negative', 'sadness'], 'dashing': ['positive'], 'dastardly': ['anger', 'disgust', 'fear', 'negative'], 'daughter': ['joy', 'positive'], 'dawn': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'dazed': ['negative'], 'deacon': ['trust'], 'deactivate': ['negative'], 'deadlock': ['negative'], 'deadly': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'deaf': ['negative'], 'deal': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'dealings': ['trust'], 'dear': ['positive'], 'death': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'debacle': ['fear', 'negative', 'sadness'], 'debate': ['positive'], 'debauchery': ['disgust', 'fear', 'negative'], 'debenture': ['anticipation'], 'debris': ['disgust', 'negative'], 'debt': ['negative', 'sadness'], 'debtor': ['negative'], 'decay': ['fear', 'negative', 'sadness'], 'decayed': ['disgust', 'negative', 'sadness'], 'deceased': ['negative', 'sadness'], 'deceit': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'deceitful': ['disgust', 'negative', 'sadness'], 'deceive': ['anger', 'disgust', 'negative', 'sadness'], 'deceived': ['anger', 'negative'], 'deceiving': ['negative', 'trust'], 'decency': ['positive'], 'decent': ['positive'], 'deception': ['negative'], 'deceptive': ['negative'], 'declaratory': ['positive'], 'declination': ['negative'], 'decline': ['negative'], 'declining': ['negative'], 'decompose': ['disgust'], 'decomposed': ['sadness'], 'decomposition': ['disgust', 'fear', 'negative', 'sadness'], 'decoy': ['surprise'], 'decrease': ['negative'], 'decrement': ['negative'], 'decrepit': ['negative'], 'decry': ['anger', 'negative'], 'dedication': ['positive'], 'deduct': ['negative'], 'deed': ['trust'], 'defamation': ['disgust', 'fear', 'negative'], 'defamatory': ['anger', 'negative'], 'default': ['disgust', 'fear', 'negative', 'sadness'], 'defeat': ['negative'], 'defeated': ['negative', 'sadness'], 'defect': ['anger', 'negative'], 'defection': ['fear', 'negative'], 'defective': ['disgust', 'negative'], 'defend': ['fear', 'positive'], 'defendant': ['anger', 'fear', 'sadness'], 'defended': ['positive', 'trust'], 'defender': ['positive', 'trust'], 'defending': ['positive'], 'defense': ['anger', 'anticipation', 'fear', 'positive'], 'defenseless': ['fear', 'negative', 'sadness'], 'deference': ['positive', 'trust'], 'deferral': ['negative'], 'defiance': ['anger', 'disgust', 'fear', 'negative'], 'defiant': ['anger', 'negative'], 'deficiency': ['negative'], 'deficit': ['negative'], 'definitive': ['positive', 'trust'], 'deflate': ['anger', 'negative', 'sadness'], 'deflation': ['fear', 'negative'], 'deform': ['disgust', 'negative'], 'deformed': ['disgust', 'negative', 'sadness'], 'deformity': ['disgust', 'fear', 'negative', 'sadness'], 'defraud': ['anger', 'disgust', 'negative'], 'defunct': ['negative', 'sadness'], 'defy': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'degeneracy': ['anger', 'disgust', 'negative', 'sadness'], 'degenerate': ['negative'], 'degradation': ['negative'], 'degrade': ['disgust', 'negative'], 'degrading': ['disgust', 'fear', 'negative', 'sadness'], 'degree': ['positive'], 'delay': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'delayed': ['negative'], 'delectable': ['positive'], 'delegate': ['positive', 'trust'], 'deleterious': ['anger', 'disgust', 'fear', 'negative'], 'deletion': ['negative'], 'deliberate': ['positive'], 'delicious': ['joy', 'positive'], 'delight': ['anticipation', 'joy', 'positive'], 'delighted': ['anticipation', 'joy', 'positive', 'surprise'], 'delightful': ['anticipation', 'joy', 'positive', 'trust'], 'delinquency': ['negative'], 'delinquent': ['anger', 'disgust', 'negative'], 'delirious': ['negative', 'sadness'], 'delirium': ['disgust', 'negative', 'sadness'], 'deliverance': ['anticipation', 'joy', 'positive', 'trust'], 'delivery': ['anticipation', 'positive'], 'deluge': ['fear', 'negative', 'sadness', 'surprise'], 'delusion': ['anger', 'fear', 'negative', 'sadness'], 'delusional': ['anger', 'fear', 'negative'], 'demand': ['anger', 'negative'], 'demanding': ['negative'], 'demented': ['fear', 'negative'], 'dementia': ['fear', 'negative', 'sadness'], 'demise': ['fear', 'negative', 'sadness'], 'democracy': ['positive'], 'demolish': ['anger', 'negative', 'sadness'], 'demolition': ['negative'], 'demon': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'demonic': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'demonstrable': ['positive'], 'demonstrative': ['joy', 'positive', 'sadness'], 'demoralized': ['fear', 'negative', 'sadness'], 'denial': ['negative'], 'denied': ['negative', 'sadness'], 'denounce': ['anger', 'disgust', 'negative'], 'dentistry': ['fear'], 'denunciation': ['anger', 'disgust', 'fear', 'negative'], 'deny': ['anger', 'negative'], 'denying': ['anticipation', 'negative'], 'depart': ['anticipation', 'sadness'], 'departed': ['negative', 'sadness'], 'departure': ['negative', 'sadness'], 'depend': ['anticipation', 'trust'], 'dependence': ['fear', 'negative', 'sadness'], 'dependency': ['negative'], 'dependent': ['negative', 'positive', 'trust'], 'deplorable': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'deplore': ['anger', 'disgust', 'negative', 'sadness'], 'deport': ['fear', 'negative', 'sadness'], 'deportation': ['anger', 'fear', 'negative', 'sadness'], 'depository': ['trust'], 'depraved': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'depravity': ['anger', 'disgust', 'negative'], 'depreciate': ['anger', 'disgust', 'negative'], 'depreciated': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'depreciation': ['fear', 'negative'], 'depress': ['fear', 'negative', 'sadness'], 'depressed': ['anger', 'fear', 'negative', 'sadness'], 'depressing': ['disgust', 'negative', 'sadness'], 'depression': ['negative', 'sadness'], 'depressive': ['negative', 'sadness'], 'deprivation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'depth': ['positive', 'trust'], 'deputy': ['trust'], 'deranged': ['anger', 'disgust', 'fear', 'negative'], 'derelict': ['negative'], 'derision': ['anger', 'disgust', 'negative'], 'dermatologist': ['trust'], 'derogation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'derogatory': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'descent': ['fear', 'sadness'], 'descriptive': ['positive'], 'desecration': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'desert': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'deserted': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'desertion': ['negative'], 'deserve': ['anger', 'anticipation', 'positive', 'trust'], 'deserved': ['positive'], 'designation': ['trust'], 'designer': ['positive'], 'desirable': ['positive'], 'desiring': ['positive'], 'desirous': ['positive'], 'desist': ['anger', 'disgust', 'negative'], 'desolation': ['fear', 'negative', 'sadness'], 'despair': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'despairing': ['fear', 'negative', 'sadness'], 'desperate': ['negative'], 'despicable': ['anger', 'disgust', 'negative'], 'despise': ['anger', 'disgust', 'negative'], 'despotic': ['fear', 'negative'], 'despotism': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'destination': ['anticipation', 'fear', 'joy', 'positive', 'sadness', 'surprise'], 'destined': ['anticipation'], 'destitute': ['fear', 'negative', 'sadness'], 'destroyed': ['anger', 'fear', 'negative', 'sadness'], 'destroyer': ['anger', 'fear', 'negative'], 'destroying': ['anger', 'fear', 'negative', 'sadness'], 'destruction': ['anger', 'negative'], 'destructive': ['anger', 'disgust', 'fear', 'negative'], 'detachment': ['negative'], 'detain': ['negative'], 'detainee': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'detect': ['positive'], 'detection': ['positive'], 'detention': ['negative', 'sadness'], 'deteriorate': ['fear', 'negative', 'sadness'], 'deteriorated': ['disgust', 'negative', 'sadness'], 'deterioration': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'determinate': ['anticipation', 'trust'], 'determination': ['positive', 'trust'], 'determined': ['positive'], 'detest': ['anger', 'disgust', 'negative'], 'detonate': ['fear', 'negative', 'surprise'], 'detonation': ['anger'], 'detract': ['anger', 'negative'], 'detriment': ['negative'], 'detrimental': ['negative'], 'detritus': ['negative'], 'devastate': ['anger', 'fear', 'negative', 'sadness'], 'devastating': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'trust'], 'devastation': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'develop': ['anticipation', 'positive'], 'deviation': ['sadness'], 'devil': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'devilish': ['disgust', 'fear', 'negative'], 'devious': ['negative'], 'devolution': ['negative'], 'devotional': ['positive', 'trust'], 'devour': ['negative'], 'devout': ['anticipation', 'joy', 'positive', 'trust'], 'dexterity': ['positive'], 'diabolical': ['anger', 'disgust', 'fear', 'negative'], 'diagnosis': ['anticipation', 'fear', 'negative', 'trust'], 'diamond': ['joy', 'positive'], 'diaper': ['disgust'], 'diarrhoea': ['disgust'], 'diary': ['joy', 'positive', 'trust'], 'diatribe': ['anger', 'disgust', 'negative'], 'dictator': ['fear', 'negative'], 'dictatorial': ['anger', 'negative'], 'dictatorship': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'dictionary': ['positive', 'trust'], 'dictum': ['trust'], 'didactic': ['positive'], 'die': ['fear', 'negative', 'sadness'], 'dietary': ['anticipation', 'positive'], 'differential': ['trust'], 'differently': ['surprise'], 'difficult': ['fear'], 'difficulties': ['negative', 'sadness'], 'difficulty': ['anger', 'fear', 'negative', 'sadness'], 'digit': ['trust'], 'dignified': ['positive'], 'dignity': ['positive', 'trust'], 'digress': ['anticipation', 'negative'], 'dike': ['fear'], 'dilapidated': ['disgust', 'negative', 'sadness'], 'diligence': ['positive', 'trust'], 'dilute': ['negative'], 'diminish': ['negative', 'sadness'], 'diminished': ['negative'], 'din': ['negative'], 'dinner': ['positive'], 'dinosaur': ['fear'], 'diplomacy': ['anticipation', 'positive', 'trust'], 'diplomatic': ['positive', 'trust'], 'dire': ['disgust', 'fear', 'negative', 'sadness', 'surprise'], 'director': ['positive', 'trust'], 'dirt': ['disgust', 'negative'], 'dirty': ['disgust', 'negative'], 'disability': ['negative', 'sadness'], 'disable': ['fear', 'negative', 'sadness'], 'disabled': ['fear', 'negative', 'sadness'], 'disaffected': ['negative'], 'disagree': ['anger', 'negative'], 'disagreeing': ['anger', 'negative', 'sadness'], 'disagreement': ['anger', 'negative', 'sadness'], 'disallowed': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disappear': ['fear'], 'disappoint': ['anger', 'disgust', 'negative', 'sadness'], 'disappointed': ['anger', 'disgust', 'negative', 'sadness'], 'disappointing': ['negative', 'sadness'], 'disappointment': ['disgust', 'negative', 'sadness'], 'disapproval': ['negative', 'sadness'], 'disapprove': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disapproved': ['anger', 'negative', 'sadness'], 'disapproving': ['anger', 'disgust', 'negative', 'sadness'], 'disaster': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'disastrous': ['anger', 'fear', 'negative', 'sadness'], 'disbelieve': ['negative'], 'discards': ['negative'], 'discharge': ['negative'], 'disciple': ['trust'], 'discipline': ['fear', 'negative'], 'disclaim': ['anger', 'disgust', 'negative', 'trust'], 'disclosed': ['trust'], 'discoloration': ['disgust', 'negative'], 'discolored': ['disgust', 'negative', 'sadness'], 'discomfort': ['negative', 'sadness'], 'disconnect': ['negative', 'sadness'], 'disconnected': ['negative', 'sadness'], 'disconnection': ['negative'], 'discontent': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'discontinue': ['negative'], 'discontinuity': ['disgust', 'fear', 'negative', 'sadness'], 'discord': ['anger', 'disgust', 'negative'], 'discourage': ['fear', 'negative', 'sadness'], 'discouragement': ['negative'], 'discovery': ['positive'], 'discredit': ['negative'], 'discreet': ['anticipation', 'positive'], 'discretion': ['anticipation', 'positive', 'trust'], 'discretionary': ['positive'], 'discriminate': ['anger', 'negative', 'sadness'], 'discriminating': ['disgust', 'negative'], 'discrimination': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'discussion': ['positive'], 'disdain': ['anger', 'disgust', 'negative'], 'disease': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'diseased': ['disgust', 'fear', 'negative', 'sadness'], 'disembodied': ['fear', 'negative', 'sadness'], 'disengagement': ['negative'], 'disfigured': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disgrace': ['anger', 'disgust', 'negative', 'sadness'], 'disgraced': ['anger', 'disgust', 'negative', 'sadness'], 'disgraceful': ['anger', 'disgust', 'negative'], 'disgruntled': ['anger', 'disgust', 'negative', 'sadness'], 'disgust': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disgusting': ['anger', 'disgust', 'fear', 'negative'], 'disheartened': ['negative', 'sadness'], 'disheartening': ['negative', 'sadness'], 'dishonest': ['anger', 'disgust', 'negative', 'sadness'], 'dishonesty': ['disgust', 'negative'], 'dishonor': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disillusionment': ['anger', 'disgust', 'negative', 'sadness'], 'disinfection': ['positive'], 'disinformation': ['anger', 'fear', 'negative'], 'disingenuous': ['disgust', 'negative'], 'disintegrate': ['disgust', 'fear', 'negative'], 'disintegration': ['negative'], 'disinterested': ['negative'], 'dislike': ['anger', 'disgust', 'negative'], 'disliked': ['anger', 'negative', 'sadness'], 'dislocated': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'dismal': ['disgust', 'fear', 'negative', 'sadness'], 'dismay': ['anger', 'anticipation', 'fear', 'negative', 'sadness', 'surprise'], 'dismemberment': ['disgust', 'fear', 'negative', 'sadness'], 'dismissal': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'disobedience': ['anger', 'disgust', 'negative'], 'disobedient': ['anger', 'negative'], 'disobey': ['anger', 'disgust', 'negative'], 'disorder': ['fear', 'negative'], 'disorderly': ['negative'], 'disorganized': ['negative'], 'disparage': ['anger', 'disgust', 'negative', 'sadness'], 'disparaging': ['anger', 'disgust', 'negative', 'sadness'], 'disparity': ['anger', 'disgust', 'negative', 'sadness'], 'dispassionate': ['negative', 'sadness'], 'dispel': ['negative', 'sadness'], 'dispersion': ['negative'], 'displace': ['negative'], 'displaced': ['anger', 'fear', 'sadness'], 'displeased': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'displeasure': ['disgust', 'negative'], 'disposal': ['negative'], 'dispose': ['disgust'], 'disposed': ['anticipation', 'positive', 'trust'], 'dispossessed': ['anger', 'fear', 'negative', 'sadness'], 'dispute': ['anger', 'negative'], 'disqualification': ['negative'], 'disqualified': ['anger', 'disgust', 'negative', 'sadness'], 'disqualify': ['negative', 'sadness'], 'disregard': ['negative'], 'disregarded': ['disgust', 'negative'], 'disreputable': ['anger', 'disgust', 'fear', 'negative'], 'disrespect': ['anger', 'negative'], 'disrespectful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'disruption': ['anger', 'fear', 'negative', 'surprise'], 'dissatisfaction': ['negative'], 'dissection': ['disgust'], 'disseminate': ['positive'], 'dissension': ['anger', 'negative'], 'dissenting': ['negative'], 'disservice': ['anger', 'disgust', 'negative', 'sadness'], 'dissident': ['anger', 'fear', 'negative'], 'dissolution': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'dissonance': ['anger', 'negative'], 'distaste': ['disgust', 'negative'], 'distasteful': ['disgust', 'negative'], 'distillation': ['positive'], 'distinction': ['positive'], 'distorted': ['disgust', 'negative'], 'distortion': ['negative'], 'distract': ['negative'], 'distracted': ['anger', 'negative'], 'distracting': ['anger', 'anticipation', 'negative'], 'distraction': ['negative'], 'distraught': ['negative', 'sadness'], 'distress': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'distressed': ['fear', 'negative'], 'distressing': ['anger', 'fear', 'negative'], 'distrust': ['anger', 'disgust', 'fear', 'negative'], 'disturbance': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'disturbed': ['anger', 'negative', 'sadness'], 'disuse': ['negative'], 'disused': ['anger', 'negative'], 'ditty': ['joy', 'positive'], 'divan': ['trust'], 'divergent': ['negative', 'surprise'], 'diverse': ['negative', 'positive'], 'diversified': ['positive'], 'diversion': ['positive', 'surprise'], 'divested': ['negative'], 'divestment': ['negative'], 'divination': ['anticipation'], 'divinity': ['positive'], 'divorce': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise', 'trust'], 'dizziness': ['negative'], 'dizzy': ['negative'], 'docked': ['negative'], 'doctor': ['positive', 'trust'], 'doctrine': ['trust'], 'doer': ['positive'], 'dogged': ['positive'], 'dogma': ['trust'], 'doit': ['negative'], 'doldrums': ['negative', 'sadness'], 'dole': ['negative', 'sadness'], 'doll': ['joy'], 'dolor': ['negative', 'sadness'], 'dolphin': ['joy', 'positive', 'surprise', 'trust'], 'dominant': ['fear', 'negative'], 'dominate': ['anger', 'fear', 'negative', 'positive'], 'domination': ['anger', 'fear', 'negative', 'sadness'], 'dominion': ['fear', 'trust'], 'don': ['positive', 'trust'], 'donation': ['positive'], 'donkey': ['disgust', 'negative'], 'doodle': ['negative'], 'doom': ['fear', 'negative'], 'doomed': ['fear', 'negative', 'sadness'], 'doomsday': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'doubt': ['fear', 'negative', 'sadness', 'trust'], 'doubtful': ['negative'], 'doubting': ['negative'], 'doubtless': ['positive', 'trust'], 'douche': ['negative'], 'dour': ['negative'], 'dove': ['anticipation', 'joy', 'positive', 'trust'], 'downfall': ['fear', 'negative', 'sadness'], 'downright': ['trust'], 'downy': ['positive'], 'drab': ['negative', 'sadness'], 'draft': ['anticipation'], 'dragon': ['fear'], 'drainage': ['negative'], 'drawback': ['negative'], 'dread': ['anticipation', 'fear', 'negative'], 'dreadful': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'dreadfully': ['disgust', 'fear', 'negative', 'sadness', 'surprise'], 'dreary': ['negative', 'sadness'], 'drinking': ['negative'], 'drivel': ['disgust', 'negative'], 'drone': ['negative'], 'drool': ['disgust'], 'drooping': ['negative'], 'drought': ['negative'], 'drown': ['fear', 'negative', 'sadness'], 'drowsiness': ['negative'], 'drudgery': ['negative'], 'drugged': ['sadness'], 'drunken': ['disgust', 'negative'], 'drunkenness': ['negative'], 'dubious': ['fear', 'negative', 'trust'], 'duel': ['anger', 'anticipation', 'fear'], 'duet': ['positive'], 'duke': ['positive'], 'dull': ['negative', 'sadness'], 'dumb': ['negative'], 'dummy': ['negative'], 'dumps': ['anger', 'negative', 'sadness'], 'dun': ['negative'], 'dung': ['disgust'], 'dungeon': ['fear', 'negative'], 'dupe': ['anger', 'negative'], 'duplicity': ['anger', 'negative'], 'durability': ['positive', 'trust'], 'durable': ['positive', 'trust'], 'duress': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'dust': ['negative'], 'dutiful': ['anticipation', 'positive', 'trust'], 'dwarfed': ['fear', 'negative', 'sadness'], 'dying': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'dynamic': ['surprise'], 'dysentery': ['disgust', 'negative', 'sadness'], 'eager': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'eagerness': ['anticipation', 'joy', 'positive', 'trust'], 'eagle': ['trust'], 'earl': ['positive'], 'earn': ['positive'], 'earnest': ['positive'], 'earnestly': ['positive'], 'earnestness': ['positive'], 'earthquake': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'ease': ['positive'], 'easement': ['positive'], 'easygoing': ['positive'], 'eat': ['positive'], 'eavesdropping': ['negative'], 'economy': ['trust'], 'ecstasy': ['anticipation', 'joy', 'positive'], 'ecstatic': ['anticipation', 'joy', 'positive', 'surprise'], 'edict': ['fear', 'negative'], 'edification': ['anticipation', 'joy', 'positive', 'trust'], 'edition': ['anticipation'], 'educate': ['positive'], 'educated': ['positive'], 'educational': ['positive', 'trust'], 'eel': ['fear'], 'effective': ['positive', 'trust'], 'effeminate': ['negative'], 'efficacy': ['positive'], 'efficiency': ['positive'], 'efficient': ['anticipation', 'positive', 'trust'], 'effigy': ['anger'], 'effort': ['positive'], 'egotistical': ['disgust', 'negative'], 'egregious': ['anger', 'disgust', 'negative'], 'ejaculation': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'eject': ['negative'], 'ejection': ['negative'], 'elaboration': ['positive'], 'elated': ['joy', 'positive'], 'elbow': ['anger'], 'elder': ['positive', 'trust'], 'elders': ['positive', 'trust'], 'elect': ['positive', 'trust'], 'electorate': ['trust'], 'electric': ['joy', 'positive', 'surprise'], 'electricity': ['positive'], 'elegance': ['anticipation', 'joy', 'positive', 'trust'], 'elegant': ['joy', 'positive'], 'elevation': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'elf': ['anger', 'disgust', 'fear'], 'eligible': ['positive'], 'elimination': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'elite': ['anticipation', 'joy', 'positive', 'trust'], 'eloquence': ['positive'], 'eloquent': ['positive'], 'elucidate': ['positive', 'trust'], 'elusive': ['negative', 'surprise'], 'emaciated': ['fear', 'negative', 'sadness'], 'emancipation': ['anticipation', 'joy', 'positive'], 'embargo': ['negative'], 'embarrass': ['negative', 'sadness'], 'embarrassing': ['negative'], 'embarrassment': ['fear', 'negative', 'sadness', 'surprise'], 'embezzlement': ['negative'], 'embolism': ['fear', 'negative', 'sadness'], 'embrace': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'embroiled': ['negative'], 'emergency': ['fear', 'negative', 'sadness', 'surprise'], 'emeritus': ['positive'], 'eminence': ['positive', 'trust'], 'eminent': ['positive'], 'eminently': ['positive'], 'emir': ['positive'], 'empathy': ['positive'], 'emphasize': ['trust'], 'employ': ['trust'], 'empower': ['positive'], 'emptiness': ['sadness'], 'emulate': ['positive'], 'enable': ['positive', 'trust'], 'enablement': ['positive', 'trust'], 'enchant': ['anticipation', 'joy', 'positive', 'surprise'], 'enchanted': ['joy', 'positive', 'trust'], 'enchanting': ['anticipation', 'joy', 'positive'], 'enclave': ['negative'], 'encore': ['positive'], 'encourage': ['joy', 'positive', 'trust'], 'encouragement': ['positive'], 'encroachment': ['fear', 'negative'], 'encumbrance': ['anger', 'fear', 'negative', 'sadness'], 'encyclopedia': ['positive', 'trust'], 'endanger': ['anticipation', 'fear', 'negative'], 'endangered': ['fear', 'negative'], 'endeavor': ['anticipation', 'positive'], 'endemic': ['disgust', 'fear', 'negative', 'sadness'], 'endless': ['anger', 'fear', 'joy', 'negative', 'positive', 'sadness', 'trust'], 'endocarditis': ['fear', 'sadness'], 'endow': ['positive', 'trust'], 'endowed': ['positive'], 'endowment': ['positive', 'trust'], 'endurance': ['positive'], 'endure': ['positive'], 'enema': ['disgust'], 'enemy': ['anger', 'disgust', 'fear', 'negative'], 'energetic': ['positive'], 'enforce': ['anger', 'fear', 'negative', 'positive'], 'enforcement': ['negative'], 'engaged': ['anticipation', 'joy', 'positive', 'trust'], 'engaging': ['joy', 'positive', 'trust'], 'engulf': ['anticipation'], 'enhance': ['positive'], 'enigmatic': ['fear', 'negative'], 'enjoy': ['anticipation', 'joy', 'positive', 'trust'], 'enjoying': ['anticipation', 'joy', 'positive', 'trust'], 'enlighten': ['joy', 'positive', 'trust'], 'enlightenment': ['joy', 'positive', 'trust'], 'enliven': ['joy', 'positive', 'surprise', 'trust'], 'enmity': ['anger', 'fear', 'negative', 'sadness'], 'enrich': ['positive'], 'enroll': ['anticipation', 'trust'], 'ensemble': ['positive', 'trust'], 'ensign': ['positive'], 'enslave': ['negative'], 'enslaved': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'enslavement': ['negative'], 'entangled': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'entanglement': ['negative'], 'enterprising': ['positive'], 'entertain': ['joy', 'positive'], 'entertained': ['joy', 'positive'], 'entertaining': ['anticipation', 'joy', 'positive'], 'entertainment': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'enthusiasm': ['anticipation', 'joy', 'positive', 'surprise'], 'enthusiast': ['anticipation', 'joy', 'positive', 'surprise'], 'entrails': ['disgust', 'negative'], 'entrust': ['trust'], 'envious': ['negative'], 'environ': ['positive'], 'ephemeris': ['positive'], 'epic': ['positive'], 'epidemic': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'epilepsy': ['negative'], 'episcopal': ['trust'], 'epitaph': ['sadness'], 'epitome': ['positive'], 'equality': ['joy', 'positive', 'trust'], 'equally': ['positive'], 'equilibrium': ['positive'], 'equity': ['positive'], 'eradicate': ['anger', 'negative'], 'eradication': ['anger', 'disgust', 'fear', 'negative'], 'erase': ['fear', 'negative'], 'erosion': ['negative'], 'erotic': ['anticipation', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'err': ['negative'], 'errand': ['anticipation', 'positive', 'trust'], 'errant': ['negative'], 'erratic': ['negative', 'surprise'], 'erratum': ['negative'], 'erroneous': ['negative'], 'error': ['negative', 'sadness'], 'erudite': ['positive'], 'erupt': ['anger', 'negative', 'surprise'], 'eruption': ['anger', 'fear', 'negative', 'surprise'], 'escalate': ['anger', 'negative'], 'escape': ['anticipation', 'fear', 'negative', 'positive'], 'escaped': ['fear'], 'eschew': ['anger', 'negative', 'sadness'], 'escort': ['trust'], 'espionage': ['negative'], 'esprit': ['positive'], 'essential': ['positive'], 'establish': ['trust'], 'established': ['joy', 'positive'], 'esteem': ['joy', 'positive', 'sadness', 'trust'], 'esthetic': ['positive'], 'estranged': ['negative'], 'ethereal': ['fear'], 'ethical': ['positive'], 'ethics': ['positive'], 'euthanasia': ['fear', 'negative', 'sadness'], 'evacuate': ['fear', 'negative'], 'evacuation': ['negative'], 'evade': ['anger', 'disgust', 'fear', 'negative'], 'evanescence': ['sadness', 'surprise'], 'evasion': ['fear', 'negative', 'sadness'], 'eventual': ['anticipation'], 'eventuality': ['anticipation', 'fear'], 'evergreen': ['joy', 'positive', 'trust'], 'everlasting': ['positive'], 'evict': ['negative', 'sadness'], 'eviction': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'evident': ['positive', 'trust'], 'evil': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'evolution': ['positive'], 'exacerbate': ['negative'], 'exacerbation': ['anger', 'fear', 'negative'], 'exacting': ['negative'], 'exaggerate': ['anger', 'negative'], 'exaggerated': ['negative'], 'exalt': ['anticipation', 'joy', 'positive', 'trust'], 'exaltation': ['joy', 'positive', 'trust'], 'exalted': ['joy', 'positive', 'trust'], 'examination': ['fear', 'negative', 'surprise'], 'exasperation': ['anger', 'disgust', 'negative'], 'excavation': ['anticipation', 'negative', 'surprise'], 'exceed': ['anticipation', 'joy', 'positive'], 'excel': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'excellence': ['disgust', 'joy', 'positive', 'trust'], 'excellent': ['joy', 'positive', 'trust'], 'excess': ['negative'], 'exchange': ['positive', 'trust'], 'excise': ['negative'], 'excitable': ['positive'], 'excitation': ['anger', 'anticipation', 'fear', 'joy', 'positive', 'surprise'], 'excite': ['anger', 'anticipation', 'fear', 'joy', 'positive', 'surprise'], 'excited': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'excitement': ['anticipation', 'joy', 'positive', 'surprise'], 'exciting': ['anticipation', 'joy', 'positive', 'surprise'], 'exclaim': ['surprise'], 'excluded': ['disgust', 'negative', 'sadness'], 'excluding': ['negative', 'sadness'], 'exclusion': ['disgust', 'fear', 'negative', 'sadness'], 'excrement': ['disgust', 'negative'], 'excretion': ['disgust'], 'excruciating': ['fear', 'negative'], 'excuse': ['negative'], 'execution': ['anger', 'fear', 'negative', 'sadness', 'trust'], 'executioner': ['anger', 'fear', 'negative', 'sadness'], 'executor': ['trust'], 'exemplary': ['positive'], 'exemption': ['positive'], 'exhaust': ['negative'], 'exhausted': ['negative', 'sadness'], 'exhaustion': ['anticipation', 'negative', 'sadness'], 'exhaustive': ['trust'], 'exhilaration': ['joy', 'positive', 'surprise'], 'exhort': ['positive'], 'exhortation': ['positive'], 'exigent': ['anticipation', 'disgust', 'fear', 'negative', 'surprise'], 'exile': ['anger', 'fear', 'negative', 'sadness'], 'existence': ['positive'], 'exorcism': ['fear', 'negative', 'sadness'], 'exotic': ['positive'], 'expatriate': ['negative'], 'expect': ['anticipation', 'positive', 'surprise', 'trust'], 'expectancy': ['anticipation'], 'expectant': ['anticipation'], 'expectation': ['anticipation', 'positive'], 'expected': ['anticipation'], 'expecting': ['anticipation'], 'expedient': ['joy', 'positive', 'trust'], 'expedition': ['anticipation', 'positive'], 'expel': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'expenditure': ['negative'], 'expenses': ['negative'], 'experienced': ['positive', 'trust'], 'experiment': ['anticipation', 'surprise'], 'expert': ['positive', 'trust'], 'expertise': ['positive', 'trust'], 'expire': ['negative', 'sadness'], 'expired': ['negative'], 'explain': ['positive', 'trust'], 'expletive': ['anger', 'negative'], 'explode': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'explore': ['anticipation'], 'explosion': ['fear', 'negative', 'surprise'], 'explosive': ['anger', 'anticipation', 'fear', 'negative', 'surprise'], 'expose': ['anticipation', 'fear'], 'exposed': ['negative'], 'expropriation': ['negative'], 'expulsion': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'exquisite': ['joy', 'positive'], 'exquisitely': ['positive'], 'extend': ['positive'], 'extensive': ['positive'], 'exterminate': ['fear', 'negative', 'sadness'], 'extermination': ['anger', 'fear', 'negative'], 'extinct': ['negative', 'sadness'], 'extinguish': ['anger', 'negative'], 'extra': ['positive'], 'extrajudicial': ['fear', 'negative'], 'extraordinary': ['positive'], 'extremity': ['negative'], 'extricate': ['anticipation', 'positive'], 'exuberance': ['joy', 'positive'], 'eyewitness': ['trust'], 'fabricate': ['negative'], 'fabrication': ['negative', 'trust'], 'facilitate': ['positive'], 'fact': ['trust'], 'facts': ['positive', 'trust'], 'faculty': ['positive', 'trust'], 'fade': ['negative'], 'faeces': ['disgust', 'negative'], 'failing': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'failure': ['disgust', 'fear', 'negative', 'sadness'], 'fain': ['anticipation', 'joy', 'positive', 'trust'], 'fainting': ['fear', 'negative', 'sadness', 'surprise'], 'fair': ['positive'], 'fairly': ['positive', 'trust'], 'faith': ['anticipation', 'joy', 'positive', 'trust'], 'faithful': ['positive', 'trust'], 'faithless': ['negative', 'sadness'], 'fake': ['negative'], 'fall': ['negative', 'sadness'], 'fallacious': ['anger', 'negative'], 'fallacy': ['negative'], 'fallible': ['negative'], 'falling': ['negative', 'sadness'], 'fallow': ['negative'], 'falsehood': ['anger', 'negative', 'trust'], 'falsely': ['negative'], 'falsification': ['anger', 'negative'], 'falsify': ['disgust', 'negative'], 'falsity': ['disgust', 'negative'], 'falter': ['fear', 'negative'], 'fame': ['positive'], 'familiar': ['positive', 'trust'], 'familiarity': ['anticipation', 'joy', 'positive', 'trust'], 'famine': ['negative', 'sadness'], 'famous': ['positive'], 'famously': ['positive'], 'fanatic': ['negative'], 'fanaticism': ['fear'], 'fancy': ['anticipation', 'joy', 'positive'], 'fanfare': ['anticipation', 'joy', 'positive', 'surprise'], 'fang': ['fear'], 'fangs': ['fear'], 'farce': ['negative'], 'farcical': ['disgust', 'negative'], 'farm': ['anticipation'], 'fascinating': ['positive'], 'fascination': ['positive'], 'fashionable': ['positive'], 'fasting': ['negative', 'sadness'], 'fat': ['disgust', 'negative', 'sadness'], 'fatal': ['anger', 'fear', 'negative', 'sadness'], 'fatality': ['fear', 'negative', 'sadness'], 'fate': ['anticipation', 'negative'], 'father': ['trust'], 'fatigue': ['negative'], 'fatigued': ['negative', 'sadness'], 'fatty': ['disgust', 'negative', 'sadness'], 'fault': ['negative', 'sadness'], 'faultless': ['positive', 'trust'], 'faulty': ['negative'], 'favorable': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'favorite': ['joy', 'positive', 'trust'], 'favoritism': ['positive'], 'fawn': ['negative'], 'fear': ['anger', 'fear', 'negative'], 'fearful': ['fear', 'negative', 'sadness'], 'fearfully': ['fear', 'negative', 'sadness', 'surprise'], 'fearing': ['fear', 'negative'], 'fearless': ['fear', 'positive'], 'feat': ['anticipation', 'joy', 'positive', 'surprise'], 'feature': ['positive'], 'febrile': ['negative'], 'fecal': ['disgust', 'negative'], 'feces': ['disgust', 'negative'], 'fee': ['anger', 'negative'], 'feeble': ['negative', 'sadness'], 'feeling': ['anger', 'anticipation', 'disgust', 'fear', 'joy', 'negative', 'positive', 'sadness', 'surprise', 'trust'], 'feigned': ['negative'], 'felicity': ['joy', 'positive'], 'fell': ['negative', 'sadness'], 'fellow': ['positive', 'trust'], 'fellowship': ['positive'], 'felon': ['fear', 'negative'], 'felony': ['negative'], 'female': ['positive'], 'fenced': ['anger'], 'fender': ['trust'], 'ferment': ['anticipation', 'negative'], 'fermentation': ['anticipation'], 'ferocious': ['anger', 'disgust', 'fear', 'negative'], 'ferocity': ['anger', 'negative'], 'fertile': ['positive'], 'fervor': ['anger', 'joy', 'positive'], 'festival': ['anticipation', 'joy', 'positive', 'surprise'], 'festive': ['joy', 'positive'], 'fete': ['anticipation', 'joy', 'positive', 'surprise'], 'feud': ['anger', 'negative'], 'feudal': ['negative'], 'feudalism': ['anger', 'negative', 'sadness'], 'fever': ['fear'], 'feverish': ['negative'], 'fiasco': ['negative'], 'fib': ['anger', 'negative'], 'fickle': ['negative'], 'fictitious': ['negative'], 'fidelity': ['joy', 'positive', 'trust'], 'fiend': ['anger', 'disgust', 'fear', 'negative'], 'fierce': ['anger', 'disgust', 'fear', 'negative'], 'fiesta': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'fight': ['anger', 'fear', 'negative'], 'fighting': ['anger', 'negative'], 'filibuster': ['negative'], 'fill': ['trust'], 'filth': ['disgust', 'negative'], 'filthy': ['disgust', 'negative'], 'finally': ['anticipation', 'disgust', 'joy', 'positive', 'surprise', 'trust'], 'finery': ['positive'], 'finesse': ['positive'], 'fire': ['fear'], 'firearms': ['anger', 'fear', 'negative'], 'fireball': ['positive'], 'fireman': ['trust'], 'fireproof': ['positive'], 'firmness': ['positive', 'trust'], 'firstborn': ['anticipation', 'joy', 'positive', 'trust'], 'fits': ['anger', 'negative'], 'fitting': ['anticipation', 'joy', 'positive', 'trust'], 'fixed': ['trust'], 'fixture': ['positive'], 'flabby': ['disgust', 'negative'], 'flaccid': ['negative', 'sadness'], 'flagging': ['negative'], 'flagrant': ['anger', 'disgust', 'negative'], 'flagship': ['trust'], 'flake': ['negative'], 'flange': ['trust'], 'flap': ['negative'], 'flattering': ['joy', 'positive'], 'flatulence': ['disgust', 'negative'], 'flaunt': ['negative'], 'flaw': ['negative', 'sadness'], 'flea': ['disgust', 'negative'], 'fled': ['fear'], 'flee': ['fear', 'negative'], 'fleece': ['anger', 'disgust', 'negative', 'sadness'], 'fleet': ['positive'], 'flesh': ['disgust'], 'fleshy': ['negative'], 'flexibility': ['positive'], 'flinch': ['anticipation', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'flirt': ['anticipation', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'flog': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'flood': ['fear'], 'flop': ['disgust', 'negative', 'sadness'], 'floral': ['positive'], 'flounder': ['fear', 'negative', 'sadness'], 'flow': ['positive'], 'flowery': ['positive'], 'flu': ['fear', 'negative'], 'fluctuation': ['anger', 'fear', 'negative'], 'fluke': ['surprise'], 'flush': ['positive'], 'flying': ['fear', 'positive'], 'focus': ['positive'], 'foe': ['anger', 'fear', 'negative'], 'foiled': ['negative'], 'follower': ['trust'], 'folly': ['negative'], 'fondness': ['joy', 'positive'], 'food': ['joy', 'positive', 'trust'], 'fool': ['disgust', 'negative'], 'foolish': ['negative'], 'foolishness': ['negative'], 'football': ['anticipation', 'joy', 'positive'], 'footing': ['trust'], 'forage': ['negative'], 'foray': ['anger', 'negative'], 'forbearance': ['positive'], 'forbid': ['negative', 'sadness'], 'forbidding': ['anger', 'fear', 'negative'], 'force': ['anger', 'fear', 'negative'], 'forced': ['fear', 'negative'], 'forcibly': ['anger', 'fear', 'negative'], 'fore': ['positive'], 'forearm': ['anger', 'anticipation'], 'foreboding': ['anticipation', 'fear', 'negative'], 'forecast': ['anticipation', 'trust'], 'foreclose': ['fear', 'negative', 'sadness'], 'forefathers': ['joy', 'positive', 'trust'], 'forego': ['negative'], 'foregoing': ['positive'], 'foreign': ['negative'], 'foreigner': ['fear', 'negative'], 'foreman': ['positive'], 'forerunner': ['positive'], 'foresee': ['anticipation', 'positive', 'surprise', 'trust'], 'foreseen': ['anticipation', 'positive'], 'foresight': ['anticipation', 'positive', 'trust'], 'forewarned': ['anticipation', 'fear', 'negative'], 'forfeit': ['anger', 'negative', 'sadness'], 'forfeited': ['negative'], 'forfeiture': ['fear', 'negative', 'sadness'], 'forge': ['positive'], 'forgery': ['negative'], 'forget': ['negative'], 'forgive': ['positive'], 'forgiven': ['positive'], 'forgiving': ['positive', 'trust'], 'forgotten': ['fear', 'negative', 'sadness'], 'forlorn': ['negative', 'sadness'], 'formality': ['trust'], 'formative': ['positive', 'trust'], 'formidable': ['fear'], 'forming': ['anticipation'], 'formless': ['negative'], 'formula': ['positive', 'trust'], 'fornication': ['negative'], 'forsake': ['negative', 'sadness'], 'forsaken': ['anger', 'negative', 'sadness'], 'fort': ['trust'], 'forte': ['positive'], 'forthcoming': ['positive'], 'fortify': ['positive'], 'fortitude': ['joy', 'positive', 'trust'], 'fortress': ['fear', 'positive', 'sadness', 'trust'], 'fortunate': ['positive'], 'fortune': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'forward': ['positive'], 'foul': ['anger', 'disgust', 'fear', 'negative'], 'found': ['joy', 'positive', 'trust'], 'foundation': ['positive'], 'fracture': ['negative'], 'fragile': ['fear', 'negative', 'sadness'], 'fragrant': ['positive'], 'frailty': ['negative', 'sadness'], 'framework': ['trust'], 'frank': ['positive', 'trust'], 'frankness': ['positive', 'trust'], 'frantic': ['anticipation', 'disgust', 'fear', 'negative', 'surprise'], 'fraternal': ['joy', 'positive', 'trust'], 'fraud': ['anger', 'negative'], 'fraudulent': ['anger', 'disgust', 'negative'], 'fraught': ['fear', 'negative', 'sadness'], 'fray': ['negative'], 'frayed': ['negative', 'sadness'], 'freakish': ['disgust', 'fear', 'negative', 'surprise'], 'freedom': ['joy', 'positive', 'trust'], 'freely': ['joy', 'positive', 'trust'], 'freezing': ['negative'], 'frenetic': ['anger', 'fear', 'negative', 'surprise'], 'frenzied': ['anger', 'fear', 'negative'], 'frenzy': ['negative'], 'fret': ['fear', 'negative'], 'friction': ['anger'], 'friend': ['joy', 'positive', 'trust'], 'friendliness': ['joy', 'positive', 'trust'], 'friendly': ['anticipation', 'joy', 'positive', 'trust'], 'friendship': ['joy', 'positive', 'trust'], 'frigate': ['fear'], 'fright': ['fear', 'negative', 'surprise'], 'frighten': ['fear', 'negative', 'sadness', 'surprise'], 'frightened': ['fear', 'negative', 'surprise'], 'frightful': ['anger', 'fear', 'negative', 'sadness'], 'frigid': ['negative'], 'frisky': ['anticipation', 'joy', 'positive', 'surprise'], 'frivolous': ['negative'], 'frolic': ['joy', 'positive'], 'frostbite': ['negative'], 'froth': ['negative'], 'frown': ['negative', 'sadness'], 'frowning': ['anger', 'disgust', 'negative', 'sadness'], 'frugal': ['positive'], 'fruitful': ['positive'], 'fruitless': ['negative', 'sadness'], 'frustrate': ['anger', 'disgust', 'negative', 'sadness'], 'frustrated': ['anger', 'negative'], 'frustration': ['anger', 'negative'], 'fudge': ['negative'], 'fugitive': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'trust'], 'fulfill': ['joy', 'positive'], 'fulfillment': ['anticipation', 'joy', 'positive', 'trust'], 'full': ['positive'], 'fully': ['positive', 'trust'], 'fumble': ['negative'], 'fume': ['negative'], 'fuming': ['anger', 'negative'], 'fun': ['anticipation', 'joy', 'positive'], 'fundamental': ['positive', 'trust'], 'funeral': ['sadness'], 'fungus': ['disgust', 'negative'], 'funk': ['negative', 'sadness'], 'furious': ['anger', 'disgust', 'negative'], 'furiously': ['anger'], 'furnace': ['anger'], 'furor': ['anger', 'negative'], 'furrow': ['sadness'], 'fury': ['anger', 'fear', 'negative', 'sadness'], 'fuse': ['positive', 'trust'], 'fusion': ['positive'], 'fuss': ['anger', 'negative', 'sadness'], 'fussy': ['disgust', 'negative'], 'futile': ['negative', 'sadness'], 'futility': ['negative'], 'gaby': ['disgust', 'negative'], 'gag': ['disgust', 'negative'], 'gage': ['trust'], 'gain': ['anticipation', 'joy', 'positive'], 'gaining': ['positive'], 'gall': ['anger', 'disgust', 'negative'], 'gallant': ['positive'], 'gallantry': ['positive'], 'gallows': ['anger', 'fear', 'negative', 'sadness'], 'galore': ['positive'], 'gamble': ['negative'], 'gambler': ['anticipation', 'negative', 'surprise'], 'gambling': ['anticipation', 'negative', 'surprise'], 'gang': ['anger', 'fear', 'negative'], 'gaol': ['negative'], 'gap': ['negative'], 'gape': ['surprise'], 'garbage': ['disgust', 'negative'], 'garden': ['joy', 'positive'], 'garish': ['disgust', 'negative', 'surprise'], 'garnet': ['positive'], 'garnish': ['negative'], 'garrison': ['positive', 'trust'], 'gash': ['fear', 'negative'], 'gasp': ['surprise'], 'gasping': ['fear', 'negative'], 'gate': ['trust'], 'gateway': ['trust'], 'gauche': ['negative'], 'gauging': ['trust'], 'gaunt': ['negative'], 'gawk': ['surprise'], 'gazette': ['positive', 'trust'], 'gear': ['positive'], 'gelatin': ['disgust'], 'gem': ['joy', 'positive'], 'general': ['positive', 'trust'], 'generosity': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'generous': ['joy', 'positive', 'trust'], 'genial': ['joy', 'positive'], 'genius': ['positive'], 'gent': ['anger', 'disgust', 'fear', 'negative'], 'genteel': ['positive'], 'gentleman': ['positive', 'trust'], 'gentleness': ['positive'], 'gentry': ['positive', 'trust'], 'genuine': ['positive', 'trust'], 'geranium': ['positive'], 'geriatric': ['negative', 'sadness'], 'germ': ['anticipation', 'disgust'], 'germination': ['anticipation'], 'ghastly': ['disgust', 'fear', 'negative'], 'ghetto': ['disgust', 'fear', 'negative', 'sadness'], 'ghost': ['fear'], 'ghostly': ['fear', 'negative'], 'giant': ['fear'], 'gibberish': ['anger', 'negative'], 'gift': ['anticipation', 'joy', 'positive', 'surprise'], 'gifted': ['positive'], 'gigantic': ['positive'], 'giggle': ['joy', 'positive'], 'girder': ['positive', 'trust'], 'giving': ['positive'], 'glacial': ['negative'], 'glad': ['anticipation', 'joy', 'positive'], 'gladiator': ['fear'], 'gladness': ['joy', 'positive'], 'glare': ['anger', 'fear', 'negative'], 'glaring': ['anger', 'negative'], 'glee': ['joy', 'positive'], 'glib': ['negative'], 'glide': ['anticipation', 'joy', 'positive'], 'glimmer': ['anticipation', 'joy', 'positive', 'surprise'], 'glitter': ['disgust', 'joy'], 'glittering': ['positive'], 'gloom': ['negative', 'sadness'], 'gloomy': ['negative', 'sadness'], 'glorification': ['joy', 'positive'], 'glorify': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'glory': ['anticipation', 'joy', 'positive', 'trust'], 'gloss': ['positive'], 'glow': ['anticipation', 'joy', 'positive', 'trust'], 'glowing': ['positive'], 'glum': ['negative', 'sadness'], 'glut': ['disgust', 'negative'], 'gluttony': ['disgust', 'negative'], 'gnome': ['anger', 'disgust', 'fear', 'negative'], 'gob': ['disgust'], 'goblin': ['disgust', 'fear', 'negative'], 'god': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'godless': ['anger', 'negative'], 'godly': ['joy', 'positive', 'trust'], 'godsend': ['joy', 'positive', 'surprise'], 'gold': ['positive'], 'gonorrhea': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'goo': ['disgust', 'negative'], 'good': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'goodly': ['positive'], 'goodness': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'goods': ['positive'], 'goodwill': ['positive'], 'gore': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'gorge': ['disgust', 'negative'], 'gorgeous': ['joy', 'positive'], 'gorilla': ['negative'], 'gory': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'gospel': ['positive', 'trust'], 'gossip': ['negative'], 'gouge': ['negative'], 'gout': ['negative'], 'govern': ['positive', 'trust'], 'governess': ['trust'], 'government': ['fear', 'negative'], 'governor': ['trust'], 'grab': ['anger', 'negative'], 'grace': ['positive'], 'graceful': ['positive'], 'gracious': ['positive'], 'graciously': ['positive'], 'gradual': ['anticipation'], 'graduation': ['anticipation', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'grammar': ['trust'], 'grandchildren': ['anticipation', 'joy', 'positive', 'trust'], 'grandeur': ['positive'], 'grandfather': ['trust'], 'grandmother': ['positive'], 'grant': ['anticipation', 'joy', 'positive', 'trust'], 'granted': ['positive'], 'grasping': ['anticipation', 'negative'], 'grate': ['negative'], 'grated': ['anger', 'negative'], 'grateful': ['positive'], 'gratify': ['joy', 'positive', 'surprise'], 'grating': ['anger', 'disgust', 'negative'], 'gratitude': ['joy', 'positive'], 'gratuitous': ['disgust'], 'grave': ['fear', 'negative', 'sadness'], 'gravitate': ['anticipation'], 'gray': ['disgust', 'sadness'], 'greasy': ['disgust'], 'greater': ['positive'], 'greatness': ['joy', 'positive', 'surprise', 'trust'], 'greed': ['anger', 'disgust', 'negative'], 'greedy': ['disgust', 'negative'], 'green': ['joy', 'positive', 'trust'], 'greeting': ['positive', 'surprise'], 'gregarious': ['positive'], 'grenade': ['fear', 'negative'], 'grief': ['negative', 'sadness'], 'grievance': ['anger', 'disgust', 'negative', 'sadness'], 'grieve': ['fear', 'negative', 'sadness'], 'grievous': ['anger', 'fear', 'negative', 'sadness'], 'grim': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'grime': ['disgust', 'negative'], 'grimy': ['disgust', 'negative'], 'grin': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'grinding': ['negative'], 'grisly': ['disgust', 'fear', 'negative'], 'grist': ['positive'], 'grit': ['positive', 'trust'], 'grizzly': ['fear', 'negative'], 'groan': ['disgust', 'negative', 'sadness'], 'grope': ['anger', 'disgust', 'fear', 'negative'], 'gross': ['disgust', 'negative'], 'grotesque': ['disgust', 'negative'], 'ground': ['trust'], 'grounded': ['fear', 'negative', 'sadness'], 'groundless': ['negative'], 'groundwork': ['positive'], 'grow': ['anticipation', 'joy', 'positive', 'trust'], 'growl': ['anger', 'fear', 'negative'], 'growling': ['anger', 'disgust', 'fear', 'negative'], 'growth': ['positive'], 'grudge': ['anger', 'negative'], 'grudgingly': ['negative'], 'gruesome': ['disgust', 'negative'], 'gruff': ['anger', 'disgust', 'negative'], 'grumble': ['anger', 'disgust', 'negative'], 'grumpy': ['anger', 'disgust', 'negative', 'sadness'], 'guarantee': ['positive', 'trust'], 'guard': ['fear', 'positive', 'trust'], 'guarded': ['trust'], 'guardian': ['positive', 'trust'], 'guardianship': ['positive', 'trust'], 'gubernatorial': ['positive', 'trust'], 'guerilla': ['fear', 'negative'], 'guess': ['surprise'], 'guidance': ['positive', 'trust'], 'guide': ['positive', 'trust'], 'guidebook': ['positive', 'trust'], 'guile': ['negative'], 'guillotine': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'guilt': ['disgust', 'negative', 'sadness'], 'guilty': ['anger', 'negative', 'sadness'], 'guise': ['negative'], 'gull': ['negative'], 'gullible': ['negative', 'sadness', 'trust'], 'gulp': ['fear', 'surprise'], 'gun': ['anger', 'fear', 'negative'], 'gunpowder': ['fear'], 'guru': ['positive', 'trust'], 'gush': ['disgust', 'joy', 'negative'], 'gusset': ['trust'], 'gut': ['disgust'], 'guts': ['positive'], 'gutter': ['disgust'], 'guzzling': ['negative'], 'gymnast': ['positive'], 'gypsy': ['negative'], 'habitat': ['positive'], 'habitual': ['anticipation'], 'hag': ['disgust', 'fear', 'negative'], 'haggard': ['negative', 'sadness'], 'hail': ['negative', 'positive', 'trust'], 'hairy': ['disgust', 'negative'], 'hale': ['positive'], 'halfway': ['negative'], 'hallucination': ['fear', 'negative'], 'halter': ['anger', 'fear', 'negative', 'sadness'], 'halting': ['fear', 'negative', 'sadness'], 'hamper': ['negative'], 'hamstring': ['anger', 'negative', 'sadness'], 'handbook': ['trust'], 'handicap': ['negative', 'sadness'], 'handy': ['positive'], 'hanging': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'hangman': ['fear', 'negative'], 'hankering': ['anticipation'], 'hap': ['anticipation', 'surprise'], 'happen': ['anticipation'], 'happily': ['joy', 'positive'], 'happiness': ['anticipation', 'joy', 'positive'], 'happy': ['anticipation', 'joy', 'positive', 'trust'], 'harass': ['anger', 'disgust', 'negative'], 'harassing': ['anger'], 'harbinger': ['anger', 'anticipation', 'fear', 'negative'], 'harbor': ['trust'], 'hardened': ['anger', 'disgust', 'fear', 'negative'], 'hardness': ['negative'], 'hardship': ['negative', 'sadness'], 'hardy': ['joy', 'positive', 'trust'], 'harlot': ['disgust', 'negative'], 'harm': ['fear', 'negative'], 'harmful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'harmoniously': ['joy', 'positive', 'trust'], 'harmony': ['joy', 'positive', 'trust'], 'harrowing': ['fear', 'negative'], 'harry': ['anger', 'negative', 'sadness'], 'harshness': ['anger', 'fear', 'negative'], 'harvest': ['anticipation', 'joy', 'positive'], 'hash': ['negative'], 'hashish': ['negative'], 'haste': ['anticipation'], 'hasty': ['negative'], 'hate': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'hateful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'hating': ['anger', 'negative'], 'hatred': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'haughty': ['anger', 'negative'], 'haunt': ['fear', 'negative'], 'haunted': ['fear', 'negative', 'sadness'], 'haven': ['positive', 'trust'], 'havoc': ['anger', 'fear', 'negative'], 'hawk': ['fear'], 'hazard': ['fear', 'negative'], 'hazardous': ['fear', 'negative'], 'haze': ['fear', 'negative'], 'headache': ['negative'], 'headlight': ['anticipation'], 'headway': ['positive'], 'heady': ['negative'], 'heal': ['joy', 'positive', 'trust'], 'healing': ['anticipation', 'joy', 'positive', 'trust'], 'healthful': ['joy', 'positive'], 'healthy': ['positive'], 'hearing': ['fear', 'negative'], 'hearsay': ['negative'], 'hearse': ['fear', 'negative', 'sadness'], 'heartache': ['negative', 'sadness'], 'heartburn': ['negative'], 'heartfelt': ['joy', 'positive', 'sadness', 'trust'], 'hearth': ['positive'], 'heartily': ['joy', 'positive'], 'heartless': ['negative', 'sadness'], 'heartworm': ['disgust'], 'heathen': ['fear', 'negative'], 'heavenly': ['anticipation', 'joy', 'positive', 'trust'], 'heavens': ['joy', 'positive', 'trust'], 'heavily': ['negative'], 'hedonism': ['joy', 'negative', 'positive'], 'heel': ['negative'], 'heft': ['anticipation', 'fear', 'positive'], 'heighten': ['fear', 'negative'], 'heinous': ['negative'], 'hell': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'hellish': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'helmet': ['fear', 'positive'], 'helper': ['positive', 'trust'], 'helpful': ['joy', 'positive', 'trust'], 'helpless': ['fear', 'negative', 'sadness'], 'helplessness': ['fear', 'negative', 'sadness'], 'hemorrhage': ['disgust', 'fear', 'negative', 'sadness'], 'hemorrhoids': ['negative'], 'herbal': ['positive'], 'heresy': ['negative'], 'heretic': ['disgust', 'negative'], 'heritage': ['trust'], 'hermaphrodite': ['negative', 'surprise'], 'hermit': ['sadness', 'trust'], 'hero': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'heroic': ['joy', 'positive', 'surprise', 'trust'], 'heroics': ['positive'], 'heroin': ['negative'], 'heroine': ['positive', 'trust'], 'heroism': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'herpes': ['disgust', 'negative'], 'herpesvirus': ['disgust', 'negative'], 'hesitation': ['fear', 'negative'], 'heyday': ['anticipation', 'joy', 'positive', 'trust'], 'hidden': ['negative'], 'hide': ['fear'], 'hideous': ['disgust', 'fear', 'negative', 'sadness'], 'hiding': ['fear'], 'highest': ['anticipation', 'fear', 'joy', 'negative', 'positive', 'surprise'], 'hilarious': ['joy', 'positive', 'surprise'], 'hilarity': ['joy', 'positive'], 'hindering': ['negative', 'sadness'], 'hindrance': ['negative'], 'hippie': ['negative'], 'hire': ['anticipation', 'joy', 'positive', 'trust'], 'hiss': ['anger', 'fear', 'negative'], 'hissing': ['negative'], 'hit': ['anger', 'negative'], 'hitherto': ['negative'], 'hive': ['negative'], 'hoarse': ['negative'], 'hoary': ['negative', 'sadness'], 'hoax': ['anger', 'disgust', 'negative', 'sadness', 'surprise'], 'hobby': ['joy', 'positive'], 'hobo': ['negative', 'sadness'], 'hog': ['disgust', 'negative'], 'holiday': ['anticipation', 'joy', 'positive'], 'holiness': ['anticipation', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'hollow': ['negative', 'sadness'], 'holocaust': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'holy': ['positive'], 'homage': ['positive'], 'homeless': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'homesick': ['negative', 'sadness'], 'homework': ['fear'], 'homicidal': ['anger', 'fear', 'negative'], 'homicide': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'homology': ['positive'], 'homosexuality': ['negative'], 'honest': ['anger', 'disgust', 'fear', 'joy', 'positive', 'sadness', 'trust'], 'honesty': ['positive', 'trust'], 'honey': ['positive'], 'honeymoon': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'honor': ['positive', 'trust'], 'honorable': ['positive', 'trust'], 'hood': ['anger', 'disgust', 'fear', 'negative'], 'hooded': ['fear'], 'hooked': ['negative'], 'hoot': ['anger', 'disgust', 'negative'], 'hope': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'hopeful': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'hopeless': ['fear', 'negative', 'sadness'], 'hopelessness': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'horde': ['negative', 'surprise'], 'horizon': ['anticipation', 'positive'], 'horoscope': ['anticipation'], 'horrible': ['anger', 'disgust', 'fear', 'negative'], 'horribly': ['negative'], 'horrid': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'horrific': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'horrified': ['fear', 'negative'], 'horrifying': ['disgust', 'fear', 'negative', 'sadness'], 'horror': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'horrors': ['fear', 'negative', 'sadness'], 'horse': ['trust'], 'hospice': ['sadness'], 'hospital': ['fear', 'sadness', 'trust'], 'hospitality': ['positive'], 'hostage': ['anger', 'fear', 'negative'], 'hostile': ['anger', 'disgust', 'fear', 'negative'], 'hostilities': ['anger', 'fear', 'negative'], 'hostility': ['anger', 'disgust', 'negative'], 'hot': ['anger'], 'household': ['positive'], 'housekeeping': ['positive'], 'howl': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'huff': ['anger', 'disgust', 'negative'], 'hug': ['joy', 'positive', 'trust'], 'hulk': ['disgust'], 'humane': ['positive'], 'humanitarian': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'humanity': ['joy', 'positive', 'trust'], 'humble': ['disgust', 'negative', 'positive', 'sadness'], 'humbled': ['positive', 'sadness'], 'humbly': ['positive'], 'humbug': ['anger', 'disgust', 'negative', 'sadness'], 'humiliate': ['anger', 'negative', 'sadness'], 'humiliating': ['disgust', 'negative'], 'humiliation': ['disgust', 'negative', 'sadness'], 'humility': ['positive', 'trust'], 'humorist': ['positive'], 'humorous': ['joy', 'positive'], 'hunch': ['negative'], 'hungry': ['anticipation', 'negative'], 'hunter': ['anticipation', 'fear', 'negative', 'sadness'], 'hunting': ['anger', 'anticipation', 'fear', 'negative'], 'hurrah': ['joy', 'positive'], 'hurricane': ['fear', 'negative'], 'hurried': ['anticipation', 'negative'], 'hurry': ['anticipation'], 'hurt': ['anger', 'fear', 'negative', 'sadness'], 'hurtful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'hurting': ['anger', 'fear', 'negative', 'sadness'], 'husbandry': ['positive', 'trust'], 'hush': ['positive'], 'hustler': ['negative'], 'hut': ['positive', 'sadness'], 'hydra': ['fear', 'negative'], 'hydrocephalus': ['disgust', 'fear', 'negative', 'sadness'], 'hygienic': ['positive'], 'hymn': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'hype': ['anticipation', 'negative'], 'hyperbole': ['negative'], 'hypertrophy': ['disgust', 'fear', 'surprise'], 'hypocrisy': ['negative'], 'hypocrite': ['disgust', 'negative'], 'hypocritical': ['disgust', 'negative'], 'hypothesis': ['anticipation', 'surprise'], 'hysteria': ['fear', 'negative'], 'hysterical': ['anger', 'fear', 'negative'], 'idealism': ['positive'], 'idiocy': ['anger', 'disgust', 'negative', 'sadness'], 'idiot': ['disgust', 'negative'], 'idiotic': ['anger', 'disgust', 'negative'], 'idler': ['negative'], 'idol': ['positive'], 'idolatry': ['disgust', 'fear', 'negative'], 'ignorance': ['negative'], 'ignorant': ['disgust', 'negative'], 'ignore': ['negative'], 'ill': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'illegal': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'illegality': ['anger', 'disgust', 'fear', 'negative'], 'illegible': ['negative'], 'illegitimate': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'illicit': ['anger', 'disgust', 'fear', 'negative'], 'illiterate': ['disgust', 'negative'], 'illness': ['fear', 'negative', 'sadness'], 'illogical': ['negative'], 'illuminate': ['anticipation', 'joy', 'positive', 'surprise'], 'illumination': ['joy', 'positive', 'surprise', 'trust'], 'illusion': ['negative', 'surprise'], 'illustrate': ['positive'], 'illustrious': ['positive'], 'imaginative': ['positive'], 'imitated': ['negative'], 'imitation': ['negative'], 'immaculate': ['joy', 'positive', 'trust'], 'immature': ['anticipation', 'negative'], 'immaturity': ['anger', 'anticipation', 'negative'], 'immediacy': ['surprise'], 'immediately': ['anticipation', 'negative', 'positive'], 'immense': ['positive'], 'immerse': ['anticipation', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'immigrant': ['fear'], 'imminent': ['anticipation', 'fear'], 'immoral': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'immorality': ['anger', 'disgust', 'negative'], 'immortal': ['positive'], 'immortality': ['anticipation'], 'immovable': ['negative', 'positive', 'trust'], 'immunization': ['trust'], 'impair': ['negative'], 'impairment': ['negative'], 'impart': ['positive', 'trust'], 'impartial': ['positive', 'trust'], 'impartiality': ['positive', 'trust'], 'impassable': ['negative'], 'impatience': ['negative'], 'impatient': ['anticipation', 'negative'], 'impeach': ['disgust', 'fear', 'negative'], 'impeachment': ['negative'], 'impeccable': ['positive', 'trust'], 'impede': ['negative'], 'impending': ['anticipation', 'fear'], 'impenetrable': ['trust'], 'imperfection': ['negative'], 'imperfectly': ['negative'], 'impermeable': ['anger', 'fear'], 'impersonate': ['negative'], 'impersonation': ['negative'], 'impervious': ['positive'], 'implacable': ['negative'], 'implicate': ['anger', 'negative'], 'impolite': ['disgust', 'negative'], 'importance': ['anticipation', 'positive'], 'important': ['positive', 'trust'], 'imposition': ['negative'], 'impossible': ['negative', 'sadness'], 'impotence': ['anger', 'fear', 'negative', 'sadness'], 'impotent': ['negative'], 'impound': ['negative'], 'impracticable': ['negative'], 'impress': ['positive'], 'impression': ['positive'], 'impressionable': ['trust'], 'imprison': ['negative'], 'imprisoned': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'imprisonment': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'impropriety': ['negative'], 'improve': ['anticipation', 'joy', 'positive', 'trust'], 'improved': ['positive'], 'improvement': ['joy', 'positive', 'trust'], 'improving': ['positive'], 'improvisation': ['surprise'], 'improvise': ['anticipation', 'positive', 'surprise'], 'imprudent': ['negative', 'sadness'], 'impure': ['disgust', 'negative'], 'impurity': ['disgust', 'negative'], 'imputation': ['negative'], 'inability': ['negative', 'sadness'], 'inaccessible': ['negative'], 'inaccurate': ['negative'], 'inaction': ['negative'], 'inactivity': ['negative'], 'inadequacy': ['negative'], 'inadequate': ['negative', 'sadness'], 'inadmissible': ['anger', 'disgust', 'negative'], 'inalienable': ['positive'], 'inane': ['negative'], 'inapplicable': ['negative'], 'inappropriate': ['anger', 'disgust', 'negative', 'sadness'], 'inattention': ['anger', 'negative'], 'inaudible': ['negative'], 'inaugural': ['anticipation'], 'inauguration': ['anticipation', 'joy', 'positive', 'trust'], 'incalculable': ['negative'], 'incapacity': ['negative'], 'incarceration': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'incase': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'incendiary': ['anger', 'fear', 'negative', 'surprise'], 'incense': ['anger', 'negative'], 'incessant': ['negative'], 'incest': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'incestuous': ['disgust', 'negative'], 'incident': ['surprise'], 'incineration': ['negative'], 'incisive': ['positive'], 'incite': ['anger', 'anticipation', 'fear', 'negative'], 'inclement': ['negative'], 'incline': ['trust'], 'include': ['positive'], 'included': ['positive'], 'including': ['positive'], 'inclusion': ['trust'], 'inclusive': ['positive'], 'incoherent': ['negative'], 'income': ['anticipation', 'joy', 'negative', 'positive', 'sadness', 'trust'], 'incompatible': ['anger', 'disgust', 'negative', 'sadness'], 'incompetence': ['negative'], 'incompetent': ['anger', 'negative', 'sadness'], 'incompleteness': ['negative'], 'incomprehensible': ['negative'], 'incongruous': ['anger', 'negative'], 'inconsequential': ['negative', 'sadness'], 'inconsiderate': ['anger', 'disgust', 'negative', 'sadness'], 'inconsistency': ['negative'], 'incontinence': ['surprise'], 'inconvenient': ['anger', 'disgust', 'negative', 'sadness'], 'incorrect': ['negative'], 'increase': ['positive'], 'incredulous': ['anger', 'disgust', 'negative'], 'incrimination': ['fear', 'negative', 'sadness'], 'incubus': ['disgust', 'fear', 'negative'], 'incur': ['negative'], 'incurable': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'incursion': ['fear', 'negative'], 'indecency': ['anger', 'disgust'], 'indecent': ['disgust', 'negative'], 'indecision': ['negative'], 'indecisive': ['negative'], 'indefensible': ['fear', 'negative'], 'indelible': ['positive', 'trust'], 'indemnify': ['negative'], 'indemnity': ['positive', 'trust'], 'indent': ['trust'], 'indenture': ['anger', 'negative'], 'independence': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'indestructible': ['positive', 'trust'], 'indeterminate': ['negative'], 'indict': ['anger', 'fear', 'negative'], 'indictment': ['fear', 'negative'], 'indifference': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'indigent': ['negative', 'sadness'], 'indignant': ['anger', 'negative'], 'indignation': ['anger', 'disgust', 'negative'], 'indistinct': ['negative'], 'individuality': ['positive'], 'indivisible': ['trust'], 'indoctrination': ['anger', 'fear', 'negative'], 'indolent': ['negative'], 'indomitable': ['fear', 'positive'], 'ineffable': ['positive'], 'ineffective': ['negative'], 'ineffectual': ['disgust', 'negative'], 'inefficiency': ['disgust', 'negative', 'sadness'], 'inefficient': ['negative', 'sadness'], 'inept': ['anger', 'disgust', 'negative'], 'ineptitude': ['disgust', 'fear', 'negative', 'sadness'], 'inequality': ['anger', 'fear', 'negative', 'sadness'], 'inequitable': ['negative'], 'inert': ['negative'], 'inexcusable': ['anger', 'disgust', 'negative', 'sadness'], 'inexpensive': ['positive'], 'inexperience': ['negative'], 'inexperienced': ['negative'], 'inexplicable': ['negative', 'surprise'], 'infallibility': ['trust'], 'infallible': ['positive'], 'infamous': ['anger', 'disgust', 'fear', 'negative'], 'infamy': ['negative', 'sadness'], 'infant': ['anticipation', 'fear', 'joy', 'positive', 'surprise'], 'infanticide': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'infantile': ['anger', 'disgust', 'negative'], 'infarct': ['fear', 'negative', 'surprise'], 'infect': ['disgust', 'negative'], 'infection': ['fear', 'negative'], 'infectious': ['disgust', 'fear', 'negative', 'sadness'], 'inferior': ['negative', 'sadness'], 'inferiority': ['negative'], 'inferno': ['anger', 'fear', 'negative'], 'infertility': ['negative', 'sadness'], 'infestation': ['disgust', 'fear', 'negative'], 'infidel': ['anger', 'disgust', 'fear', 'negative'], 'infidelity': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'infiltration': ['negative', 'positive'], 'infinite': ['positive'], 'infinity': ['anticipation', 'joy', 'positive', 'trust'], 'infirm': ['negative'], 'infirmity': ['fear', 'negative'], 'inflammation': ['negative'], 'inflated': ['negative'], 'inflation': ['fear', 'negative'], 'inflict': ['anger', 'fear', 'negative', 'sadness'], 'infliction': ['fear', 'negative', 'sadness'], 'influence': ['negative', 'positive'], 'influential': ['positive', 'trust'], 'influenza': ['negative'], 'inform': ['trust'], 'information': ['positive'], 'informer': ['negative'], 'infraction': ['anger', 'negative'], 'infrequent': ['surprise'], 'infrequently': ['negative'], 'infringement': ['negative'], 'ingenious': ['positive'], 'inheritance': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'inhibit': ['anger', 'disgust', 'negative', 'sadness'], 'inhospitable': ['negative', 'sadness'], 'inhuman': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'inhumanity': ['negative', 'sadness'], 'inimical': ['anger', 'negative', 'sadness'], 'inimitable': ['positive', 'trust'], 'iniquity': ['disgust', 'negative'], 'injection': ['fear'], 'injunction': ['negative'], 'injure': ['anger', 'fear', 'negative', 'sadness'], 'injured': ['fear', 'negative', 'sadness'], 'injurious': ['anger', 'fear', 'negative', 'sadness'], 'injury': ['anger', 'fear', 'negative', 'sadness'], 'injustice': ['anger', 'negative'], 'inmate': ['disgust', 'fear', 'negative'], 'innocence': ['positive'], 'innocent': ['positive', 'trust'], 'innocently': ['positive'], 'innocuous': ['positive'], 'innovate': ['positive'], 'innovation': ['positive'], 'inoculation': ['anticipation', 'trust'], 'inoperative': ['anger', 'negative'], 'inquirer': ['positive'], 'inquiry': ['anticipation', 'positive'], 'inquisitive': ['positive'], 'insane': ['anger', 'fear', 'negative'], 'insanity': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'insecure': ['anger', 'fear', 'negative', 'sadness'], 'insecurity': ['fear', 'negative'], 'inseparable': ['joy', 'positive', 'trust'], 'insidious': ['anger', 'disgust', 'fear', 'negative'], 'insignia': ['positive'], 'insignificance': ['negative'], 'insignificant': ['anger', 'negative', 'sadness'], 'insipid': ['negative'], 'insolent': ['negative'], 'insolvency': ['fear', 'negative', 'sadness', 'surprise'], 'insolvent': ['fear', 'negative', 'sadness', 'trust'], 'inspector': ['positive'], 'inspiration': ['anticipation', 'joy', 'positive'], 'inspire': ['anticipation', 'joy', 'positive', 'trust'], 'inspired': ['joy', 'positive', 'surprise', 'trust'], 'instability': ['disgust', 'fear', 'negative'], 'install': ['anticipation'], 'instigate': ['negative'], 'instigation': ['negative'], 'instinctive': ['anger', 'disgust', 'fear', 'positive'], 'institute': ['trust'], 'instruct': ['positive', 'trust'], 'instruction': ['positive', 'trust'], 'instructions': ['anticipation', 'trust'], 'instructor': ['anticipation', 'positive', 'trust'], 'instrumental': ['positive'], 'insufficiency': ['anger', 'negative'], 'insufficient': ['negative'], 'insufficiently': ['negative'], 'insulation': ['trust'], 'insult': ['anger', 'disgust', 'negative', 'sadness', 'surprise'], 'insulting': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'insure': ['positive', 'trust'], 'insurgent': ['negative'], 'insurmountable': ['fear', 'negative', 'sadness'], 'insurrection': ['anger', 'negative'], 'intact': ['positive', 'trust'], 'integrity': ['positive', 'trust'], 'intellect': ['positive'], 'intellectual': ['positive'], 'intelligence': ['fear', 'joy', 'positive', 'trust'], 'intelligent': ['positive', 'trust'], 'intend': ['trust'], 'intended': ['anticipation', 'positive'], 'intense': ['anger', 'disgust', 'fear', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'inter': ['negative', 'sadness'], 'intercede': ['fear', 'sadness'], 'intercession': ['trust'], 'intercourse': ['positive'], 'interdiction': ['negative'], 'interest': ['positive'], 'interested': ['disgust', 'positive', 'sadness'], 'interesting': ['positive'], 'interference': ['negative'], 'interim': ['anticipation'], 'interior': ['disgust', 'positive', 'trust'], 'interlocutory': ['positive'], 'interlude': ['positive'], 'interment': ['negative', 'sadness'], 'interminable': ['anger', 'anticipation', 'negative', 'positive'], 'intermission': ['anticipation'], 'interrogate': ['fear'], 'interrogation': ['fear'], 'interrupt': ['anger', 'negative', 'surprise'], 'interrupted': ['negative', 'sadness'], 'intervention': ['negative', 'positive', 'sadness'], 'interviewer': ['fear'], 'intestate': ['negative'], 'intestinal': ['disgust'], 'intimate': ['anticipation', 'joy', 'positive', 'trust'], 'intimately': ['anticipation', 'fear', 'joy'], 'intimidate': ['fear', 'negative'], 'intimidation': ['anger', 'fear', 'negative'], 'intolerable': ['anger', 'negative'], 'intolerance': ['anger', 'disgust', 'fear', 'negative'], 'intolerant': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'intonation': ['positive'], 'intoxicated': ['disgust', 'negative'], 'intractable': ['anger', 'negative'], 'intrepid': ['positive'], 'intrigue': ['anticipation', 'fear', 'negative', 'surprise'], 'intruder': ['anger', 'fear', 'negative', 'surprise'], 'intrusion': ['fear', 'negative'], 'intrusive': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'intuition': ['positive', 'trust'], 'intuitive': ['positive'], 'intuitively': ['anticipation'], 'invade': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'invader': ['anger', 'fear', 'negative', 'sadness'], 'invalid': ['sadness'], 'invalidate': ['negative'], 'invalidation': ['negative'], 'invalidity': ['negative'], 'invariably': ['positive'], 'invasion': ['anger', 'negative'], 'inventive': ['positive'], 'inventor': ['positive'], 'investigate': ['positive'], 'investigation': ['anticipation'], 'invigorate': ['positive'], 'invitation': ['anticipation', 'positive'], 'invite': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'inviting': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'invocation': ['anticipation', 'trust'], 'invoke': ['anticipation'], 'involuntary': ['negative'], 'involution': ['anger', 'negative'], 'involvement': ['anger'], 'irate': ['anger', 'negative'], 'ire': ['anger', 'negative'], 'iris': ['fear'], 'iron': ['positive', 'trust'], 'irons': ['negative'], 'irrational': ['disgust', 'fear', 'negative'], 'irrationality': ['negative'], 'irreconcilable': ['anger', 'fear', 'negative', 'sadness'], 'irreducible': ['positive'], 'irrefutable': ['positive', 'trust'], 'irregular': ['negative'], 'irregularity': ['negative'], 'irrelevant': ['negative'], 'irreparable': ['fear', 'negative', 'sadness'], 'irresponsible': ['negative'], 'irreverent': ['negative'], 'irrevocable': ['negative'], 'irritability': ['anger', 'negative'], 'irritable': ['anger', 'negative'], 'irritating': ['anger', 'disgust', 'negative'], 'irritation': ['anger', 'disgust', 'negative', 'sadness'], 'isolate': ['sadness'], 'isolated': ['fear', 'negative', 'sadness'], 'isolation': ['negative', 'sadness'], 'jab': ['anger'], 'jabber': ['negative'], 'jackpot': ['anticipation', 'joy', 'positive', 'surprise'], 'jail': ['fear', 'negative', 'sadness'], 'jam': ['positive'], 'janitor': ['disgust'], 'jargon': ['negative'], 'jarring': ['fear', 'negative', 'sadness'], 'jaundice': ['fear', 'negative'], 'jaws': ['fear'], 'jealous': ['anger', 'disgust', 'negative'], 'jealousy': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'jeopardize': ['anger', 'fear', 'negative'], 'jeopardy': ['anticipation', 'fear', 'negative'], 'jerk': ['anger', 'surprise'], 'jest': ['joy', 'positive', 'surprise'], 'job': ['positive'], 'john': ['disgust', 'negative'], 'join': ['positive'], 'joined': ['positive'], 'joke': ['negative'], 'joker': ['joy', 'positive', 'surprise'], 'joking': ['positive'], 'jolt': ['surprise'], 'jornada': ['negative'], 'journalism': ['trust'], 'journalist': ['positive'], 'journey': ['anticipation', 'fear', 'joy', 'positive'], 'journeyman': ['trust'], 'jovial': ['joy', 'positive'], 'joy': ['joy', 'positive'], 'joyful': ['joy', 'positive', 'trust'], 'joyous': ['joy', 'positive'], 'jubilant': ['joy', 'positive', 'surprise', 'trust'], 'jubilee': ['joy', 'positive', 'surprise'], 'judgment': ['surprise'], 'judicial': ['anticipation', 'positive', 'trust'], 'judiciary': ['anticipation', 'trust'], 'judicious': ['positive', 'trust'], 'jumble': ['negative'], 'jump': ['joy', 'positive'], 'jungle': ['fear'], 'junk': ['negative'], 'junta': ['negative'], 'jurisprudence': ['sadness'], 'jurist': ['trust'], 'jury': ['trust'], 'justice': ['positive', 'trust'], 'justifiable': ['positive', 'trust'], 'justification': ['positive'], 'juvenile': ['negative'], 'keepsake': ['positive'], 'ken': ['positive'], 'kennel': ['sadness'], 'kern': ['negative'], 'kerosene': ['fear'], 'keynote': ['positive'], 'keystone': ['positive'], 'khan': ['fear', 'trust'], 'kick': ['anger', 'negative'], 'kicking': ['anger'], 'kidnap': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'kill': ['fear', 'negative', 'sadness'], 'killing': ['anger', 'fear', 'negative', 'sadness'], 'kind': ['joy', 'positive', 'trust'], 'kindness': ['positive'], 'kindred': ['anticipation', 'joy', 'positive', 'trust'], 'king': ['positive'], 'kiss': ['anticipation', 'joy', 'positive', 'surprise'], 'kite': ['disgust', 'negative'], 'kitten': ['joy', 'positive', 'trust'], 'knack': ['positive'], 'knell': ['fear', 'negative', 'sadness'], 'knickers': ['trust'], 'knight': ['positive'], 'knotted': ['negative'], 'knowing': ['positive'], 'knowledge': ['positive'], 'kudos': ['joy', 'positive'], 'label': ['trust'], 'labor': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'labored': ['negative', 'sadness'], 'laborious': ['negative'], 'labyrinth': ['anticipation', 'negative'], 'lace': ['anger', 'fear', 'negative', 'positive', 'sadness', 'trust'], 'lack': ['negative'], 'lacking': ['negative'], 'lackluster': ['negative'], 'laden': ['negative'], 'lag': ['negative'], 'lagging': ['anger', 'anticipation', 'disgust', 'negative', 'sadness'], 'lair': ['negative'], 'lamb': ['joy', 'positive', 'trust'], 'lament': ['disgust', 'fear', 'negative', 'sadness'], 'lamenting': ['sadness'], 'land': ['positive'], 'landed': ['positive'], 'landmark': ['trust'], 'landslide': ['fear', 'negative', 'sadness'], 'languid': ['negative'], 'languish': ['negative'], 'languishing': ['fear', 'negative', 'sadness'], 'lapse': ['negative'], 'larceny': ['disgust', 'negative'], 'larger': ['disgust', 'surprise', 'trust'], 'laser': ['positive', 'trust'], 'lash': ['anger', 'fear', 'negative'], 'late': ['negative', 'sadness'], 'lateness': ['negative'], 'latent': ['anger', 'anticipation', 'disgust', 'negative', 'surprise'], 'latrines': ['disgust', 'negative'], 'laudable': ['positive'], 'laugh': ['joy', 'positive', 'surprise'], 'laughable': ['disgust', 'negative'], 'laughing': ['joy', 'positive'], 'laughter': ['anticipation', 'joy', 'positive', 'surprise'], 'launch': ['anticipation', 'positive'], 'laureate': ['positive', 'trust'], 'laurel': ['positive'], 'laurels': ['joy', 'positive'], 'lava': ['anger', 'fear', 'negative'], 'lavatory': ['disgust'], 'lavish': ['positive'], 'law': ['trust'], 'lawful': ['positive', 'trust'], 'lawlessness': ['anger', 'fear', 'negative'], 'lawsuit': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'lawyer': ['anger', 'disgust', 'fear', 'negative'], 'lax': ['negative', 'sadness'], 'laxative': ['disgust', 'fear', 'negative'], 'lazy': ['negative'], 'lead': ['positive'], 'leader': ['positive', 'trust'], 'leading': ['trust'], 'league': ['positive'], 'leak': ['negative'], 'leakage': ['negative'], 'leaky': ['negative'], 'leaning': ['trust'], 'learn': ['positive'], 'learning': ['positive'], 'leave': ['negative', 'sadness', 'surprise'], 'lecturer': ['positive'], 'leech': ['negative'], 'leeches': ['disgust', 'fear', 'negative'], 'leer': ['disgust', 'negative'], 'leery': ['surprise'], 'leeway': ['positive'], 'legal': ['positive', 'trust'], 'legalized': ['anger', 'fear', 'joy', 'positive', 'trust'], 'legendary': ['positive'], 'legibility': ['positive'], 'legible': ['positive'], 'legislator': ['trust'], 'legislature': ['trust'], 'legitimacy': ['trust'], 'leisure': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'leisurely': ['positive'], 'lemma': ['positive'], 'lemon': ['disgust', 'negative'], 'lender': ['trust'], 'lenient': ['positive'], 'leprosy': ['disgust', 'fear', 'negative', 'sadness'], 'lesbian': ['disgust', 'negative', 'sadness'], 'lessen': ['anticipation', 'negative'], 'lesser': ['disgust', 'negative'], 'lesson': ['anticipation', 'positive', 'trust'], 'lethal': ['disgust', 'fear', 'negative', 'sadness'], 'lethargy': ['negative', 'sadness'], 'letter': ['anticipation'], 'lettered': ['anticipation', 'positive', 'trust'], 'leukemia': ['anger', 'fear', 'negative', 'sadness'], 'levee': ['trust'], 'level': ['positive', 'trust'], 'leverage': ['positive'], 'levy': ['negative'], 'lewd': ['disgust', 'negative'], 'liaison': ['negative'], 'liar': ['disgust', 'negative'], 'libel': ['anger', 'fear', 'negative', 'trust'], 'liberal': ['negative', 'positive'], 'liberate': ['anger', 'anticipation', 'joy', 'positive', 'surprise', 'trust'], 'liberation': ['anticipation', 'joy', 'positive', 'surprise'], 'liberty': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'library': ['positive'], 'lick': ['disgust', 'negative'], 'lie': ['anger', 'disgust', 'negative', 'sadness'], 'lieutenant': ['trust'], 'lifeblood': ['positive'], 'lifeless': ['fear', 'negative', 'sadness'], 'lighthouse': ['positive'], 'lightning': ['anger', 'fear', 'surprise'], 'liking': ['joy', 'positive', 'trust'], 'limited': ['anger', 'negative', 'sadness'], 'limp': ['negative'], 'lines': ['fear'], 'linger': ['anticipation'], 'linguist': ['positive', 'trust'], 'lint': ['negative'], 'lion': ['fear', 'positive'], 'liquor': ['anger', 'joy', 'negative', 'sadness'], 'listless': ['negative', 'sadness'], 'lithe': ['positive'], 'litigant': ['negative'], 'litigate': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'litigation': ['negative'], 'litigious': ['anger', 'disgust', 'negative'], 'litter': ['negative'], 'livid': ['anger', 'disgust', 'negative'], 'loaf': ['negative'], 'loafer': ['negative'], 'loath': ['anger', 'negative'], 'loathe': ['anger', 'disgust', 'negative'], 'loathing': ['disgust', 'negative'], 'loathsome': ['anger', 'disgust', 'negative'], 'lobbyist': ['negative'], 'localize': ['anticipation'], 'lockup': ['fear', 'negative', 'sadness'], 'locust': ['fear', 'negative'], 'lodging': ['trust'], 'lofty': ['negative'], 'logical': ['positive'], 'lone': ['sadness'], 'loneliness': ['fear', 'negative', 'sadness'], 'lonely': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'lonesome': ['negative', 'sadness'], 'long': ['anticipation'], 'longevity': ['positive'], 'longing': ['anticipation', 'sadness'], 'loo': ['disgust', 'negative'], 'loom': ['anticipation', 'fear', 'negative'], 'loon': ['disgust', 'negative'], 'loony': ['negative'], 'loot': ['negative'], 'lord': ['disgust', 'negative', 'positive', 'trust'], 'lordship': ['positive'], 'lose': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'losing': ['anger', 'negative', 'sadness'], 'loss': ['anger', 'fear', 'negative', 'sadness'], 'lost': ['negative', 'sadness'], 'lottery': ['anticipation'], 'loudness': ['anger', 'negative'], 'lounge': ['negative'], 'louse': ['disgust', 'negative'], 'lovable': ['joy', 'positive', 'trust'], 'love': ['joy', 'positive'], 'lovely': ['anticipation', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'lovemaking': ['joy', 'positive', 'trust'], 'lover': ['anticipation', 'joy', 'positive', 'trust'], 'loving': ['joy', 'positive', 'trust'], 'lower': ['negative', 'sadness'], 'lowering': ['negative'], 'lowest': ['negative', 'sadness'], 'lowlands': ['negative'], 'lowly': ['negative', 'sadness'], 'loyal': ['fear', 'joy', 'positive', 'surprise', 'trust'], 'loyalty': ['positive', 'trust'], 'luck': ['anticipation', 'joy', 'positive', 'surprise'], 'lucky': ['joy', 'positive', 'surprise'], 'ludicrous': ['negative'], 'lull': ['anticipation'], 'lumbering': ['negative'], 'lump': ['negative'], 'lumpy': ['disgust', 'negative'], 'lunacy': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'lunatic': ['anger', 'disgust', 'fear', 'negative'], 'lunge': ['surprise'], 'lurch': ['negative'], 'lure': ['negative'], 'lurid': ['disgust', 'negative'], 'lurk': ['negative'], 'lurking': ['negative'], 'luscious': ['anticipation', 'joy', 'positive'], 'lush': ['disgust', 'negative', 'sadness'], 'lust': ['anticipation', 'negative'], 'luster': ['joy', 'positive'], 'lustful': ['negative'], 'lustrous': ['positive'], 'lusty': ['disgust'], 'luxuriant': ['positive'], 'luxurious': ['joy', 'positive'], 'luxury': ['joy', 'positive'], 'lying': ['anger', 'disgust', 'negative'], 'lynch': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'lyre': ['joy', 'positive'], 'lyrical': ['joy', 'positive'], 'mace': ['fear', 'negative'], 'machine': ['trust'], 'mad': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'madden': ['anger', 'fear', 'negative'], 'madman': ['anger', 'fear', 'negative'], 'madness': ['anger', 'fear', 'negative'], 'mafia': ['fear', 'negative'], 'mage': ['fear'], 'maggot': ['disgust', 'negative'], 'magical': ['anticipation', 'joy', 'positive', 'surprise'], 'magician': ['surprise'], 'magnet': ['positive', 'trust'], 'magnetism': ['positive'], 'magnetite': ['positive'], 'magnificence': ['anticipation', 'joy', 'positive', 'trust'], 'magnificent': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'maiden': ['positive'], 'mail': ['anticipation'], 'main': ['positive'], 'mainstay': ['positive', 'trust'], 'maintenance': ['trust'], 'majestic': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'majesty': ['positive', 'trust'], 'major': ['positive'], 'majority': ['joy', 'positive', 'trust'], 'makeshift': ['negative'], 'malady': ['negative'], 'malaise': ['negative', 'sadness'], 'malaria': ['disgust', 'fear', 'negative', 'sadness'], 'malevolent': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'malfeasance': ['disgust', 'negative'], 'malformation': ['negative'], 'malice': ['anger', 'fear', 'negative'], 'malicious': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'malign': ['anger', 'disgust', 'negative'], 'malignancy': ['fear', 'negative', 'sadness'], 'malignant': ['anger', 'fear', 'negative'], 'malpractice': ['anger', 'negative'], 'mamma': ['trust'], 'manage': ['positive', 'trust'], 'management': ['positive', 'trust'], 'mandamus': ['fear', 'negative'], 'mandarin': ['positive', 'trust'], 'mange': ['disgust', 'fear', 'negative'], 'mangle': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'manhood': ['positive'], 'mania': ['negative'], 'maniac': ['anger', 'fear', 'negative'], 'maniacal': ['negative'], 'manifestation': ['fear'], 'manifested': ['positive'], 'manipulate': ['negative'], 'manipulation': ['anger', 'fear', 'negative'], 'manly': ['positive'], 'manna': ['positive'], 'mannered': ['positive'], 'manners': ['positive'], 'manslaughter': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'manual': ['trust'], 'manufacturer': ['positive'], 'manure': ['disgust', 'negative'], 'mar': ['negative'], 'march': ['positive'], 'margin': ['negative', 'sadness'], 'marine': ['trust'], 'marked': ['positive'], 'marketable': ['positive'], 'maroon': ['negative'], 'marquis': ['positive'], 'marriage': ['anticipation', 'joy', 'positive', 'trust'], 'marrow': ['joy', 'positive', 'trust'], 'marry': ['anticipation', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'marshal': ['positive', 'trust'], 'martial': ['anger'], 'martingale': ['negative'], 'martyr': ['fear', 'negative', 'sadness'], 'martyrdom': ['fear', 'negative', 'sadness'], 'marvel': ['positive', 'surprise'], 'marvelous': ['joy', 'positive'], 'marvelously': ['joy', 'positive'], 'masculine': ['positive'], 'masochism': ['anger', 'disgust', 'fear', 'negative'], 'massacre': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'massage': ['joy', 'positive'], 'master': ['positive'], 'masterpiece': ['joy', 'positive'], 'mastery': ['anger', 'joy', 'positive', 'trust'], 'matchmaker': ['anticipation'], 'mate': ['positive', 'trust'], 'materialism': ['negative'], 'materialist': ['disgust', 'negative'], 'maternal': ['anticipation', 'negative', 'positive'], 'mathematical': ['trust'], 'matrimony': ['anticipation', 'joy', 'positive', 'trust'], 'matron': ['positive', 'trust'], 'mausoleum': ['sadness'], 'maxim': ['trust'], 'maximum': ['positive'], 'mayor': ['positive'], 'meadow': ['positive'], 'meandering': ['negative'], 'meaningless': ['negative', 'sadness'], 'measles': ['disgust', 'fear', 'negative', 'sadness'], 'measure': ['trust'], 'measured': ['positive', 'trust'], 'medal': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'meddle': ['anger', 'negative'], 'mediate': ['anticipation', 'positive', 'trust'], 'mediation': ['positive'], 'mediator': ['anticipation', 'positive', 'trust'], 'medical': ['anticipation', 'fear', 'positive', 'trust'], 'mediocre': ['negative'], 'mediocrity': ['negative'], 'meditate': ['anticipation', 'joy', 'positive', 'trust'], 'mediterranean': ['positive'], 'medley': ['positive'], 'meek': ['sadness'], 'melancholic': ['negative', 'sadness'], 'melancholy': ['negative', 'sadness'], 'melee': ['fear', 'negative'], 'melodrama': ['anger', 'negative', 'sadness'], 'meltdown': ['negative', 'sadness'], 'memento': ['positive'], 'memorable': ['joy', 'positive', 'surprise', 'trust'], 'memorials': ['sadness'], 'menace': ['anger', 'fear', 'negative'], 'menacing': ['anger', 'fear', 'negative'], 'mending': ['positive'], 'menial': ['negative'], 'menses': ['positive'], 'mentor': ['positive', 'trust'], 'mercenary': ['fear', 'negative'], 'merchant': ['trust'], 'merciful': ['positive'], 'merciless': ['fear', 'negative'], 'mercy': ['positive'], 'merge': ['anticipation', 'positive'], 'merit': ['positive', 'trust'], 'meritorious': ['joy', 'positive', 'trust'], 'merriment': ['joy', 'positive', 'surprise'], 'merry': ['joy', 'positive'], 'mess': ['disgust', 'negative'], 'messenger': ['trust'], 'messy': ['disgust', 'negative'], 'metastasis': ['negative'], 'methanol': ['negative'], 'metropolitan': ['positive'], 'mettle': ['positive'], 'microscope': ['trust'], 'microscopy': ['positive'], 'midwife': ['anticipation', 'joy', 'negative', 'positive', 'trust'], 'midwifery': ['positive'], 'mighty': ['anger', 'fear', 'joy', 'positive', 'trust'], 'mildew': ['disgust', 'negative'], 'military': ['fear'], 'militia': ['anger', 'fear', 'negative', 'sadness'], 'mill': ['anticipation'], 'mime': ['positive'], 'mimicry': ['negative', 'surprise'], 'mindful': ['positive'], 'mindfulness': ['positive'], 'minimize': ['negative'], 'minimum': ['negative'], 'ministry': ['joy', 'positive', 'trust'], 'minority': ['negative'], 'miracle': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'miraculous': ['joy', 'positive', 'surprise'], 'mire': ['disgust', 'negative'], 'mirth': ['joy', 'positive'], 'misbehavior': ['anger', 'disgust', 'negative', 'surprise'], 'miscarriage': ['fear', 'negative', 'sadness'], 'mischief': ['negative'], 'mischievous': ['negative'], 'misconception': ['anger', 'disgust', 'fear', 'negative'], 'misconduct': ['disgust', 'negative'], 'miserable': ['anger', 'disgust', 'negative', 'sadness'], 'miserably': ['negative', 'sadness'], 'misery': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'misfortune': ['fear', 'negative', 'sadness'], 'misguided': ['disgust', 'negative'], 'mishap': ['disgust', 'fear', 'negative', 'sadness', 'surprise'], 'misinterpretation': ['negative'], 'mislead': ['anger', 'fear', 'negative', 'trust'], 'misleading': ['anger', 'disgust', 'negative'], 'mismanagement': ['negative'], 'mismatch': ['negative'], 'misnomer': ['negative'], 'misplace': ['anger', 'disgust', 'negative'], 'misplaced': ['negative'], 'misrepresent': ['negative'], 'misrepresentation': ['negative', 'sadness'], 'misrepresented': ['anger', 'negative'], 'missile': ['fear'], 'missing': ['fear', 'negative', 'sadness'], 'missionary': ['positive'], 'misstatement': ['anger', 'disgust', 'negative'], 'mistake': ['negative', 'sadness'], 'mistaken': ['fear', 'negative'], 'mistress': ['anger', 'disgust', 'negative'], 'mistrust': ['disgust', 'fear', 'negative'], 'misunderstand': ['negative'], 'misunderstanding': ['anger', 'negative', 'sadness'], 'misuse': ['negative'], 'mite': ['disgust', 'negative'], 'moan': ['fear', 'sadness'], 'moat': ['trust'], 'mob': ['anger', 'fear', 'negative'], 'mobile': ['anticipation'], 'mockery': ['disgust', 'negative'], 'mocking': ['anger', 'disgust', 'negative', 'sadness'], 'model': ['positive'], 'moderate': ['positive'], 'moderator': ['positive', 'trust'], 'modest': ['positive', 'trust'], 'modesty': ['positive'], 'modify': ['surprise'], 'molestation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'momentum': ['anticipation', 'positive'], 'monetary': ['anticipation', 'positive'], 'money': ['anger', 'anticipation', 'joy', 'positive', 'surprise', 'trust'], 'monk': ['positive', 'trust'], 'monochrome': ['disgust', 'negative'], 'monogamy': ['trust'], 'monopolist': ['negative'], 'monsoon': ['negative', 'sadness'], 'monster': ['fear', 'negative'], 'monstrosity': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'monument': ['positive'], 'moody': ['anger', 'negative', 'sadness'], 'moorings': ['trust'], 'moot': ['negative'], 'moral': ['anger', 'positive', 'trust'], 'morality': ['positive', 'trust'], 'morals': ['anger', 'anticipation', 'disgust', 'joy', 'positive', 'surprise', 'trust'], 'morbid': ['negative', 'sadness'], 'morbidity': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'morgue': ['disgust', 'fear', 'negative', 'sadness'], 'moribund': ['negative', 'sadness'], 'morn': ['anticipation'], 'moron': ['negative'], 'moronic': ['negative'], 'morrow': ['anticipation'], 'morsel': ['negative'], 'mortal': ['negative'], 'mortality': ['anger', 'fear', 'negative', 'sadness'], 'mortar': ['positive'], 'mortgage': ['fear'], 'mortgagee': ['trust'], 'mortgagor': ['fear'], 'mortification': ['anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'mortuary': ['fear', 'negative', 'sadness'], 'mosque': ['anger'], 'mosquito': ['anger', 'disgust', 'negative'], 'mother': ['anticipation', 'joy', 'negative', 'positive', 'sadness', 'trust'], 'motherhood': ['joy', 'positive', 'trust'], 'motion': ['anticipation'], 'motive': ['positive'], 'mountain': ['anticipation'], 'mourn': ['negative', 'sadness'], 'mournful': ['anger', 'fear', 'negative', 'sadness'], 'mourning': ['negative', 'sadness'], 'mouth': ['surprise'], 'mouthful': ['disgust'], 'movable': ['positive'], 'mover': ['positive'], 'muck': ['disgust', 'negative'], 'mucous': ['disgust'], 'mucus': ['disgust'], 'mud': ['negative'], 'muddle': ['negative'], 'muddled': ['negative'], 'muddy': ['disgust', 'negative'], 'muff': ['anger', 'disgust', 'negative'], 'mug': ['anger', 'fear', 'negative', 'positive', 'sadness'], 'mule': ['anger', 'negative', 'trust'], 'mum': ['fear', 'negative'], 'mumble': ['negative'], 'mumps': ['negative'], 'murder': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'murderer': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'murderous': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'murky': ['disgust', 'negative', 'sadness'], 'muscular': ['positive'], 'music': ['joy', 'positive', 'sadness'], 'musical': ['anger', 'anticipation', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'musket': ['fear'], 'muss': ['negative'], 'musty': ['disgust', 'negative'], 'mutable': ['anticipation', 'positive'], 'mutant': ['negative'], 'mutilated': ['disgust', 'negative'], 'mutilation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'mutiny': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'mutter': ['anger', 'negative'], 'mutual': ['positive'], 'muzzle': ['fear', 'negative'], 'myopia': ['anger', 'negative', 'sadness'], 'mysterious': ['anticipation', 'fear', 'surprise'], 'mystery': ['anticipation', 'surprise'], 'mystic': ['surprise'], 'nab': ['negative', 'surprise'], 'nadir': ['negative'], 'nag': ['anger', 'negative'], 'naive': ['negative'], 'nameless': ['disgust', 'negative'], 'nap': ['joy', 'positive'], 'napkin': ['sadness'], 'nappy': ['disgust', 'negative'], 'narcotic': ['negative'], 'nascent': ['anticipation'], 'nasty': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'nation': ['trust'], 'naturalist': ['positive'], 'naughty': ['negative'], 'nausea': ['disgust', 'negative'], 'nauseous': ['disgust', 'negative', 'sadness'], 'navigable': ['anticipation', 'positive'], 'navigator': ['anticipation', 'trust'], 'nay': ['negative'], 'neatly': ['positive'], 'necessity': ['sadness'], 'nectar': ['positive'], 'needful': ['negative'], 'needle': ['positive'], 'needy': ['negative'], 'nefarious': ['disgust', 'fear', 'negative', 'sadness', 'surprise'], 'negation': ['anger', 'negative'], 'negative': ['negative', 'sadness'], 'neglect': ['negative'], 'neglected': ['anger', 'disgust', 'negative', 'sadness'], 'neglecting': ['negative'], 'negligence': ['negative'], 'negligent': ['negative'], 'negligently': ['negative'], 'negotiate': ['positive', 'trust'], 'negotiator': ['positive'], 'negro': ['negative', 'sadness'], 'neighbor': ['anticipation', 'positive', 'trust'], 'neighborhood': ['anticipation'], 'nepotism': ['anger', 'disgust', 'negative', 'sadness'], 'nerve': ['positive'], 'nervous': ['anticipation', 'fear', 'negative'], 'nervousness': ['fear'], 'nest': ['trust'], 'nestle': ['positive', 'trust'], 'nether': ['anger', 'fear', 'negative', 'sadness'], 'nettle': ['anger', 'disgust', 'negative'], 'network': ['anticipation'], 'neuralgia': ['fear', 'negative', 'sadness'], 'neurosis': ['fear', 'negative', 'sadness'], 'neurotic': ['disgust', 'fear', 'negative'], 'neutral': ['anticipation', 'trust'], 'neutrality': ['trust'], 'newcomer': ['fear', 'surprise'], 'nicotine': ['disgust', 'negative'], 'nigger': ['negative'], 'nightmare': ['fear', 'negative'], 'nihilism': ['negative'], 'nobility': ['anticipation', 'positive', 'trust'], 'noble': ['positive', 'trust'], 'nobleman': ['positive', 'trust'], 'noise': ['negative'], 'noisy': ['anger', 'negative'], 'nomination': ['positive'], 'noncompliance': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'nonsense': ['negative'], 'nonsensical': ['negative', 'sadness'], 'noose': ['negative', 'sadness'], 'normality': ['positive'], 'nose': ['disgust'], 'notable': ['joy', 'positive', 'trust'], 'notables': ['positive'], 'notary': ['trust'], 'noted': ['positive'], 'nothingness': ['negative', 'sadness'], 'notification': ['anticipation'], 'notion': ['positive'], 'notoriety': ['anger', 'disgust', 'fear', 'negative', 'positive'], 'nourishment': ['positive'], 'noxious': ['disgust', 'fear', 'negative'], 'nuisance': ['anger', 'negative'], 'nul': ['negative'], 'nullify': ['negative', 'surprise'], 'numb': ['negative'], 'numbers': ['positive'], 'numbness': ['negative', 'sadness'], 'nun': ['negative', 'trust'], 'nurse': ['positive', 'trust'], 'nursery': ['joy', 'positive', 'trust'], 'nurture': ['anger', 'anticipation', 'disgust', 'fear', 'joy', 'positive', 'trust'], 'nutritious': ['positive', 'sadness'], 'oaf': ['negative'], 'oak': ['positive'], 'oasis': ['anticipation', 'joy', 'positive', 'trust'], 'oath': ['positive', 'trust'], 'obedience': ['positive', 'trust'], 'obese': ['disgust', 'negative'], 'obesity': ['disgust', 'negative', 'sadness'], 'obey': ['fear', 'trust'], 'obi': ['disgust', 'fear', 'negative'], 'obit': ['negative', 'sadness', 'surprise'], 'obituary': ['negative', 'sadness'], 'objection': ['anger', 'negative'], 'objectionable': ['negative'], 'objective': ['anticipation', 'positive', 'trust'], 'oblige': ['negative', 'trust'], 'obliging': ['anger', 'anticipation', 'disgust', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'obligor': ['fear', 'negative'], 'obliterate': ['anger', 'fear', 'negative', 'sadness'], 'obliterated': ['anger', 'fear', 'negative'], 'obliteration': ['fear', 'negative', 'sadness'], 'oblivion': ['anger', 'fear', 'negative'], 'obnoxious': ['anger', 'disgust', 'negative', 'sadness'], 'obscene': ['disgust', 'negative'], 'obscenity': ['anger', 'disgust', 'negative'], 'obscurity': ['negative'], 'observant': ['positive'], 'obstacle': ['anger', 'fear', 'negative', 'sadness'], 'obstetrician': ['trust'], 'obstinate': ['negative'], 'obstruct': ['anger', 'fear', 'negative'], 'obstruction': ['negative'], 'obstructive': ['anger', 'negative'], 'obtainable': ['joy', 'positive'], 'obtuse': ['negative'], 'obvious': ['positive', 'trust'], 'occasional': ['surprise'], 'occult': ['disgust', 'fear', 'negative'], 'occupant': ['positive', 'trust'], 'occupation': ['positive'], 'occupy': ['positive'], 'octopus': ['disgust'], 'oddity': ['disgust', 'negative', 'sadness', 'surprise'], 'odious': ['anger', 'disgust', 'fear', 'negative'], 'odor': ['negative'], 'offend': ['anger', 'disgust', 'negative'], 'offended': ['anger', 'negative', 'sadness'], 'offender': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'offense': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'offensive': ['anger', 'disgust', 'negative'], 'offer': ['positive'], 'offering': ['trust'], 'offhand': ['negative'], 'officer': ['positive', 'trust'], 'official': ['trust'], 'offing': ['negative'], 'offset': ['anticipation', 'positive'], 'offshoot': ['positive'], 'ogre': ['disgust', 'fear', 'negative'], 'older': ['sadness'], 'olfactory': ['anticipation', 'negative'], 'oligarchy': ['negative'], 'omen': ['anticipation', 'fear', 'negative'], 'ominous': ['anticipation', 'fear', 'negative'], 'omit': ['negative'], 'omnipotence': ['fear', 'negative', 'positive'], 'omniscient': ['positive', 'trust'], 'onerous': ['anger', 'negative', 'sadness'], 'ongoing': ['anticipation'], 'onset': ['anticipation'], 'onus': ['negative'], 'ooze': ['disgust', 'negative'], 'opaque': ['negative'], 'openness': ['positive'], 'opera': ['anger', 'anticipation', 'fear', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'operatic': ['negative'], 'operation': ['fear', 'trust'], 'opiate': ['negative'], 'opinionated': ['anger', 'negative'], 'opium': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'opponent': ['anger', 'anticipation', 'disgust', 'fear', 'negative'], 'opportune': ['joy', 'positive'], 'opportunity': ['anticipation', 'positive'], 'oppose': ['negative'], 'opposed': ['anger', 'fear', 'negative'], 'opposition': ['anger', 'negative'], 'oppress': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'oppression': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'oppressive': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'oppressor': ['anger', 'fear', 'negative', 'sadness'], 'optimism': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'optimist': ['positive', 'trust'], 'option': ['positive'], 'optional': ['positive'], 'oracle': ['anticipation', 'positive', 'trust'], 'oration': ['positive'], 'orc': ['anger', 'disgust', 'fear', 'negative'], 'orchestra': ['anger', 'joy', 'positive', 'sadness', 'trust'], 'ordained': ['positive', 'trust'], 'ordeal': ['anger', 'negative', 'surprise'], 'orderly': ['positive'], 'ordinance': ['trust'], 'ordination': ['anticipation', 'joy', 'positive', 'trust'], 'ordnance': ['fear', 'negative'], 'organ': ['anticipation', 'joy'], 'organic': ['positive'], 'organization': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'organize': ['positive'], 'organized': ['positive'], 'orgasm': ['anticipation', 'joy', 'positive'], 'originality': ['positive', 'surprise'], 'ornamented': ['positive'], 'ornate': ['positive'], 'orphan': ['fear', 'negative', 'sadness'], 'orthodoxy': ['trust'], 'ostensibly': ['negative'], 'oust': ['anger', 'negative', 'sadness'], 'outburst': ['anger', 'fear', 'joy', 'negative', 'positive', 'sadness', 'surprise'], 'outcast': ['disgust', 'fear', 'negative', 'sadness'], 'outcome': ['positive'], 'outcry': ['anger', 'fear', 'negative', 'surprise'], 'outdo': ['anticipation', 'positive'], 'outhouse': ['disgust', 'negative'], 'outlandish': ['negative'], 'outlaw': ['negative'], 'outpost': ['fear'], 'outrage': ['anger', 'disgust', 'negative'], 'outrageous': ['surprise'], 'outsider': ['fear'], 'outstanding': ['joy', 'negative', 'positive'], 'outward': ['positive'], 'ovation': ['negative', 'sadness'], 'overbearing': ['anger', 'negative'], 'overburden': ['negative'], 'overcast': ['negative'], 'overdo': ['negative'], 'overdose': ['negative'], 'overdue': ['anticipation', 'negative', 'sadness', 'surprise'], 'overestimate': ['surprise'], 'overestimated': ['negative'], 'overflow': ['negative'], 'overgrown': ['negative'], 'overjoyed': ['joy', 'positive'], 'overload': ['negative', 'sadness'], 'overpaid': ['negative'], 'overpower': ['negative'], 'overpowering': ['anger', 'fear', 'negative'], 'overpriced': ['anger', 'disgust', 'negative', 'sadness'], 'oversight': ['negative'], 'overt': ['fear'], 'overthrow': ['anticipation', 'fear', 'negative'], 'overture': ['anticipation'], 'overturn': ['negative'], 'overwhelm': ['negative'], 'overwhelmed': ['negative', 'sadness'], 'overwhelming': ['positive'], 'owing': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness', 'trust'], 'ownership': ['positive'], 'oxidation': ['negative'], 'pacific': ['positive'], 'pact': ['trust'], 'pad': ['positive'], 'padding': ['positive'], 'paddle': ['anticipation', 'positive'], 'pain': ['fear', 'negative', 'sadness'], 'pained': ['fear', 'negative', 'sadness'], 'painful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'painfully': ['negative', 'sadness'], 'pains': ['negative'], 'palatable': ['positive'], 'palliative': ['positive'], 'palpable': ['surprise'], 'palsy': ['disgust', 'fear', 'negative', 'sadness'], 'panacea': ['positive'], 'panache': ['positive'], 'pandemic': ['fear', 'negative', 'sadness'], 'pang': ['negative', 'surprise'], 'panic': ['fear', 'negative'], 'panier': ['positive'], 'paprika': ['positive'], 'parachute': ['fear'], 'parade': ['anticipation', 'fear', 'joy', 'negative', 'positive', 'surprise'], 'paragon': ['anticipation', 'joy', 'positive', 'trust'], 'paralysis': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'paralyzed': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'paramount': ['positive'], 'paranoia': ['fear', 'negative'], 'paraphrase': ['negative', 'positive'], 'parasite': ['disgust', 'fear', 'negative'], 'pardon': ['positive'], 'pare': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'parentage': ['positive'], 'parietal': ['positive', 'trust'], 'parish': ['trust'], 'parliament': ['trust'], 'parole': ['anticipation'], 'parrot': ['disgust', 'negative'], 'parsimonious': ['negative'], 'partake': ['positive', 'trust'], 'participation': ['positive'], 'parting': ['sadness'], 'partisan': ['negative'], 'partner': ['positive'], 'partnership': ['positive', 'trust'], 'passe': ['negative'], 'passenger': ['anticipation'], 'passion': ['anticipation', 'joy', 'positive', 'trust'], 'passionate': ['anticipation', 'joy', 'positive', 'trust'], 'passive': ['negative'], 'passivity': ['negative'], 'pastime': ['positive'], 'pastor': ['joy', 'positive', 'trust'], 'pastry': ['joy', 'positive'], 'pasture': ['positive'], 'patch': ['negative'], 'patent': ['positive'], 'pathetic': ['disgust', 'negative', 'sadness'], 'patience': ['anticipation', 'positive', 'trust'], 'patient': ['anticipation', 'positive'], 'patriarchal': ['positive', 'trust'], 'patrol': ['trust'], 'patron': ['positive', 'trust'], 'patronage': ['positive', 'trust'], 'patronizing': ['negative'], 'patter': ['anger', 'negative'], 'paucity': ['anger', 'disgust', 'negative', 'sadness'], 'pauper': ['negative', 'sadness'], 'pavement': ['trust'], 'pawn': ['negative', 'trust'], 'pay': ['anticipation', 'joy', 'positive', 'trust'], 'payback': ['anger', 'negative'], 'payment': ['negative'], 'peace': ['anticipation', 'joy', 'positive', 'trust'], 'peaceable': ['positive'], 'peaceful': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'peacock': ['positive'], 'peck': ['positive'], 'peculiarities': ['negative'], 'peculiarity': ['positive'], 'pedestrian': ['negative'], 'pedigree': ['positive', 'trust'], 'peerless': ['positive'], 'penal': ['fear', 'negative', 'sadness'], 'penalty': ['anger', 'fear', 'negative', 'sadness'], 'penance': ['fear', 'sadness'], 'penchant': ['positive'], 'penetration': ['anger', 'fear', 'negative'], 'penitentiary': ['anger', 'negative'], 'pensive': ['sadness'], 'perceive': ['positive', 'trust'], 'perceptible': ['positive'], 'perchance': ['surprise'], 'perdition': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'perennial': ['positive', 'trust'], 'perfect': ['anticipation', 'joy', 'positive', 'trust'], 'perfection': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'performer': ['positive'], 'peri': ['surprise'], 'peril': ['anticipation', 'fear', 'negative', 'sadness'], 'perilous': ['anticipation', 'fear', 'negative', 'sadness'], 'periodicity': ['trust'], 'perish': ['fear', 'negative', 'sadness'], 'perishable': ['negative'], 'perished': ['negative', 'sadness'], 'perishing': ['fear', 'negative', 'sadness'], 'perjury': ['fear', 'negative', 'surprise'], 'perk': ['positive'], 'permission': ['positive'], 'pernicious': ['anger', 'fear', 'negative', 'sadness'], 'perpetrator': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'perpetuate': ['anticipation'], 'perpetuation': ['negative'], 'perpetuity': ['anticipation', 'positive', 'trust'], 'perplexed': ['negative'], 'perplexity': ['negative', 'sadness'], 'persecute': ['anger', 'fear', 'negative'], 'persecution': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'persistence': ['positive'], 'persistent': ['positive'], 'personable': ['positive'], 'personal': ['trust'], 'perspiration': ['disgust'], 'persuade': ['trust'], 'pertinent': ['positive', 'trust'], 'perturbation': ['fear', 'negative'], 'pertussis': ['negative'], 'perverse': ['anger', 'disgust', 'fear', 'negative'], 'perversion': ['anger', 'disgust', 'negative', 'sadness'], 'pervert': ['anger', 'disgust', 'negative'], 'perverted': ['disgust', 'negative'], 'pessimism': ['anger', 'fear', 'negative', 'sadness'], 'pessimist': ['fear', 'negative', 'sadness'], 'pest': ['anger', 'disgust', 'fear', 'negative'], 'pestilence': ['disgust', 'fear', 'negative'], 'pet': ['negative'], 'petroleum': ['disgust', 'negative', 'positive'], 'petty': ['negative'], 'phalanx': ['fear', 'trust'], 'phantom': ['fear', 'negative'], 'pharmaceutical': ['positive'], 'philanthropic': ['trust'], 'philanthropist': ['positive', 'trust'], 'philanthropy': ['positive'], 'philosopher': ['positive', 'trust'], 'phlegm': ['disgust', 'negative'], 'phoenix': ['positive'], 'phonetic': ['positive'], 'phony': ['anger', 'disgust', 'negative'], 'physician': ['positive', 'trust'], 'physicist': ['trust'], 'physics': ['positive'], 'physiology': ['positive'], 'physique': ['positive'], 'pick': ['positive'], 'picket': ['anger', 'anticipation', 'fear', 'negative'], 'picketing': ['anger', 'negative'], 'pickle': ['negative'], 'picnic': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'picturesque': ['joy', 'positive'], 'piety': ['positive'], 'pig': ['disgust', 'negative'], 'pigeon': ['negative'], 'piles': ['disgust', 'negative'], 'pill': ['positive', 'trust'], 'pillage': ['anger', 'disgust', 'fear', 'negative'], 'pillow': ['positive'], 'pilot': ['positive', 'trust'], 'pimp': ['negative'], 'pimple': ['disgust', 'negative'], 'pine': ['negative', 'sadness'], 'pinion': ['fear', 'negative'], 'pinnacle': ['positive'], 'pioneer': ['positive'], 'pious': ['disgust', 'positive', 'sadness', 'trust'], 'pique': ['anger', 'negative'], 'piracy': ['negative'], 'pirate': ['anger', 'negative'], 'pistol': ['negative'], 'pitfall': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'pith': ['positive', 'trust'], 'pity': ['sadness'], 'pivot': ['positive', 'trust'], 'placard': ['surprise'], 'placid': ['positive'], 'plagiarism': ['disgust', 'negative'], 'plague': ['disgust', 'fear', 'negative', 'sadness'], 'plaintiff': ['negative'], 'plaintive': ['sadness'], 'plan': ['anticipation'], 'planning': ['anticipation', 'positive', 'trust'], 'plated': ['negative'], 'player': ['negative'], 'playful': ['anger', 'joy', 'positive', 'surprise', 'trust'], 'playground': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'playhouse': ['joy', 'positive'], 'plea': ['anticipation', 'fear', 'negative', 'sadness'], 'pleasant': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'pleased': ['joy', 'positive'], 'pleasurable': ['joy', 'positive'], 'pledge': ['joy', 'positive', 'trust'], 'plenary': ['positive'], 'plentiful': ['positive'], 'plexus': ['positive'], 'plight': ['anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'plodding': ['negative'], 'plum': ['positive'], 'plumb': ['positive'], 'plummet': ['fear', 'negative'], 'plump': ['anticipation'], 'plunder': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'plunge': ['fear', 'negative'], 'plush': ['positive'], 'ply': ['positive'], 'pneumonia': ['fear', 'negative'], 'poaching': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'pointedly': ['positive'], 'pointless': ['negative', 'sadness'], 'poison': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'poisoned': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'poisoning': ['disgust', 'negative'], 'poisonous': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'poke': ['anticipation', 'negative'], 'polarity': ['surprise'], 'polemic': ['anger', 'disgust', 'negative'], 'police': ['fear', 'positive', 'trust'], 'policeman': ['fear', 'positive', 'trust'], 'policy': ['trust'], 'polio': ['fear', 'negative', 'sadness'], 'polish': ['positive'], 'polished': ['positive'], 'polite': ['positive'], 'politeness': ['positive'], 'politic': ['disgust', 'positive'], 'politics': ['anger'], 'poll': ['trust'], 'pollute': ['disgust', 'negative'], 'pollution': ['disgust', 'negative'], 'polygamy': ['disgust', 'negative'], 'pomp': ['negative'], 'pompous': ['disgust', 'negative'], 'ponderous': ['negative'], 'pontiff': ['trust'], 'pool': ['positive'], 'poorly': ['negative'], 'pop': ['negative', 'surprise'], 'pope': ['positive'], 'popularity': ['positive'], 'popularized': ['positive'], 'population': ['positive'], 'porcupine': ['negative'], 'porn': ['disgust', 'negative'], 'porno': ['negative'], 'pornographic': ['negative'], 'pornography': ['disgust', 'negative'], 'portable': ['positive'], 'pose': ['negative'], 'posse': ['fear'], 'possess': ['anticipation', 'joy', 'positive', 'trust'], 'possessed': ['anger', 'disgust', 'fear', 'negative'], 'possession': ['anger', 'disgust', 'fear', 'negative'], 'possibility': ['anticipation'], 'posthumous': ['negative', 'sadness'], 'postponement': ['negative', 'surprise'], 'potable': ['positive'], 'potency': ['positive'], 'pound': ['anger', 'negative'], 'poverty': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'pow': ['anger'], 'powerful': ['anger', 'anticipation', 'disgust', 'fear', 'joy', 'positive', 'trust'], 'powerfully': ['fear', 'positive'], 'powerless': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'practice': ['positive'], 'practiced': ['joy', 'positive', 'surprise', 'trust'], 'practise': ['anticipation', 'positive'], 'praise': ['joy', 'positive', 'trust'], 'praised': ['joy', 'positive'], 'praiseworthy': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'prank': ['negative', 'surprise'], 'pray': ['anticipation', 'fear', 'joy', 'positive', 'surprise', 'trust'], 'precarious': ['anticipation', 'fear', 'negative', 'sadness'], 'precaution': ['positive'], 'precede': ['positive'], 'precedence': ['positive', 'trust'], 'precinct': ['negative'], 'precious': ['anticipation', 'joy', 'positive', 'surprise'], 'precipice': ['fear'], 'precise': ['positive'], 'precision': ['positive'], 'preclude': ['anger'], 'precursor': ['anticipation'], 'predatory': ['negative'], 'predicament': ['fear', 'negative'], 'predict': ['anticipation'], 'prediction': ['anticipation'], 'predilection': ['anticipation', 'positive'], 'predispose': ['anticipation'], 'predominant': ['positive', 'trust'], 'preeminent': ['positive'], 'prefer': ['positive', 'trust'], 'pregnancy': ['disgust', 'negative'], 'prejudice': ['anger', 'negative'], 'prejudiced': ['disgust', 'fear', 'negative'], 'prejudicial': ['anger', 'negative'], 'preliminary': ['anticipation'], 'premature': ['surprise'], 'premeditated': ['fear', 'negative'], 'premier': ['positive'], 'premises': ['positive'], 'preparation': ['anticipation'], 'preparatory': ['anticipation'], 'prepare': ['anticipation', 'positive'], 'prepared': ['anticipation', 'positive', 'trust'], 'preparedness': ['anticipation'], 'preponderance': ['trust'], 'prerequisite': ['anticipation'], 'prescient': ['anticipation', 'positive'], 'presence': ['positive'], 'present': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'presentable': ['positive'], 'presentment': ['negative', 'positive'], 'preservative': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'preserve': ['positive'], 'president': ['positive', 'trust'], 'pressure': ['negative'], 'prestige': ['joy', 'positive', 'trust'], 'presto': ['joy', 'positive', 'surprise'], 'presumption': ['trust'], 'presumptuous': ['anger', 'disgust', 'negative'], 'pretend': ['negative'], 'pretended': ['negative'], 'pretending': ['anger', 'negative'], 'pretense': ['negative'], 'pretensions': ['negative'], 'pretty': ['anticipation', 'joy', 'positive', 'trust'], 'prevail': ['anticipation', 'joy', 'positive'], 'prevalent': ['trust'], 'prevent': ['fear'], 'prevention': ['anticipation', 'positive'], 'preventive': ['negative'], 'prey': ['fear', 'negative'], 'priceless': ['positive'], 'prick': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'prickly': ['negative'], 'pride': ['joy', 'positive'], 'priest': ['positive', 'trust'], 'priesthood': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'priestly': ['positive'], 'primacy': ['positive'], 'primary': ['positive'], 'prime': ['positive'], 'primer': ['positive', 'trust'], 'prince': ['positive'], 'princely': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'princess': ['positive'], 'principal': ['positive', 'trust'], 'prison': ['anger', 'fear', 'negative', 'sadness'], 'prisoner': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'pristine': ['positive'], 'privileged': ['joy', 'positive', 'trust'], 'privy': ['negative', 'trust'], 'probability': ['anticipation'], 'probation': ['anticipation', 'fear', 'sadness'], 'probity': ['positive', 'trust'], 'problem': ['fear', 'negative', 'sadness'], 'procedure': ['fear', 'positive'], 'proceeding': ['anticipation'], 'procession': ['joy', 'positive', 'sadness', 'surprise'], 'procrastinate': ['negative'], 'procrastination': ['negative'], 'proctor': ['positive', 'trust'], 'procure': ['positive'], 'prodigal': ['negative', 'positive'], 'prodigious': ['positive'], 'prodigy': ['positive'], 'producer': ['positive'], 'producing': ['positive'], 'production': ['anticipation', 'positive'], 'productive': ['positive'], 'productivity': ['positive'], 'profane': ['anger', 'negative'], 'profanity': ['anger', 'negative'], 'profession': ['positive'], 'professional': ['positive', 'trust'], 'professor': ['positive', 'trust'], 'professorship': ['trust'], 'proficiency': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'proficient': ['positive', 'trust'], 'profuse': ['positive'], 'profusion': ['negative'], 'prognosis': ['anticipation', 'fear'], 'prognostic': ['anticipation'], 'progress': ['anticipation', 'joy', 'positive'], 'progression': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'progressive': ['positive'], 'prohibited': ['anger', 'disgust', 'fear', 'negative'], 'prohibition': ['negative'], 'projectile': ['fear'], 'projectiles': ['fear'], 'prolific': ['positive'], 'prologue': ['anticipation'], 'prolong': ['disgust', 'negative'], 'prominence': ['positive'], 'prominently': ['positive'], 'promiscuous': ['negative'], 'promise': ['joy', 'positive', 'trust'], 'promising': ['positive'], 'promotion': ['positive'], 'proof': ['trust'], 'prop': ['positive'], 'propaganda': ['negative'], 'proper': ['positive'], 'prophecy': ['anticipation'], 'prophet': ['anticipation', 'positive', 'trust'], 'prophetic': ['anticipation'], 'prophylactic': ['anticipation', 'positive', 'trust'], 'proposition': ['positive'], 'prosecute': ['anger', 'fear', 'negative', 'sadness'], 'prosecution': ['disgust', 'negative'], 'prospect': ['positive'], 'prospectively': ['anticipation'], 'prosper': ['anticipation', 'joy', 'positive'], 'prosperity': ['positive'], 'prosperous': ['joy', 'positive'], 'prostitute': ['disgust', 'negative'], 'prostitution': ['disgust', 'negative', 'sadness'], 'protect': ['positive'], 'protected': ['trust'], 'protecting': ['positive', 'trust'], 'protective': ['positive'], 'protector': ['positive', 'trust'], 'protestant': ['fear'], 'proud': ['anticipation', 'joy', 'positive', 'trust'], 'prove': ['positive'], 'proven': ['trust'], 'proverbial': ['positive'], 'provide': ['positive', 'trust'], 'providing': ['anticipation', 'joy', 'positive', 'trust'], 'proviso': ['trust'], 'provocation': ['anger', 'negative'], 'provoking': ['anger', 'disgust', 'negative'], 'prowl': ['fear', 'surprise'], 'proxy': ['trust'], 'prudence': ['positive'], 'prudent': ['positive', 'trust'], 'pry': ['anger', 'anticipation', 'negative', 'trust'], 'prying': ['negative'], 'psalm': ['positive'], 'psychosis': ['anger', 'fear', 'negative', 'sadness'], 'public': ['anticipation', 'positive'], 'publicist': ['negative'], 'puffy': ['negative'], 'puke': ['disgust'], 'pull': ['positive'], 'pulpit': ['positive'], 'puma': ['fear', 'surprise'], 'punch': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'punctual': ['anticipation', 'positive', 'trust'], 'punctuality': ['positive'], 'pungent': ['disgust', 'negative'], 'punish': ['fear', 'negative'], 'punished': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'punishing': ['anger', 'fear', 'negative', 'sadness'], 'punishment': ['anger', 'disgust', 'fear', 'negative'], 'punitive': ['anger', 'fear', 'negative', 'sadness'], 'punt': ['anticipation'], 'puppy': ['anticipation', 'positive', 'trust'], 'purely': ['positive', 'trust'], 'purgatory': ['disgust', 'fear', 'negative'], 'purge': ['fear', 'negative'], 'purification': ['positive', 'trust'], 'purify': ['joy', 'positive', 'trust'], 'purist': ['positive'], 'purity': ['positive', 'surprise'], 'purr': ['joy', 'positive', 'trust'], 'pus': ['disgust', 'negative'], 'putative': ['trust'], 'quack': ['disgust', 'negative'], 'quagmire': ['disgust', 'negative'], 'quail': ['fear', 'negative'], 'quaint': ['joy', 'positive', 'trust'], 'quake': ['fear'], 'qualified': ['positive', 'trust'], 'qualifying': ['positive'], 'quandary': ['anger', 'fear', 'negative'], 'quarantine': ['fear'], 'quarrel': ['anger', 'negative'], 'quash': ['fear', 'negative'], 'quell': ['negative'], 'quest': ['anticipation', 'positive'], 'question': ['positive'], 'questionable': ['disgust', 'negative'], 'quicken': ['anticipation'], 'quickness': ['positive', 'surprise'], 'quicksilver': ['negative', 'surprise'], 'quiescent': ['positive'], 'quiet': ['positive', 'sadness'], 'quinine': ['positive'], 'quit': ['negative'], 'quiver': ['fear', 'negative'], 'quivering': ['fear', 'negative'], 'quiz': ['negative'], 'quote': ['anticipation', 'negative', 'positive', 'surprise'], 'rabble': ['anger', 'fear', 'negative'], 'rabid': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'rabies': ['negative'], 'rack': ['negative', 'sadness'], 'racket': ['negative'], 'radar': ['trust'], 'radiance': ['anticipation', 'joy', 'positive', 'trust'], 'radiant': ['joy', 'positive'], 'radiate': ['positive'], 'radiation': ['fear', 'negative'], 'radio': ['positive'], 'radioactive': ['fear', 'negative'], 'radon': ['fear', 'negative'], 'raffle': ['anticipation', 'surprise'], 'rage': ['anger', 'negative'], 'raging': ['anger', 'disgust', 'fear', 'negative'], 'rags': ['disgust', 'negative'], 'raid': ['anger', 'fear', 'negative', 'surprise'], 'rail': ['anger', 'anticipation', 'negative'], 'rainy': ['sadness'], 'ram': ['anger', 'anticipation', 'negative'], 'rambling': ['negative'], 'rampage': ['anger', 'fear', 'negative'], 'rancid': ['disgust', 'negative'], 'randomly': ['surprise'], 'ranger': ['trust'], 'ransom': ['anger', 'fear', 'negative'], 'rape': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'rapid': ['surprise'], 'rapping': ['anger'], 'rapt': ['joy', 'positive', 'surprise', 'trust'], 'raptors': ['fear', 'negative'], 'rapture': ['anticipation', 'joy', 'positive'], 'rarity': ['surprise'], 'rascal': ['anger', 'disgust', 'fear', 'negative'], 'rash': ['disgust', 'negative'], 'rat': ['disgust', 'fear', 'negative'], 'ratify': ['trust'], 'rating': ['anger', 'fear', 'negative', 'sadness'], 'rational': ['positive', 'trust'], 'rattlesnake': ['fear'], 'raucous': ['negative'], 'rave': ['anger', 'disgust', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'ravenous': ['anger', 'fear', 'negative', 'sadness'], 'ravine': ['fear'], 'raving': ['anger', 'anticipation', 'fear', 'joy', 'negative', 'surprise'], 'razor': ['fear'], 'react': ['anger', 'fear'], 'reactionary': ['negative'], 'reader': ['positive'], 'readily': ['positive'], 'readiness': ['anticipation', 'joy', 'positive', 'trust'], 'reading': ['positive'], 'ready': ['anticipation'], 'reaffirm': ['positive'], 'real': ['positive', 'trust'], 'reappear': ['surprise'], 'rear': ['negative'], 'reason': ['positive'], 'reassurance': ['positive', 'trust'], 'reassure': ['positive', 'trust'], 'rebate': ['positive'], 'rebel': ['anger', 'fear', 'negative'], 'rebellion': ['anger', 'disgust', 'fear'], 'rebuke': ['negative'], 'rebut': ['negative'], 'recalcitrant': ['anger', 'disgust', 'negative'], 'recast': ['positive'], 'received': ['positive'], 'receiving': ['anticipation', 'joy', 'positive', 'surprise'], 'recesses': ['fear'], 'recession': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'recherche': ['positive'], 'recidivism': ['anger', 'disgust', 'negative', 'sadness'], 'recipient': ['anticipation'], 'reciprocate': ['positive'], 'reckless': ['anger', 'fear', 'negative'], 'recklessness': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'reclamation': ['positive'], 'recline': ['positive', 'trust'], 'recognizable': ['anticipation', 'positive'], 'recombination': ['anticipation'], 'recommend': ['positive', 'trust'], 'reconciliation': ['anticipation', 'joy', 'positive', 'trust'], 'reconsideration': ['positive', 'trust'], 'reconstruct': ['anticipation', 'positive'], 'reconstruction': ['anticipation', 'positive'], 'recorder': ['positive'], 'recoup': ['positive'], 'recovery': ['positive'], 'recreation': ['anticipation', 'joy', 'positive'], 'recreational': ['anticipation', 'joy', 'positive'], 'recruits': ['trust'], 'rectify': ['positive'], 'recurrent': ['anticipation'], 'redemption': ['positive'], 'redress': ['positive'], 'redundant': ['negative'], 'referee': ['trust'], 'refine': ['positive'], 'refinement': ['positive'], 'reflex': ['surprise'], 'reflux': ['disgust', 'negative'], 'reform': ['positive'], 'reformation': ['positive'], 'reformer': ['positive'], 'refractory': ['negative'], 'refreshing': ['positive'], 'refugee': ['sadness'], 'refurbish': ['positive'], 'refusal': ['negative'], 'refuse': ['negative'], 'refused': ['negative', 'sadness'], 'refutation': ['fear'], 'regal': ['positive', 'trust'], 'regatta': ['anticipation'], 'regent': ['positive', 'trust'], 'regiment': ['fear'], 'registry': ['trust'], 'regress': ['negative'], 'regression': ['negative'], 'regressive': ['negative', 'positive'], 'regret': ['negative', 'sadness'], 'regrettable': ['negative', 'sadness'], 'regretted': ['negative', 'sadness'], 'regretting': ['negative', 'sadness'], 'regularity': ['anticipation', 'positive', 'trust'], 'regulate': ['positive'], 'regulatory': ['fear', 'negative'], 'regurgitation': ['disgust'], 'rehabilitate': ['positive'], 'rehabilitation': ['anticipation', 'positive'], 'reimburse': ['positive'], 'reimbursement': ['positive', 'trust'], 'rein': ['negative'], 'reinforcement': ['positive', 'trust'], 'reinforcements': ['trust'], 'reinstate': ['positive'], 'reject': ['anger', 'fear', 'negative', 'sadness'], 'rejected': ['negative'], 'rejection': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'rejects': ['anger', 'fear', 'negative', 'sadness'], 'rejoice': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'rejoicing': ['anticipation', 'joy', 'positive', 'surprise'], 'rejuvenate': ['positive'], 'rejuvenated': ['positive'], 'rekindle': ['anticipation', 'fear', 'joy', 'negative', 'positive', 'surprise'], 'relapse': ['fear', 'negative', 'sadness'], 'related': ['trust'], 'relative': ['trust'], 'relaxation': ['positive'], 'relegation': ['negative'], 'relevant': ['positive', 'trust'], 'reliability': ['positive', 'trust'], 'reliable': ['positive', 'trust'], 'reliance': ['positive', 'trust'], 'relics': ['sadness'], 'relief': ['positive'], 'relieving': ['positive'], 'religion': ['trust'], 'relinquish': ['negative'], 'reluctant': ['fear', 'negative'], 'remains': ['disgust', 'fear', 'negative', 'positive', 'trust'], 'remake': ['positive'], 'remand': ['anger', 'negative'], 'remarkable': ['joy', 'positive', 'surprise', 'trust'], 'remarkably': ['positive'], 'remedial': ['negative'], 'remedy': ['anticipation', 'joy', 'positive', 'trust'], 'remiss': ['anger', 'disgust', 'negative', 'sadness'], 'remission': ['positive'], 'remodel': ['positive'], 'remorse': ['negative', 'sadness'], 'removal': ['negative'], 'remove': ['anger', 'fear', 'negative', 'sadness'], 'renaissance': ['positive'], 'rencontre': ['negative'], 'rend': ['negative'], 'render': ['positive'], 'renegade': ['anger', 'negative'], 'renewal': ['positive'], 'renounce': ['anger', 'negative'], 'renovate': ['anticipation', 'positive'], 'renovation': ['anticipation', 'joy', 'positive'], 'renown': ['positive'], 'renowned': ['positive'], 'renunciation': ['negative'], 'reorganize': ['positive'], 'reparation': ['positive', 'trust'], 'repay': ['anger', 'anticipation', 'joy', 'positive', 'trust'], 'repellant': ['disgust', 'fear', 'negative'], 'repellent': ['anger', 'disgust', 'fear', 'negative'], 'repelling': ['disgust', 'negative'], 'repent': ['fear', 'positive'], 'replenish': ['positive'], 'replete': ['positive'], 'reporter': ['positive', 'trust'], 'repose': ['positive'], 'represented': ['positive'], 'representing': ['anticipation'], 'repress': ['negative', 'sadness'], 'repression': ['fear', 'negative'], 'reprimand': ['anger', 'negative'], 'reprint': ['negative'], 'reprisal': ['anger', 'fear', 'negative', 'sadness'], 'reproach': ['anger', 'disgust', 'negative', 'sadness'], 'reproductive': ['joy', 'positive'], 'republic': ['negative'], 'repudiation': ['anger', 'disgust', 'negative'], 'repulsion': ['disgust', 'fear', 'negative'], 'reputable': ['positive', 'trust'], 'requiem': ['sadness'], 'rescind': ['negative'], 'rescission': ['negative'], 'rescue': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'resection': ['fear'], 'resent': ['anger', 'negative'], 'resentful': ['anger', 'negative'], 'resentment': ['anger', 'disgust', 'negative', 'sadness'], 'reserve': ['positive'], 'resident': ['positive'], 'resign': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'resignation': ['negative', 'sadness', 'surprise'], 'resigned': ['negative', 'sadness'], 'resilient': ['positive'], 'resist': ['negative'], 'resistance': ['anger', 'negative'], 'resistant': ['fear', 'negative'], 'resisting': ['anger', 'fear', 'negative', 'sadness'], 'resistive': ['positive'], 'resolutely': ['positive'], 'resources': ['joy', 'positive', 'trust'], 'respect': ['anticipation', 'joy', 'positive', 'trust'], 'respectability': ['positive'], 'respectable': ['positive', 'trust'], 'respectful': ['positive', 'trust'], 'respecting': ['positive'], 'respects': ['positive', 'trust'], 'respite': ['joy', 'positive', 'trust'], 'resplendent': ['joy', 'positive'], 'responsible': ['positive', 'trust'], 'responsive': ['anticipation', 'positive', 'trust'], 'rest': ['positive'], 'restful': ['positive'], 'restitution': ['anger', 'positive'], 'restlessness': ['anticipation'], 'restorative': ['anticipation', 'joy', 'positive', 'trust'], 'restoring': ['positive'], 'restrain': ['anger', 'fear', 'negative'], 'restrained': ['fear'], 'restraint': ['positive'], 'restrict': ['negative', 'sadness'], 'restriction': ['anger', 'fear', 'negative', 'sadness'], 'restrictive': ['negative'], 'result': ['anticipation'], 'resultant': ['anticipation'], 'resumption': ['positive'], 'retain': ['trust'], 'retaliate': ['anger', 'negative'], 'retaliation': ['anger', 'fear', 'negative'], 'retaliatory': ['anger', 'negative'], 'retard': ['disgust', 'fear', 'negative', 'sadness'], 'retardation': ['negative'], 'retention': ['positive'], 'reticent': ['fear', 'negative'], 'retirement': ['anticipation', 'fear', 'joy', 'negative', 'positive', 'sadness', 'trust'], 'retort': ['negative'], 'retract': ['anger', 'negative'], 'retraction': ['negative'], 'retrenchment': ['fear', 'negative'], 'retribution': ['anger', 'fear', 'negative', 'sadness'], 'retrograde': ['negative'], 'reunion': ['anticipation', 'positive', 'trust'], 'revel': ['joy', 'positive'], 'revels': ['joy', 'positive'], 'revenge': ['anger', 'anticipation', 'fear', 'negative', 'surprise'], 'revere': ['anticipation', 'joy', 'positive', 'trust'], 'reverence': ['joy', 'positive', 'trust'], 'reverend': ['joy', 'positive'], 'reverie': ['joy', 'positive', 'trust'], 'reversal': ['anger', 'disgust', 'negative', 'surprise'], 'revise': ['positive'], 'revival': ['anticipation', 'joy', 'positive', 'trust'], 'revive': ['anticipation', 'negative', 'positive'], 'revocation': ['negative'], 'revoke': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'revolt': ['anger', 'negative', 'surprise'], 'revolting': ['anger', 'disgust', 'fear', 'negative'], 'revolution': ['anger', 'anticipation', 'fear', 'negative', 'positive', 'sadness', 'surprise'], 'revolutionary': ['positive'], 'revolver': ['anger', 'fear', 'negative', 'sadness'], 'revulsion': ['anger', 'disgust', 'fear', 'negative'], 'reward': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'rheumatism': ['anger', 'fear', 'negative', 'sadness'], 'rhythm': ['positive'], 'rhythmical': ['joy', 'positive', 'surprise'], 'ribbon': ['anger', 'anticipation', 'joy', 'positive'], 'richness': ['positive'], 'rickety': ['negative'], 'riddle': ['surprise'], 'riddled': ['negative'], 'rider': ['positive'], 'ridicule': ['anger', 'disgust', 'negative', 'sadness'], 'ridiculous': ['anger', 'disgust', 'negative'], 'rife': ['negative'], 'rifle': ['anger', 'fear', 'negative'], 'rift': ['negative'], 'righteous': ['positive'], 'rightful': ['positive'], 'rightly': ['positive'], 'rigid': ['negative'], 'rigidity': ['negative'], 'rigor': ['disgust', 'fear', 'negative'], 'rigorous': ['negative'], 'ringer': ['anger', 'negative'], 'riot': ['anger', 'fear', 'negative'], 'riotous': ['anger', 'fear', 'negative', 'surprise'], 'ripe': ['positive'], 'ripen': ['anticipation', 'positive'], 'rising': ['anticipation', 'joy', 'positive'], 'risk': ['anticipation', 'fear', 'negative'], 'risky': ['anticipation', 'fear', 'negative'], 'rivalry': ['anger', 'negative'], 'riveting': ['positive'], 'roadster': ['joy', 'positive', 'trust'], 'rob': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'robber': ['disgust', 'fear', 'negative'], 'robbery': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'robust': ['positive'], 'rock': ['positive'], 'rocket': ['anger'], 'rod': ['fear', 'positive', 'trust'], 'rogue': ['disgust', 'negative'], 'rollicking': ['joy', 'positive'], 'romance': ['anticipation', 'fear', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'romantic': ['anticipation', 'joy', 'positive', 'trust'], 'romanticism': ['joy', 'positive'], 'romp': ['joy', 'positive'], 'rook': ['anger', 'disgust', 'negative'], 'rooted': ['positive', 'trust'], 'rosy': ['positive'], 'rot': ['disgust', 'fear', 'negative', 'sadness'], 'rota': ['positive', 'trust'], 'rotting': ['disgust', 'negative'], 'roughness': ['negative'], 'roulette': ['anticipation'], 'rout': ['negative'], 'routine': ['positive', 'trust'], 'row': ['anger', 'negative'], 'rowdy': ['negative'], 'royalty': ['positive'], 'rubbish': ['disgust', 'negative'], 'rubble': ['fear', 'negative', 'sadness'], 'rubric': ['positive'], 'rue': ['negative', 'sadness'], 'ruffle': ['negative'], 'rugged': ['negative'], 'ruin': ['fear', 'negative', 'sadness'], 'ruined': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'ruinous': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'rule': ['fear', 'trust'], 'rumor': ['negative', 'sadness'], 'runaway': ['negative', 'sadness'], 'rupture': ['fear', 'negative', 'sadness', 'surprise'], 'ruse': ['negative'], 'rust': ['negative'], 'rusty': ['negative'], 'ruth': ['positive'], 'ruthless': ['anger', 'disgust', 'fear', 'negative'], 'saber': ['anger', 'fear', 'negative'], 'sabotage': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'sacrifices': ['disgust', 'fear', 'negative', 'sadness'], 'sadly': ['negative', 'sadness'], 'sadness': ['negative', 'sadness', 'trust'], 'safe': ['joy', 'positive', 'trust'], 'safeguard': ['positive', 'trust'], 'safekeeping': ['trust'], 'sag': ['fear', 'negative'], 'sage': ['positive', 'trust'], 'saint': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'saintly': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'salary': ['anticipation', 'joy', 'positive', 'trust'], 'salient': ['positive'], 'saliva': ['anticipation'], 'sally': ['surprise'], 'saloon': ['anger'], 'salutary': ['joy', 'positive', 'trust'], 'salute': ['joy', 'positive'], 'salvation': ['anticipation', 'joy', 'positive', 'trust'], 'salve': ['positive'], 'samurai': ['fear', 'positive'], 'sanctification': ['joy', 'positive', 'trust'], 'sanctify': ['anticipation', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'sanctuary': ['anticipation', 'joy', 'positive', 'trust'], 'sanguine': ['positive'], 'sanitary': ['positive'], 'sap': ['negative', 'sadness'], 'sappy': ['trust'], 'sarcasm': ['anger', 'disgust', 'negative', 'sadness'], 'sarcoma': ['fear', 'negative', 'sadness'], 'sardonic': ['negative'], 'satanic': ['anger', 'negative'], 'satin': ['positive'], 'satisfactorily': ['positive'], 'satisfied': ['joy', 'positive'], 'saturated': ['disgust', 'negative'], 'savage': ['anger', 'fear', 'negative'], 'savagery': ['anger', 'fear', 'negative'], 'save': ['joy', 'positive', 'trust'], 'savings': ['positive'], 'savor': ['anticipation', 'disgust', 'joy', 'positive', 'sadness', 'trust'], 'savory': ['positive'], 'savvy': ['positive'], 'scab': ['negative'], 'scaffold': ['fear', 'negative'], 'scalpel': ['fear', 'negative'], 'scaly': ['negative'], 'scandal': ['fear', 'negative'], 'scandalous': ['anger', 'negative'], 'scanty': ['negative'], 'scapegoat': ['anger', 'fear', 'negative'], 'scar': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'scarce': ['fear', 'negative', 'sadness'], 'scarcely': ['negative', 'sadness'], 'scarcity': ['anger', 'fear', 'negative', 'sadness'], 'scare': ['anger', 'anticipation', 'fear', 'negative', 'surprise'], 'scarecrow': ['fear', 'negative', 'positive'], 'scavenger': ['negative'], 'sceptical': ['trust'], 'scheme': ['negative'], 'schism': ['anger', 'negative'], 'schizophrenia': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'scholar': ['positive'], 'scholarship': ['joy', 'positive'], 'school': ['trust'], 'sciatica': ['negative'], 'scientific': ['positive', 'trust'], 'scientist': ['anticipation', 'positive', 'trust'], 'scintilla': ['positive'], 'scoff': ['anger', 'disgust', 'negative'], 'scold': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'scolding': ['anger', 'negative'], 'scorching': ['anger', 'negative'], 'score': ['anticipation', 'joy', 'positive', 'surprise'], 'scorn': ['anger', 'negative'], 'scorpion': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'scotch': ['negative'], 'scoundrel': ['anger', 'disgust', 'fear', 'negative', 'trust'], 'scourge': ['anger', 'fear', 'negative', 'sadness'], 'scrambling': ['negative'], 'scrapie': ['anger', 'fear', 'negative', 'sadness'], 'scream': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'screaming': ['anger', 'disgust', 'fear', 'negative'], 'screech': ['fear', 'negative', 'surprise'], 'screwed': ['anger', 'negative'], 'scribe': ['positive'], 'scrimmage': ['negative', 'surprise'], 'script': ['positive'], 'scripture': ['trust'], 'scrub': ['disgust', 'negative'], 'scrumptious': ['positive'], 'scrutinize': ['anticipation', 'negative'], 'scrutiny': ['negative'], 'sculpture': ['positive'], 'scum': ['disgust', 'negative'], 'sea': ['positive'], 'seal': ['positive', 'trust'], 'seals': ['trust'], 'sear': ['negative'], 'seasoned': ['positive'], 'secession': ['negative'], 'secluded': ['negative', 'sadness'], 'seclusion': ['fear', 'negative', 'positive'], 'secondhand': ['negative'], 'secrecy': ['surprise', 'trust'], 'secret': ['trust'], 'secretariat': ['positive'], 'secrete': ['disgust'], 'secretion': ['disgust', 'negative'], 'secretive': ['negative'], 'sectarian': ['anger', 'fear', 'negative'], 'secular': ['anticipation'], 'securities': ['trust'], 'sedition': ['anger', 'negative', 'sadness'], 'seduce': ['negative'], 'seduction': ['negative'], 'seductive': ['anticipation'], 'seek': ['anticipation'], 'segregate': ['anger', 'disgust', 'negative', 'sadness'], 'segregated': ['negative'], 'seize': ['fear', 'negative'], 'seizure': ['fear'], 'selfish': ['anger', 'disgust', 'negative'], 'selfishness': ['negative'], 'senate': ['trust'], 'senile': ['fear', 'negative', 'sadness'], 'seniority': ['positive', 'trust'], 'sensational': ['joy', 'positive'], 'sense': ['positive'], 'senseless': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'sensibility': ['positive'], 'sensibly': ['positive'], 'sensual': ['anticipation', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'sensuality': ['anticipation', 'joy', 'positive'], 'sensuous': ['joy', 'positive'], 'sentence': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'sentimental': ['positive'], 'sentimentality': ['positive'], 'sentinel': ['positive', 'trust'], 'sentry': ['trust'], 'separatist': ['anger', 'disgust', 'negative'], 'sepsis': ['fear', 'negative', 'sadness'], 'septic': ['disgust', 'negative'], 'sequel': ['anticipation'], 'sequestration': ['negative', 'sadness'], 'serene': ['negative', 'trust'], 'serenity': ['anticipation', 'joy', 'positive', 'trust'], 'serial': ['anticipation'], 'series': ['trust'], 'seriousness': ['fear', 'sadness'], 'sermon': ['positive', 'trust'], 'serpent': ['disgust', 'fear', 'negative'], 'serum': ['positive'], 'servant': ['negative', 'trust'], 'serve': ['negative', 'trust'], 'servile': ['disgust', 'fear', 'negative', 'sadness'], 'servitude': ['negative'], 'setback': ['negative', 'sadness'], 'settlor': ['fear', 'positive'], 'sever': ['negative'], 'severance': ['sadness'], 'sewage': ['disgust', 'negative'], 'sewer': ['disgust'], 'sewerage': ['disgust', 'negative'], 'sex': ['anticipation', 'joy', 'positive', 'trust'], 'shabby': ['disgust', 'negative'], 'shack': ['disgust', 'negative', 'sadness'], 'shackle': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'shady': ['fear', 'negative'], 'shaking': ['fear', 'negative'], 'shaky': ['anger', 'anticipation', 'fear', 'negative'], 'sham': ['anger', 'disgust', 'negative'], 'shambles': ['negative'], 'shame': ['disgust', 'fear', 'negative', 'sadness'], 'shameful': ['negative', 'sadness'], 'shameless': ['disgust', 'negative'], 'shanghai': ['disgust', 'fear', 'negative'], 'shank': ['fear'], 'shape': ['positive'], 'shapely': ['positive'], 'share': ['anticipation', 'joy', 'positive', 'trust'], 'shark': ['negative'], 'sharpen': ['anger', 'anticipation'], 'shatter': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'shattered': ['negative', 'sadness'], 'shed': ['negative'], 'shell': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'shelter': ['positive', 'trust'], 'shelved': ['negative'], 'shepherd': ['positive', 'trust'], 'sheriff': ['trust'], 'shine': ['positive'], 'shining': ['anticipation', 'joy', 'positive'], 'ship': ['anticipation'], 'shipwreck': ['fear', 'negative', 'sadness'], 'shit': ['anger', 'disgust', 'negative'], 'shiver': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'shock': ['anger', 'fear', 'negative', 'surprise'], 'shockingly': ['surprise'], 'shoddy': ['anger', 'disgust', 'negative'], 'shoot': ['anger', 'fear', 'negative'], 'shooter': ['fear'], 'shooting': ['anger', 'fear', 'negative'], 'shopkeeper': ['trust'], 'shoplifting': ['anger', 'disgust', 'negative'], 'shopping': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'shortage': ['anger', 'fear', 'negative', 'sadness'], 'shortcoming': ['negative'], 'shortly': ['anticipation'], 'shot': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'shoulder': ['positive', 'trust'], 'shout': ['anger', 'surprise'], 'shove': ['anger', 'negative'], 'show': ['trust'], 'showy': ['negative'], 'shrapnel': ['fear'], 'shrewd': ['positive'], 'shriek': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'shrill': ['anger', 'fear', 'negative', 'surprise'], 'shrink': ['fear', 'negative', 'sadness'], 'shroud': ['sadness'], 'shrunk': ['negative'], 'shudder': ['fear', 'negative'], 'shun': ['anger', 'disgust', 'negative', 'sadness'], 'sib': ['trust'], 'sick': ['disgust', 'negative', 'sadness'], 'sickening': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sickly': ['disgust', 'negative', 'sadness'], 'sickness': ['disgust', 'fear', 'negative', 'sadness'], 'signature': ['trust'], 'signify': ['anticipation'], 'silk': ['positive'], 'silly': ['joy', 'negative'], 'simmer': ['anger', 'anticipation'], 'simmering': ['anticipation'], 'simplify': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'sin': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sincere': ['positive', 'trust'], 'sincerity': ['positive'], 'sinful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sing': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'singly': ['positive'], 'singularly': ['surprise'], 'sinister': ['anger', 'disgust', 'fear', 'negative'], 'sinner': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sinning': ['disgust', 'negative'], 'sir': ['positive', 'trust'], 'siren': ['fear', 'negative'], 'sissy': ['negative'], 'sisterhood': ['anger', 'positive', 'sadness', 'surprise', 'trust'], 'sizzle': ['anger'], 'skeptical': ['negative'], 'sketchy': ['negative'], 'skewed': ['anger', 'anticipation', 'negative'], 'skid': ['anger', 'fear', 'negative', 'sadness'], 'skilled': ['positive'], 'skillful': ['positive', 'trust'], 'skip': ['negative'], 'skirmish': ['anger', 'negative'], 'sky': ['positive'], 'slack': ['negative'], 'slag': ['negative'], 'slam': ['anger', 'fear', 'negative', 'surprise'], 'slander': ['anger', 'disgust', 'negative'], 'slanderous': ['negative'], 'slap': ['anger', 'negative', 'surprise'], 'slash': ['anger'], 'slate': ['positive'], 'slaughter': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'slaughterhouse': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'slaughtering': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'slave': ['anger', 'fear', 'negative', 'sadness'], 'slavery': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'slay': ['anger', 'negative'], 'slayer': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'sleek': ['positive'], 'sleet': ['negative'], 'slender': ['positive'], 'slim': ['positive'], 'slime': ['disgust'], 'slimy': ['disgust', 'negative'], 'slink': ['negative'], 'slip': ['negative', 'surprise'], 'slop': ['disgust', 'negative'], 'sloppy': ['disgust', 'negative'], 'sloth': ['disgust', 'negative'], 'slouch': ['negative'], 'slough': ['negative'], 'slowness': ['negative'], 'sludge': ['disgust', 'negative'], 'slug': ['disgust', 'negative'], 'sluggish': ['negative', 'sadness'], 'slum': ['disgust', 'negative'], 'slump': ['negative', 'sadness'], 'slur': ['anger', 'disgust', 'negative', 'sadness'], 'slush': ['disgust', 'negative', 'surprise'], 'slut': ['anger', 'disgust', 'negative'], 'sly': ['anger', 'disgust', 'fear', 'negative'], 'smack': ['anger', 'negative'], 'small': ['negative'], 'smash': ['anger', 'fear', 'negative'], 'smashed': ['negative'], 'smattering': ['negative'], 'smell': ['anger', 'disgust', 'negative'], 'smelling': ['disgust', 'negative'], 'smile': ['joy', 'positive', 'surprise', 'trust'], 'smiling': ['joy', 'positive'], 'smirk': ['negative'], 'smite': ['anger', 'fear', 'negative', 'sadness'], 'smith': ['trust'], 'smitten': ['positive'], 'smoker': ['negative'], 'smoothness': ['positive'], 'smother': ['anger', 'negative'], 'smudge': ['negative'], 'smug': ['negative'], 'smuggle': ['fear', 'negative'], 'smuggler': ['anger', 'disgust', 'fear', 'negative'], 'smuggling': ['negative'], 'smut': ['disgust', 'fear', 'negative'], 'snag': ['negative', 'surprise'], 'snags': ['negative'], 'snake': ['disgust', 'fear', 'negative'], 'snare': ['fear', 'negative'], 'snarl': ['anger', 'disgust', 'negative'], 'snarling': ['anger', 'negative'], 'sneak': ['anger', 'fear', 'negative', 'surprise'], 'sneaking': ['anticipation', 'fear', 'negative', 'trust'], 'sneer': ['anger', 'disgust', 'negative'], 'sneeze': ['disgust', 'negative', 'surprise'], 'snicker': ['positive'], 'snide': ['negative'], 'snob': ['negative'], 'snort': ['sadness'], 'soak': ['negative'], 'sob': ['negative', 'sadness'], 'sobriety': ['positive', 'trust'], 'sociable': ['positive'], 'socialism': ['disgust', 'fear'], 'socialist': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'soil': ['disgust', 'negative'], 'soiled': ['disgust', 'negative'], 'solace': ['positive'], 'soldier': ['anger', 'positive', 'sadness'], 'solid': ['positive'], 'solidarity': ['trust'], 'solidity': ['positive', 'trust'], 'solution': ['positive'], 'solvency': ['positive'], 'somatic': ['negative', 'surprise'], 'somber': ['negative', 'sadness'], 'sonar': ['anticipation', 'positive'], 'sonata': ['positive'], 'sonnet': ['joy', 'positive', 'sadness'], 'sonorous': ['joy', 'positive'], 'soot': ['disgust', 'negative'], 'soothe': ['positive'], 'soothing': ['joy', 'positive', 'trust'], 'sorcery': ['anticipation', 'fear', 'negative', 'surprise'], 'sordid': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sore': ['anger', 'negative', 'sadness'], 'sorely': ['negative', 'sadness'], 'soreness': ['disgust', 'negative', 'sadness'], 'sorrow': ['fear', 'negative', 'sadness'], 'sorrowful': ['negative', 'sadness'], 'sorter': ['positive'], 'sortie': ['fear', 'negative'], 'soulless': ['disgust', 'fear', 'negative', 'sadness'], 'soulmate': ['fear', 'negative'], 'soundness': ['anticipation', 'joy', 'positive', 'trust'], 'soup': ['positive'], 'sour': ['disgust', 'negative'], 'sovereign': ['trust'], 'spa': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'spacious': ['positive'], 'spaniel': ['joy', 'positive', 'trust'], 'spank': ['anger', 'fear', 'negative', 'sadness'], 'spanking': ['anger'], 'sparkle': ['anticipation', 'joy', 'positive', 'surprise'], 'spasm': ['fear', 'negative'], 'spat': ['anger', 'negative'], 'spear': ['anger', 'anticipation', 'fear', 'negative'], 'special': ['joy', 'positive'], 'specialist': ['trust'], 'specialize': ['trust'], 'specie': ['positive'], 'speck': ['disgust', 'negative'], 'spectacle': ['negative', 'positive'], 'spectacular': ['anticipation', 'surprise'], 'specter': ['fear', 'negative', 'sadness'], 'spectral': ['negative'], 'speculation': ['fear', 'negative', 'sadness'], 'speculative': ['anticipation'], 'speech': ['positive'], 'speedy': ['positive'], 'spelling': ['positive'], 'spent': ['negative'], 'spew': ['disgust'], 'spice': ['positive'], 'spider': ['disgust', 'fear'], 'spike': ['fear'], 'spine': ['anger', 'negative', 'positive'], 'spinster': ['fear', 'negative', 'sadness'], 'spirit': ['positive'], 'spirits': ['anticipation', 'joy', 'positive', 'surprise'], 'spit': ['disgust'], 'spite': ['anger', 'negative'], 'spiteful': ['anger', 'negative'], 'splash': ['surprise'], 'splendid': ['joy', 'positive', 'surprise'], 'splendor': ['anticipation', 'joy', 'positive', 'surprise'], 'splinter': ['negative'], 'split': ['negative'], 'splitting': ['negative', 'sadness'], 'spoil': ['disgust', 'negative'], 'spoiler': ['negative', 'sadness'], 'spoke': ['negative'], 'spokesman': ['trust'], 'sponge': ['negative'], 'sponsor': ['positive', 'trust'], 'spook': ['fear', 'negative'], 'spotless': ['positive', 'trust'], 'spouse': ['joy', 'positive', 'trust'], 'sprain': ['negative', 'sadness'], 'spree': ['negative'], 'sprite': ['fear', 'negative'], 'spruce': ['positive'], 'spur': ['fear'], 'spurious': ['disgust', 'negative'], 'squall': ['fear', 'negative', 'sadness'], 'squatter': ['negative'], 'squeamish': ['disgust', 'fear', 'negative'], 'squelch': ['anger', 'disgust', 'negative'], 'squirm': ['disgust', 'negative'], 'stab': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'stable': ['positive', 'trust'], 'staccato': ['positive'], 'stagger': ['surprise'], 'staggering': ['negative'], 'stagnant': ['negative', 'sadness'], 'stain': ['disgust', 'negative'], 'stainless': ['positive'], 'stale': ['negative'], 'stalemate': ['anger', 'disgust'], 'stalk': ['fear', 'negative'], 'stall': ['disgust'], 'stallion': ['positive'], 'stalwart': ['positive'], 'stamina': ['positive', 'trust'], 'standing': ['positive'], 'standoff': ['anger', 'fear', 'negative'], 'standstill': ['anger', 'negative'], 'star': ['anticipation', 'joy', 'positive', 'trust'], 'staring': ['negative'], 'stark': ['negative', 'trust'], 'starlight': ['positive'], 'starry': ['anticipation', 'joy', 'positive'], 'start': ['anticipation'], 'startle': ['fear', 'negative', 'surprise'], 'startling': ['surprise'], 'starvation': ['fear', 'negative', 'sadness'], 'starved': ['negative'], 'starving': ['negative'], 'stately': ['positive'], 'statement': ['positive', 'trust'], 'stationary': ['negative'], 'statistical': ['trust'], 'statue': ['positive'], 'status': ['positive'], 'staunch': ['positive'], 'stave': ['negative'], 'steadfast': ['positive', 'trust'], 'steady': ['surprise', 'trust'], 'steal': ['anger', 'fear', 'negative', 'sadness'], 'stealing': ['disgust', 'fear', 'negative'], 'stealth': ['surprise'], 'stealthily': ['surprise'], 'stealthy': ['anticipation', 'fear', 'negative', 'surprise'], 'stellar': ['positive'], 'stereotype': ['negative'], 'stereotyped': ['negative'], 'sterile': ['negative', 'sadness'], 'sterility': ['negative'], 'sterling': ['anger', 'anticipation', 'joy', 'negative', 'positive', 'trust'], 'stern': ['negative'], 'steward': ['positive', 'trust'], 'sticky': ['disgust'], 'stiff': ['negative'], 'stiffness': ['negative'], 'stifle': ['negative'], 'stifled': ['anger', 'fear', 'negative', 'sadness'], 'stigma': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'stillborn': ['negative', 'sadness'], 'stillness': ['fear', 'positive', 'sadness'], 'sting': ['anger', 'fear', 'negative'], 'stinging': ['negative'], 'stingy': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'stink': ['disgust', 'negative'], 'stinking': ['disgust', 'negative'], 'stint': ['fear', 'negative', 'sadness'], 'stocks': ['negative'], 'stolen': ['anger', 'negative'], 'stomach': ['disgust'], 'stone': ['anger', 'negative'], 'stoned': ['negative'], 'stools': ['disgust', 'negative'], 'stoppage': ['negative'], 'store': ['anticipation', 'positive'], 'storm': ['anger', 'negative'], 'storming': ['anger'], 'stormy': ['fear', 'negative'], 'straightforward': ['positive', 'trust'], 'strained': ['anger', 'negative'], 'straits': ['fear', 'negative'], 'stranded': ['negative'], 'stranger': ['fear', 'negative'], 'strangle': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'strategic': ['positive'], 'strategist': ['anticipation', 'positive', 'trust'], 'stray': ['negative'], 'strength': ['positive', 'trust'], 'strengthen': ['positive'], 'strengthening': ['joy', 'positive', 'trust'], 'stress': ['negative'], 'stretcher': ['fear', 'sadness'], 'stricken': ['sadness'], 'strife': ['anger', 'negative'], 'strike': ['anger', 'negative'], 'striking': ['positive'], 'strikingly': ['positive'], 'strip': ['negative', 'sadness'], 'stripe': ['negative'], 'stripped': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'strive': ['anticipation'], 'stroke': ['fear', 'negative', 'sadness'], 'strongly': ['positive'], 'structural': ['trust'], 'structure': ['positive', 'trust'], 'struggle': ['anger', 'fear', 'negative', 'sadness'], 'strut': ['negative'], 'stud': ['positive'], 'study': ['positive'], 'stuffy': ['negative'], 'stumble': ['negative'], 'stunned': ['fear', 'negative', 'surprise'], 'stunted': ['negative'], 'stupid': ['negative'], 'stupidity': ['negative'], 'stupor': ['negative'], 'sturdy': ['positive'], 'sty': ['disgust', 'negative'], 'subdue': ['negative'], 'subito': ['surprise'], 'subject': ['negative'], 'subjected': ['negative', 'sadness'], 'subjection': ['negative'], 'subjugation': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'sublimation': ['joy', 'positive'], 'submit': ['anticipation'], 'subordinate': ['fear', 'negative'], 'subpoena': ['negative'], 'subscribe': ['anticipation'], 'subsidence': ['negative', 'sadness'], 'subsidy': ['anger', 'disgust', 'negative'], 'subsist': ['negative'], 'substance': ['positive'], 'substantiate': ['trust'], 'substantive': ['positive'], 'subtract': ['negative'], 'subversion': ['anger', 'fear', 'negative'], 'subversive': ['anger', 'negative', 'surprise'], 'subvert': ['disgust', 'fear', 'negative', 'sadness'], 'succeed': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'succeeding': ['anticipation', 'joy', 'positive', 'trust'], 'success': ['anticipation', 'joy', 'positive'], 'successful': ['anticipation', 'joy', 'positive', 'trust'], 'succinct': ['positive'], 'succulent': ['negative', 'positive'], 'succumb': ['negative'], 'suck': ['negative'], 'sucker': ['anger', 'negative'], 'sudden': ['surprise'], 'suddenly': ['surprise'], 'sue': ['anger', 'negative', 'sadness'], 'suffer': ['negative'], 'sufferer': ['fear', 'negative', 'sadness'], 'suffering': ['disgust', 'fear', 'negative', 'sadness'], 'sufficiency': ['positive'], 'suffocating': ['disgust', 'fear', 'negative', 'sadness'], 'suffocation': ['anger', 'fear', 'negative'], 'sugar': ['positive'], 'suggest': ['trust'], 'suicidal': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'suicide': ['anger', 'fear', 'negative', 'sadness'], 'suitable': ['positive'], 'sullen': ['anger', 'negative', 'sadness'], 'sultan': ['fear'], 'sultry': ['positive'], 'summons': ['negative'], 'sump': ['disgust'], 'sun': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'sundial': ['anticipation', 'trust'], 'sunk': ['disgust', 'fear', 'negative', 'sadness'], 'sunny': ['anticipation', 'joy', 'positive', 'surprise'], 'sunset': ['anticipation', 'positive'], 'sunshine': ['joy', 'positive'], 'superb': ['positive'], 'superficial': ['negative'], 'superfluous': ['negative'], 'superhuman': ['positive'], 'superior': ['positive'], 'superiority': ['positive'], 'superman': ['joy', 'positive', 'trust'], 'superstar': ['joy', 'positive', 'trust'], 'superstition': ['fear', 'negative', 'positive'], 'superstitious': ['anticipation', 'fear', 'negative'], 'supplication': ['positive', 'trust'], 'supplies': ['positive'], 'supply': ['positive'], 'supported': ['positive'], 'supporter': ['joy', 'positive', 'trust'], 'supporting': ['positive', 'trust'], 'suppress': ['anger', 'fear', 'negative', 'sadness'], 'suppression': ['anger', 'disgust', 'fear', 'negative'], 'supremacy': ['anger', 'anticipation', 'fear', 'joy', 'negative', 'positive', 'surprise', 'trust'], 'supreme': ['positive'], 'supremely': ['positive'], 'surcharge': ['anger', 'negative'], 'surety': ['positive', 'trust'], 'surge': ['surprise'], 'surgery': ['fear', 'sadness'], 'surly': ['anger', 'disgust', 'negative'], 'surmise': ['positive'], 'surpassing': ['positive'], 'surprise': ['fear', 'joy', 'positive', 'surprise'], 'surprised': ['surprise'], 'surprising': ['surprise'], 'surprisingly': ['anticipation', 'surprise'], 'surrender': ['fear', 'negative', 'sadness'], 'surrendering': ['negative', 'sadness'], 'surrogate': ['trust'], 'surround': ['anticipation', 'negative', 'positive'], 'surveillance': ['fear'], 'surveying': ['positive'], 'survive': ['positive'], 'susceptible': ['negative'], 'suspect': ['fear', 'negative'], 'suspense': ['anticipation', 'fear', 'surprise'], 'suspension': ['fear', 'negative'], 'suspicion': ['fear', 'negative'], 'suspicious': ['anger', 'anticipation', 'negative'], 'swab': ['negative'], 'swamp': ['disgust', 'fear', 'negative'], 'swampy': ['disgust', 'fear', 'negative'], 'swarm': ['disgust'], 'swastika': ['anger', 'fear', 'negative'], 'swear': ['positive', 'trust'], 'sweat': ['fear'], 'sweet': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'sweetheart': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'sweetie': ['positive'], 'sweetness': ['positive'], 'sweets': ['anticipation', 'joy', 'positive'], 'swelling': ['fear', 'negative'], 'swerve': ['fear', 'surprise'], 'swift': ['positive'], 'swig': ['disgust', 'negative'], 'swim': ['anticipation', 'fear', 'joy', 'positive'], 'swine': ['disgust', 'negative'], 'swollen': ['negative'], 'symbolic': ['positive'], 'symmetrical': ['positive'], 'symmetry': ['joy', 'positive', 'trust'], 'sympathetic': ['fear', 'joy', 'positive', 'sadness', 'trust'], 'sympathize': ['sadness'], 'sympathy': ['positive', 'sadness'], 'symphony': ['anticipation', 'joy', 'positive'], 'symptom': ['negative'], 'synchronize': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'syncope': ['fear', 'negative', 'sadness', 'surprise'], 'synergistic': ['positive', 'trust'], 'synod': ['positive', 'trust'], 'synonymous': ['fear', 'negative', 'positive', 'trust'], 'syringe': ['fear'], 'system': ['trust'], 'taboo': ['disgust', 'fear', 'negative'], 'tabulate': ['anticipation'], 'tackle': ['anger', 'surprise'], 'tact': ['positive'], 'tactics': ['fear', 'trust'], 'taint': ['negative', 'sadness'], 'tale': ['positive'], 'talent': ['positive'], 'talisman': ['positive'], 'talk': ['positive'], 'talons': ['anger', 'fear', 'negative'], 'tandem': ['trust'], 'tangled': ['negative'], 'tanned': ['positive'], 'tantalizing': ['anticipation', 'joy', 'negative', 'positive', 'surprise'], 'tantamount': ['trust'], 'tardiness': ['negative'], 'tardy': ['negative'], 'tariff': ['anger', 'disgust', 'negative'], 'tarnish': ['disgust', 'negative', 'sadness'], 'tarry': ['negative'], 'task': ['positive'], 'tasteful': ['positive'], 'tasteless': ['disgust', 'negative'], 'tasty': ['positive'], 'taught': ['trust'], 'taunt': ['anger', 'fear', 'negative', 'sadness'], 'tawny': ['disgust'], 'tax': ['negative', 'sadness'], 'teach': ['joy', 'positive', 'surprise', 'trust'], 'teacher': ['positive', 'trust'], 'team': ['trust'], 'tearful': ['disgust', 'fear', 'sadness'], 'tease': ['anger', 'anticipation', 'negative', 'sadness'], 'teasing': ['anger', 'fear', 'negative'], 'technology': ['positive'], 'tedious': ['negative'], 'tedium': ['negative'], 'teeming': ['disgust'], 'teens': ['negative', 'positive'], 'temperance': ['positive'], 'temperate': ['trust'], 'tempered': ['positive'], 'tempest': ['anger', 'anticipation', 'fear', 'negative', 'sadness', 'surprise'], 'temptation': ['negative'], 'tenable': ['positive'], 'tenacious': ['positive'], 'tenacity': ['positive'], 'tenancy': ['positive'], 'tenant': ['positive'], 'tender': ['joy', 'positive', 'trust'], 'tenderness': ['joy', 'positive'], 'tenement': ['negative'], 'tension': ['anger'], 'terminal': ['fear', 'negative', 'sadness'], 'terminate': ['sadness'], 'termination': ['negative', 'sadness'], 'termite': ['disgust', 'negative'], 'terrible': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'terribly': ['sadness'], 'terrific': ['sadness'], 'terror': ['fear', 'negative'], 'terrorism': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'terrorist': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'terrorize': ['anger', 'fear', 'negative', 'sadness'], 'testament': ['anticipation', 'trust'], 'testimony': ['trust'], 'tetanus': ['disgust', 'negative'], 'tether': ['negative'], 'thankful': ['joy', 'positive'], 'thanksgiving': ['joy', 'positive'], 'theft': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'theism': ['disgust', 'negative'], 'theocratic': ['anger', 'fear', 'negative', 'sadness', 'trust'], 'theological': ['trust'], 'theology': ['anticipation'], 'theorem': ['trust'], 'theoretical': ['positive'], 'theory': ['anticipation', 'trust'], 'therapeutic': ['joy', 'positive', 'trust'], 'therapeutics': ['positive'], 'thermocouple': ['anticipation'], 'thermometer': ['trust'], 'thief': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'thinker': ['positive'], 'thirst': ['anticipation', 'sadness', 'surprise'], 'thirsty': ['negative'], 'thirteenth': ['fear'], 'thorn': ['negative'], 'thorny': ['fear', 'negative'], 'thoroughbred': ['positive'], 'thought': ['anticipation'], 'thoughtful': ['positive', 'trust'], 'thoughtfulness': ['positive'], 'thoughtless': ['anger', 'disgust', 'negative'], 'thrash': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'threat': ['anger', 'fear', 'negative'], 'threaten': ['anger', 'anticipation', 'fear', 'negative'], 'threatening': ['anger', 'disgust', 'fear', 'negative'], 'thresh': ['anger', 'fear', 'negative', 'sadness'], 'thrift': ['disgust', 'positive', 'trust'], 'thrill': ['anticipation', 'fear', 'joy', 'positive', 'surprise'], 'thrilling': ['anticipation', 'joy', 'positive', 'surprise'], 'thriving': ['anticipation', 'joy', 'positive'], 'throb': ['fear', 'negative', 'sadness'], 'throne': ['positive', 'trust'], 'throttle': ['anger', 'negative'], 'thug': ['anger', 'disgust', 'fear', 'negative'], 'thump': ['anger', 'negative'], 'thumping': ['fear'], 'thundering': ['anger', 'fear', 'negative'], 'thwart': ['negative', 'surprise'], 'tickle': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'tiff': ['anger', 'negative'], 'tighten': ['anger'], 'tiling': ['positive'], 'time': ['anticipation'], 'timely': ['positive'], 'timid': ['fear', 'negative', 'sadness'], 'timidity': ['anticipation', 'fear', 'negative'], 'tinsel': ['joy', 'positive'], 'tipsy': ['negative'], 'tirade': ['anger', 'disgust', 'negative'], 'tired': ['negative'], 'tiredness': ['negative'], 'tiresome': ['negative'], 'tit': ['negative'], 'title': ['positive', 'trust'], 'toad': ['disgust', 'negative'], 'toast': ['joy', 'positive'], 'tobacco': ['negative'], 'toilet': ['disgust', 'negative'], 'toils': ['negative'], 'tolerant': ['positive'], 'tolerate': ['anger', 'negative', 'sadness'], 'toleration': ['positive'], 'tomb': ['sadness'], 'tomorrow': ['anticipation'], 'toothache': ['fear', 'negative'], 'top': ['anticipation', 'positive', 'trust'], 'topple': ['surprise'], 'torment': ['anger', 'fear', 'negative', 'sadness'], 'torn': ['negative'], 'tornado': ['fear'], 'torpedo': ['anger', 'negative'], 'torrent': ['fear'], 'torrid': ['negative'], 'tort': ['negative'], 'tortious': ['anger', 'disgust', 'negative'], 'torture': ['anger', 'anticipation', 'disgust', 'fear', 'negative', 'sadness'], 'touched': ['negative'], 'touchy': ['anger', 'negative', 'sadness'], 'tough': ['negative', 'sadness'], 'toughness': ['anger', 'fear', 'positive', 'trust'], 'tower': ['positive'], 'towering': ['anticipation', 'fear', 'positive'], 'toxic': ['disgust', 'negative'], 'toxin': ['fear', 'negative'], 'track': ['anticipation'], 'tract': ['fear'], 'trade': ['trust'], 'traditional': ['positive'], 'tragedy': ['fear', 'negative', 'sadness'], 'tragic': ['negative'], 'trainer': ['trust'], 'traitor': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'tramp': ['disgust', 'fear', 'negative', 'sadness'], 'trance': ['negative'], 'tranquil': ['joy', 'positive'], 'tranquility': ['joy', 'positive', 'trust'], 'transaction': ['trust'], 'transcendence': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'transcendental': ['positive'], 'transcript': ['trust'], 'transgression': ['negative'], 'transitional': ['anticipation'], 'translation': ['trust'], 'trappings': ['negative'], 'traps': ['negative'], 'trash': ['disgust', 'negative', 'sadness'], 'trashy': ['disgust', 'negative'], 'traumatic': ['anger', 'fear', 'negative', 'sadness'], 'travail': ['negative'], 'traveling': ['positive'], 'travesty': ['disgust', 'fear', 'negative', 'sadness'], 'treacherous': ['anger', 'disgust', 'fear', 'negative'], 'treachery': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'treadmill': ['anticipation'], 'treason': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'treasure': ['anticipation', 'joy', 'positive', 'trust'], 'treasurer': ['trust'], 'treat': ['anger', 'anticipation', 'disgust', 'fear', 'joy', 'negative', 'positive', 'sadness', 'surprise', 'trust'], 'tree': ['anger', 'anticipation', 'disgust', 'joy', 'positive', 'surprise', 'trust'], 'trembling': ['fear', 'negative'], 'tremendously': ['positive'], 'tremor': ['anger', 'anticipation', 'fear', 'negative', 'sadness'], 'trend': ['positive'], 'trendy': ['positive'], 'trepidation': ['anticipation', 'fear', 'negative', 'surprise'], 'trespass': ['anger', 'negative'], 'tribe': ['trust'], 'tribulation': ['fear', 'negative', 'sadness'], 'tribunal': ['anticipation', 'disgust', 'fear', 'negative', 'trust'], 'tribune': ['trust'], 'tributary': ['anticipation', 'positive'], 'tribute': ['positive'], 'trick': ['negative', 'surprise'], 'trickery': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'trifle': ['negative'], 'trig': ['positive'], 'trip': ['surprise'], 'tripping': ['anger', 'negative', 'sadness'], 'triumph': ['anticipation', 'joy', 'positive'], 'triumphant': ['anticipation', 'joy', 'positive', 'trust'], 'troll': ['anger', 'fear', 'negative'], 'trophy': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'troublesome': ['anger', 'fear', 'negative'], 'truce': ['joy', 'positive', 'trust'], 'truck': ['trust'], 'true': ['joy', 'positive', 'trust'], 'trump': ['surprise'], 'trumpet': ['negative'], 'truss': ['trust'], 'trust': ['trust'], 'trustee': ['trust'], 'trusty': ['positive'], 'truth': ['positive', 'trust'], 'truthful': ['trust'], 'truthfulness': ['positive', 'trust'], 'tumble': ['negative'], 'tumor': ['fear', 'negative'], 'tumour': ['fear', 'negative', 'sadness'], 'tumult': ['anger', 'fear', 'negative', 'surprise'], 'tumultuous': ['anger', 'fear', 'negative'], 'turbulence': ['anger', 'fear', 'negative'], 'turbulent': ['fear', 'negative'], 'turmoil': ['anger', 'fear', 'negative', 'sadness'], 'tussle': ['anger'], 'tutelage': ['positive', 'trust'], 'tutor': ['positive'], 'twin': ['positive'], 'twinkle': ['anticipation', 'joy', 'positive'], 'twitch': ['negative'], 'typhoon': ['fear', 'negative'], 'tyrannical': ['anger', 'disgust', 'fear', 'negative'], 'tyranny': ['fear', 'negative', 'sadness'], 'tyrant': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'ugliness': ['disgust', 'fear', 'negative', 'sadness'], 'ugly': ['disgust', 'negative'], 'ulcer': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'ulterior': ['negative'], 'ultimate': ['anticipation', 'sadness'], 'ultimately': ['anticipation', 'positive'], 'ultimatum': ['anger', 'fear', 'negative'], 'umpire': ['positive', 'trust'], 'unable': ['negative', 'sadness'], 'unacceptable': ['negative', 'sadness'], 'unaccountable': ['anticipation', 'disgust', 'negative', 'sadness', 'trust'], 'unacknowledged': ['sadness'], 'unanimity': ['positive'], 'unanimous': ['positive'], 'unanticipated': ['surprise'], 'unapproved': ['negative'], 'unassuming': ['positive'], 'unattached': ['negative'], 'unattainable': ['anger', 'negative', 'sadness'], 'unattractive': ['disgust', 'negative', 'sadness'], 'unauthorized': ['negative'], 'unavoidable': ['negative'], 'unaware': ['negative'], 'unbearable': ['disgust', 'negative', 'sadness'], 'unbeaten': ['anticipation', 'joy', 'negative', 'positive', 'sadness', 'surprise'], 'unbelief': ['negative'], 'unbelievable': ['negative'], 'unbiased': ['positive'], 'unborn': ['negative'], 'unbreakable': ['positive'], 'unbridled': ['anger', 'anticipation', 'fear', 'negative', 'positive', 'surprise'], 'unbroken': ['positive', 'trust'], 'uncanny': ['fear', 'negative', 'surprise'], 'uncaring': ['anger', 'disgust', 'negative', 'sadness'], 'uncertain': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'unchangeable': ['negative'], 'unclean': ['disgust', 'negative'], 'uncomfortable': ['negative'], 'unconscionable': ['disgust', 'negative'], 'unconscious': ['negative'], 'unconstitutional': ['negative'], 'unconstrained': ['joy', 'positive'], 'uncontrollable': ['anger', 'anticipation', 'negative', 'surprise'], 'uncontrolled': ['negative'], 'uncover': ['surprise'], 'undecided': ['anticipation', 'fear', 'negative'], 'underestimate': ['surprise'], 'underline': ['positive'], 'undermined': ['negative'], 'underpaid': ['anger', 'negative', 'sadness'], 'undersized': ['negative'], 'understanding': ['positive', 'trust'], 'undertaker': ['sadness'], 'undertaking': ['anticipation'], 'underwrite': ['positive', 'trust'], 'undesirable': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'undesired': ['negative', 'sadness'], 'undisclosed': ['anticipation'], 'undiscovered': ['surprise'], 'undivided': ['positive'], 'undo': ['negative'], 'undoubted': ['anticipation', 'disgust'], 'undying': ['anticipation', 'joy', 'positive', 'sadness', 'trust'], 'uneasiness': ['anticipation', 'negative', 'sadness'], 'uneasy': ['disgust', 'fear', 'negative'], 'uneducated': ['negative', 'sadness'], 'unemployed': ['fear', 'negative', 'sadness'], 'unequal': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'unequivocal': ['trust'], 'unequivocally': ['positive'], 'uneven': ['negative'], 'unexpected': ['anticipation', 'fear', 'joy', 'negative', 'positive', 'surprise'], 'unexpectedly': ['surprise'], 'unexplained': ['anticipation', 'negative', 'sadness'], 'unfair': ['anger', 'disgust', 'negative', 'sadness'], 'unfairness': ['anger', 'negative', 'sadness'], 'unfaithful': ['disgust', 'negative'], 'unfavorable': ['disgust', 'negative', 'sadness'], 'unfinished': ['negative'], 'unfold': ['anticipation', 'positive'], 'unforeseen': ['surprise'], 'unforgiving': ['anger', 'negative', 'sadness'], 'unfortunate': ['negative', 'sadness'], 'unfriendly': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'unfulfilled': ['anger', 'anticipation', 'negative', 'sadness', 'surprise'], 'unfurnished': ['negative'], 'ungodly': ['negative', 'sadness'], 'ungrateful': ['anger', 'disgust', 'negative'], 'unguarded': ['surprise'], 'unhappiness': ['negative', 'sadness'], 'unhappy': ['anger', 'disgust', 'negative', 'sadness'], 'unhealthy': ['disgust', 'fear', 'negative', 'sadness'], 'unholy': ['fear', 'negative'], 'unification': ['anticipation', 'joy', 'positive', 'trust'], 'uniformly': ['positive'], 'unimaginable': ['negative', 'positive', 'surprise'], 'unimportant': ['negative', 'sadness'], 'unimpressed': ['negative'], 'unimproved': ['negative'], 'uninfected': ['positive'], 'uninformed': ['negative'], 'uninitiated': ['negative'], 'uninspired': ['negative', 'sadness'], 'unintelligible': ['negative'], 'unintended': ['surprise'], 'unintentional': ['surprise'], 'unintentionally': ['negative', 'surprise'], 'uninterested': ['negative', 'sadness'], 'uninteresting': ['negative', 'sadness'], 'uninvited': ['sadness'], 'unique': ['positive', 'surprise'], 'unison': ['positive'], 'unitary': ['positive'], 'united': ['positive', 'trust'], 'unity': ['positive', 'trust'], 'university': ['anticipation', 'positive'], 'unjust': ['anger', 'negative'], 'unjustifiable': ['anger', 'disgust', 'fear', 'negative'], 'unjustified': ['negative'], 'unkind': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'unknown': ['anticipation', 'fear', 'negative'], 'unlawful': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'unlicensed': ['negative'], 'unlimited': ['positive'], 'unlucky': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'unmanageable': ['disgust', 'negative'], 'unnatural': ['disgust', 'fear', 'negative'], 'unofficial': ['negative'], 'unpaid': ['anger', 'negative', 'sadness'], 'unpleasant': ['disgust', 'negative', 'sadness'], 'unpopular': ['disgust', 'negative', 'sadness'], 'unprecedented': ['surprise'], 'unpredictable': ['negative', 'surprise'], 'unprepared': ['negative'], 'unpretentious': ['positive'], 'unproductive': ['negative'], 'unprofitable': ['negative'], 'unprotected': ['negative'], 'unpublished': ['anticipation', 'negative', 'sadness'], 'unquestionable': ['positive', 'trust'], 'unquestionably': ['positive', 'trust'], 'unquestioned': ['positive', 'trust'], 'unreliable': ['negative', 'trust'], 'unrequited': ['negative', 'sadness'], 'unresolved': ['anticipation'], 'unrest': ['fear', 'sadness'], 'unruly': ['anger', 'disgust', 'fear', 'negative'], 'unsafe': ['fear', 'negative'], 'unsatisfactory': ['disgust', 'negative'], 'unsatisfied': ['disgust', 'negative', 'sadness'], 'unsavory': ['negative'], 'unscathed': ['positive'], 'unscrupulous': ['negative'], 'unseat': ['sadness'], 'unselfish': ['positive'], 'unsettled': ['anger', 'disgust', 'fear', 'negative'], 'unsightly': ['disgust', 'negative'], 'unsophisticated': ['negative'], 'unspeakable': ['fear', 'negative'], 'unstable': ['fear', 'negative', 'surprise'], 'unsteady': ['fear'], 'unsuccessful': ['negative', 'sadness'], 'unsuitable': ['negative'], 'unsung': ['negative'], 'unsupported': ['negative'], 'unsurpassed': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'unsuspecting': ['surprise'], 'unsustainable': ['negative'], 'unsympathetic': ['anger', 'negative'], 'untamed': ['negative'], 'untenable': ['negative'], 'unthinkable': ['anger', 'disgust', 'fear', 'negative'], 'untidy': ['disgust', 'negative'], 'untie': ['joy', 'negative', 'positive'], 'untimely': ['negative'], 'untitled': ['negative', 'sadness'], 'untold': ['anticipation', 'negative'], 'untoward': ['anger', 'disgust', 'negative'], 'untrained': ['negative'], 'untrue': ['negative'], 'untrustworthy': ['anger', 'negative'], 'unverified': ['anticipation'], 'unwarranted': ['negative'], 'unwashed': ['disgust', 'negative'], 'unwavering': ['positive', 'trust'], 'unwelcome': ['negative', 'sadness'], 'unwell': ['negative', 'sadness'], 'unwillingness': ['negative'], 'unwise': ['negative'], 'unwitting': ['negative'], 'unworthy': ['disgust', 'negative'], 'unyielding': ['negative'], 'upheaval': ['anger', 'fear', 'negative', 'sadness'], 'uphill': ['anticipation', 'fear', 'negative', 'positive'], 'uplift': ['anticipation', 'joy', 'positive', 'trust'], 'upright': ['positive', 'trust'], 'uprising': ['anger', 'anticipation', 'fear', 'negative'], 'uproar': ['negative'], 'upset': ['anger', 'negative', 'sadness'], 'urchin': ['negative'], 'urgency': ['anticipation', 'fear', 'surprise'], 'urgent': ['anticipation', 'fear', 'negative', 'surprise'], 'urn': ['sadness'], 'usefulness': ['positive'], 'useless': ['negative'], 'usher': ['positive', 'trust'], 'usual': ['positive', 'trust'], 'usurp': ['anger', 'negative'], 'usurped': ['anger', 'fear', 'negative'], 'usury': ['negative'], 'utility': ['positive'], 'utopian': ['anticipation', 'joy', 'positive', 'trust'], 'vacancy': ['negative'], 'vacation': ['anticipation', 'joy', 'positive'], 'vaccine': ['positive'], 'vacuous': ['disgust', 'negative'], 'vague': ['negative'], 'vagueness': ['negative'], 'vainly': ['disgust', 'negative', 'sadness'], 'valiant': ['positive'], 'validity': ['fear'], 'valor': ['positive', 'trust'], 'valuable': ['positive'], 'vampire': ['anger', 'disgust', 'fear', 'negative'], 'vanguard': ['positive'], 'vanish': ['surprise'], 'vanished': ['fear', 'negative', 'sadness', 'surprise'], 'vanity': ['negative'], 'vanquish': ['positive'], 'variable': ['surprise'], 'varicella': ['disgust', 'fear', 'negative', 'sadness'], 'varicose': ['negative'], 'veal': ['sadness', 'trust'], 'veer': ['fear', 'surprise'], 'vegetative': ['disgust', 'negative', 'sadness'], 'vehement': ['anger', 'fear', 'negative'], 'velvet': ['positive'], 'velvety': ['positive'], 'vendetta': ['anger', 'fear', 'negative', 'sadness'], 'venerable': ['anticipation', 'joy', 'positive', 'trust'], 'veneration': ['positive'], 'vengeance': ['anger', 'negative'], 'vengeful': ['anger', 'fear', 'negative'], 'venom': ['anger', 'disgust', 'fear', 'negative'], 'venomous': ['anger', 'disgust', 'fear', 'negative'], 'vent': ['anger'], 'veracity': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'verbosity': ['negative'], 'verdant': ['positive'], 'verdict': ['fear'], 'verge': ['anticipation', 'fear', 'negative'], 'verification': ['positive', 'trust'], 'verified': ['positive', 'trust'], 'verily': ['positive', 'trust'], 'veritable': ['positive'], 'vermin': ['anger', 'disgust', 'fear', 'negative'], 'vernal': ['joy', 'positive'], 'versus': ['anger', 'negative'], 'vertigo': ['fear', 'negative'], 'verve': ['positive'], 'vesicular': ['disgust'], 'veteran': ['positive', 'trust'], 'veto': ['anger', 'negative'], 'vicar': ['positive', 'trust'], 'vice': ['negative'], 'vicious': ['anger', 'disgust', 'negative'], 'victim': ['anger', 'fear', 'negative', 'sadness'], 'victimized': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'victor': ['joy', 'positive'], 'victorious': ['joy', 'positive'], 'victory': ['anticipation', 'joy', 'positive', 'trust'], 'vigil': ['anticipation'], 'vigilance': ['anticipation', 'positive', 'trust'], 'vigilant': ['fear', 'positive', 'trust'], 'vigor': ['positive'], 'vigorous': ['positive', 'trust'], 'villager': ['positive', 'trust'], 'villain': ['fear', 'negative'], 'villainous': ['anger', 'disgust', 'fear', 'negative'], 'vindicate': ['anger'], 'vindicated': ['positive'], 'vindication': ['anticipation', 'joy', 'positive', 'trust'], 'vindictive': ['anger', 'disgust', 'negative'], 'violation': ['anger', 'fear', 'negative', 'sadness', 'surprise'], 'violence': ['anger', 'fear', 'negative', 'sadness'], 'violent': ['anger', 'disgust', 'fear', 'negative', 'surprise'], 'violently': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'viper': ['fear', 'negative'], 'virgin': ['positive', 'trust'], 'virginity': ['anticipation', 'positive'], 'virtue': ['positive', 'trust'], 'virtuous': ['joy', 'positive', 'trust'], 'virulence': ['anger', 'fear', 'negative'], 'virus': ['negative'], 'vision': ['anticipation', 'positive'], 'visionary': ['anticipation', 'joy', 'positive', 'trust'], 'visit': ['positive'], 'visitation': ['negative'], 'visitor': ['anticipation', 'joy', 'positive'], 'visor': ['anticipation', 'surprise'], 'vital': ['positive'], 'vitality': ['joy', 'positive', 'trust'], 'vivacious': ['joy', 'positive'], 'vivid': ['joy', 'positive'], 'vixen': ['negative'], 'vocabulary': ['positive'], 'volatility': ['anger', 'anticipation', 'fear', 'negative', 'surprise'], 'volcano': ['fear', 'negative', 'surprise'], 'volunteer': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'volunteers': ['trust'], 'voluptuous': ['anticipation', 'joy', 'positive'], 'vomit': ['disgust'], 'vomiting': ['negative'], 'voodoo': ['negative'], 'vote': ['anger', 'anticipation', 'joy', 'negative', 'positive', 'sadness', 'surprise', 'trust'], 'votive': ['trust'], 'vouch': ['positive', 'trust'], 'voucher': ['trust'], 'vow': ['anticipation', 'joy', 'positive', 'trust'], 'voyage': ['anticipation'], 'vulgar': ['disgust', 'negative'], 'vulgarity': ['anger', 'disgust', 'negative', 'sadness'], 'vulnerability': ['fear', 'negative', 'sadness'], 'vulture': ['disgust', 'fear', 'negative'], 'waffle': ['anger', 'negative', 'sadness'], 'wages': ['joy', 'positive'], 'wail': ['fear', 'negative', 'sadness'], 'wait': ['anticipation', 'negative'], 'wallow': ['disgust', 'negative', 'sadness'], 'wan': ['fear', 'negative', 'sadness'], 'wane': ['negative', 'sadness'], 'wanting': ['negative', 'sadness'], 'war': ['fear', 'negative'], 'warden': ['anger', 'fear', 'negative', 'trust'], 'ware': ['fear', 'negative'], 'warfare': ['anger', 'fear', 'negative', 'sadness'], 'warlike': ['anger', 'fear', 'negative'], 'warlock': ['fear'], 'warn': ['anticipation', 'fear', 'negative', 'surprise', 'trust'], 'warned': ['anticipation', 'fear', 'surprise'], 'warning': ['fear'], 'warp': ['anger', 'negative', 'sadness'], 'warped': ['negative'], 'warranty': ['positive', 'trust'], 'warrior': ['anger', 'fear', 'positive'], 'wart': ['disgust', 'negative'], 'wary': ['fear'], 'waste': ['disgust', 'negative'], 'wasted': ['anger', 'disgust', 'negative'], 'wasteful': ['anger', 'disgust', 'negative', 'sadness'], 'wasting': ['disgust', 'fear', 'negative', 'sadness'], 'watch': ['anticipation', 'fear'], 'watchdog': ['positive', 'trust'], 'watchful': ['positive', 'trust'], 'watchman': ['positive', 'trust'], 'waterproof': ['positive'], 'watery': ['negative'], 'waver': ['fear', 'negative'], 'weakened': ['negative'], 'weakly': ['fear', 'negative', 'sadness'], 'weakness': ['negative'], 'wealth': ['joy', 'positive', 'trust'], 'wear': ['negative', 'trust'], 'wearily': ['negative', 'sadness'], 'weariness': ['negative', 'sadness'], 'weary': ['negative', 'sadness'], 'weatherproof': ['positive'], 'weeds': ['negative', 'sadness'], 'weep': ['negative', 'sadness'], 'weeping': ['sadness'], 'weigh': ['anticipation', 'trust'], 'weight': ['anticipation', 'disgust', 'fear', 'joy', 'negative', 'positive', 'sadness', 'surprise', 'trust'], 'weighty': ['fear'], 'weird': ['disgust', 'negative'], 'weirdo': ['fear', 'negative'], 'welcomed': ['joy', 'positive'], 'wen': ['negative'], 'wench': ['anger', 'disgust', 'negative'], 'whack': ['negative'], 'whim': ['anticipation', 'joy', 'negative', 'surprise'], 'whimper': ['fear', 'sadness'], 'whimsical': ['joy'], 'whine': ['disgust', 'negative', 'sadness'], 'whip': ['anger', 'negative'], 'whirlpool': ['fear'], 'whirlwind': ['fear', 'negative'], 'whisky': ['negative'], 'white': ['anticipation', 'joy', 'positive', 'trust'], 'whiteness': ['joy', 'positive'], 'wholesome': ['positive', 'trust'], 'whore': ['disgust', 'negative'], 'wicked': ['fear', 'negative'], 'wickedness': ['disgust', 'negative'], 'wicket': ['positive'], 'widespread': ['positive'], 'widow': ['sadness'], 'widower': ['sadness'], 'wild': ['negative', 'surprise'], 'wildcat': ['negative'], 'wilderness': ['anticipation', 'fear', 'sadness'], 'wildfire': ['fear', 'negative', 'sadness', 'surprise'], 'willful': ['anger', 'negative', 'sadness'], 'willingly': ['positive'], 'willingness': ['positive'], 'wimp': ['disgust', 'fear', 'negative'], 'wimpy': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'wince': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'windfall': ['positive'], 'winner': ['anticipation', 'joy', 'positive', 'surprise'], 'winning': ['anticipation', 'disgust', 'joy', 'positive', 'sadness', 'surprise', 'trust'], 'winnings': ['anticipation', 'joy', 'positive'], 'wireless': ['anger', 'anticipation', 'positive', 'surprise'], 'wis': ['positive'], 'wisdom': ['positive', 'trust'], 'wise': ['positive'], 'wishful': ['anticipation'], 'wit': ['positive'], 'witch': ['anger', 'disgust', 'fear', 'negative'], 'witchcraft': ['anger', 'fear', 'negative', 'sadness'], 'withdraw': ['negative', 'sadness'], 'wither': ['negative', 'sadness'], 'withered': ['disgust', 'negative'], 'withstand': ['anticipation', 'fear', 'positive'], 'witness': ['trust'], 'wits': ['positive'], 'witty': ['joy', 'positive'], 'wizard': ['anticipation', 'positive', 'surprise'], 'woe': ['disgust', 'fear', 'negative', 'sadness'], 'woeful': ['negative', 'sadness'], 'woefully': ['disgust', 'negative', 'sadness'], 'womb': ['positive'], 'wonderful': ['joy', 'positive', 'surprise', 'trust'], 'wonderfully': ['joy', 'positive', 'surprise'], 'wondrous': ['positive'], 'wont': ['anticipation'], 'wop': ['anger'], 'word': ['positive', 'trust'], 'words': ['anger', 'negative'], 'working': ['positive'], 'worm': ['anticipation', 'negative', 'surprise'], 'worn': ['negative', 'sadness'], 'worried': ['negative', 'sadness'], 'worry': ['anticipation', 'fear', 'negative', 'sadness'], 'worrying': ['anticipation', 'fear', 'negative', 'sadness'], 'worse': ['fear', 'negative', 'sadness'], 'worsening': ['disgust', 'negative', 'sadness'], 'worship': ['anticipation', 'fear', 'joy', 'positive', 'trust'], 'worth': ['positive'], 'worthless': ['anger', 'disgust', 'negative', 'sadness'], 'worthy': ['positive', 'trust'], 'wot': ['positive', 'trust'], 'wound': ['anger', 'fear', 'negative', 'sadness'], 'wrangling': ['anger', 'disgust', 'fear', 'negative', 'sadness'], 'wrath': ['anger', 'fear', 'negative'], 'wreak': ['anger', 'negative'], 'wreck': ['anger', 'disgust', 'fear', 'negative', 'sadness', 'surprise'], 'wrecked': ['anger', 'fear', 'negative', 'sadness'], 'wrench': ['negative'], 'wrestling': ['negative'], 'wretch': ['anger', 'disgust', 'negative', 'sadness'], 'wretched': ['disgust', 'negative', 'sadness'], 'wring': ['anger'], 'wrinkled': ['sadness'], 'writer': ['positive'], 'wrong': ['negative'], 'wrongdoing': ['anger', 'disgust', 'negative', 'sadness'], 'wrongful': ['anger', 'disgust', 'negative', 'sadness'], 'wrongly': ['anger', 'fear', 'negative', 'sadness'], 'wrought': ['negative'], 'wry': ['negative'], 'xenophobia': ['fear', 'negative'], 'yawn': ['negative'], 'yawning': ['negative'], 'yearning': ['anticipation', 'joy', 'negative', 'positive', 'trust'], 'yell': ['anger', 'fear', 'negative', 'surprise'], 'yellows': ['negative'], 'yelp': ['anger', 'fear', 'negative', 'surprise'], 'young': ['anticipation', 'joy', 'positive', 'surprise'], 'younger': ['positive'], 'youth': ['anger', 'anticipation', 'fear', 'joy', 'positive', 'surprise'], 'zany': ['surprise'], 'zeal': ['anticipation', 'joy', 'positive', 'surprise', 'trust'], 'zealous': ['joy', 'positive', 'trust'], 'zest': ['anticipation', 'joy', 'positive', 'trust'], 'zip': ['negative']} def __init__(self): import nltk nltk.download('omw-1.4') def load_sentence(self, text): self.text = text blob = TextBlob(text) self.words = [w.lemmatize() for w in blob.words] self.sentences = list(blob.sentences) build_word_affect(self) top_emotions(self) def load_tokens(self, tokens): self.words = [w.lemmatize() for w in tokens] build_word_affect(self) top_emotions(self) def load_lemmatized_tokens(self, tokens): self.words = tokens build_word_affect(self) top_emotions(self) def filter_by_affects(self, affect_filter_list): filtered_affect_words = [] for k,v in self.affect_dict.items(): if len(set(v).intersection(set(affect_filter_list))) > 0: filtered_affect_words.append(k) return filtered_affect_words def lemmatizer(self, sentence): import pattern from pattern.en import lemma, lexeme from gensim.utils import lemmatize import re self.lemmatized_out = [] if (type(sentence) == list): sentence = ' '.join(sentence) # retry due to intermittent 'generator raised StopIteration' issue for i in range(100): for attempt in range(10): try: lemmatized = lemmatize(sentence) original = sentence.split(' ') for i in range(len(lemmatized)): _wd = lemmatized[i].decode('utf-8').split('/')[0] self.lemmatized_out.append(_wd) except Exception as e: print('error received: ', e) print('retrying. attempt: ', attempt) else: break else: print("we failed all the attempts - deal with the consequences.") return self.lemmatized_out def load_unlemmatized_text(self, sentence): self.words = self.lemmatizer(sentence) build_word_affect(self) top_emotions(self) def append_text(self, text_add): self.text = self.text + ' ' + text_add blob = TextBlob(self.text) self.words = [w.lemmatize() for w in blob.words] self.sentences = list(blob.sentences) build_word_affect(self)
#!/usr/local/bin/python3.6 print('Python算术运算符') print('+ 加 - 两个对象相加') print('- 减 - 得到负数或是一个数减去另一个数') print('* 乘 - 两个数相乘或是返回一个被重复若干次的字符串') print('/ 除 - x 除以 y') print('% 取模 - 返回除法的余数') print('** 幂 - 返回x的y次幂') print('// 取整除 - 返回商的整数部分') print('') a = 21 b = 10 c = 0 c = a + b print('a + b c = ', c) c = a - b print('a - b c = ', c) c = a * b print('a * b c = ', c) c = a / b print('a / b c = ', c) c = a % b print('a % b c = ', c) # 修改a, b, c a = 2 b = 3 c = a ** b print('a ** b c = ', c) a = 10 b = 5 c = a // b print('a // b c = ', c) print('Python比较运算符') print() print('== 等于 - 比较对象是否相等') print('!= 不等于 - 比较两个对象是否不相等') print('> 大于 - 返回x是否大于y') print('< 小于 - 返回x是否小于y。所有比较运算符返回1表示真,返回0表示假。这分别与特殊的变量True和False等价。注意,这些变量名的大写。 ') print('>= 大于等于 - 返回x是否大于等于y。') print('<= 小于等于 - 返回x是否小于等于y。') print('') print('Python赋值运算符') print('= 简单的赋值运算符 c = a + b 将 a + b 的运算结果赋值为 c') print('+= 加法赋值运算符 c += a 等效于 c = c + a') print('-= 减法赋值运算符 c -= a 等效于 c = c - a') print('*= 乘法赋值运算符 c *= a 等效于 c = c * a') print('/= 除法赋值运算符 c /= a 等效于 c = c / a') print('%= 取模赋值运算符 c %= a 等效于 c = c % a') print('**= 幂赋值运算符 c **= a 等效于 c = c ** a') print('//= 取整除赋值运算符 c //= a 等效于 c = c // a') a = 21 b = 10 c = 0 print('a = ', a) print('b = ', b) print('c = ', c) c = a + b print(' c = a + b : ', c) c += a print(' c += a : ', c) c *= a print(' c += a : ', c) c /= a print(' c /= a : ', c) c = 2 c %= a print(' c = 2 c %= a : ', c) c **= a print(' c **= a : ', c) c //= a print(' c //= a : ', c) print('') print('Python位运算符') print('按位运算符是把数字看作二进制来进行计算的') print('& 按位与运算符:参与运算的两个值,如果两个相应位都为1,则该位的结果为1,否则为0 (a & b) 输出结果 12 ,二进制解释: 0000 1100') print('| 按位或运算符:只要对应的二个二进位有一个为1时,结果位就为1。 (a | b) 输出结果 61 ,二进制解释: 0011 1101') print('^ 按位异或运算符:当两对应的二进位相异时,结果为1 (a ^ b) 输出结果 49 ,二进制解释: 0011 0001') print('~ 按位取反运算符:对数据的每个二进制位取反,即把1变为0,把0变为1。~x 类似于 -x-1 (~a ) 输出结果 -61 ,二进制解释: 1100 0011, 在一个有符号二进制数的补码形式。') print('<< 左移动运算符:运算数的各二进位全部左移若干位,由"<<"右边的数指定移动的位数,高位丢弃,低位补0。 a << 2 输出结果 240 ,二进制解释: 1111 0000') print('>> 右移动运算符:把">>"左边的运算数的各二进位全部右移若干位,">>"右边的数指定移动的位数 a >> 2 输出结果 15 ,二进制解释: 0000 1111') print('') a = 60 # 60 = 0011 1100 b = 13 # 13 = 0000 1101 c = 0 print('a = ', a) print('b = ', b) print('c = ', c) c = a & b # 12 = 0000 1100 print('a & b = ', c) c = a | b # 61 = 0011 1101 print('a | b = ', c) c = a ^ b # 49 = 0011 0001 print('a ^ b = ', c) c = ~a # -61 = 1100 0011 print('~a = ', c) c = a << 2 # 240 = 1111 0000 print('a << 2 = ', c) c = a >> 2 # 15 = 0000 1111 print('a >> 2 = ', c) print() print('Python逻辑运算符') print('and x and y 布尔"与" - 如果 x 为 False,x and y 返回 False,否则它返回 y 的计算值。 (a and b) 返回 20。') print('or x or y 布尔"或" - 如果 x 是 True,它返回 x 的值,否则它返回 y 的计算值。 (a or b) 返回 10。') print('not not x 布尔"非" - 如果 x 为 True,返回 False 。如果 x 为 False,它返回 True。 not(a and b) 返回 False') a = 10 b = 20 print('a = ', a) print('b = ', b) if (a and b): print('a and b | a 和 b 都为 True') else: print('a and b | a 和 b 有一个不为 true') if (a or b): print('a or b | a 和 b 都为 True 或其中1个为True') else: print('a or b | a 和 b 都不为True') a = 0 print('a = ', a) if (a and b): print('a and b | a 和 b 都为 True') else: print('a and b | a 和 b 有一个不为 true') if (a or b): print('a or b | a 和 b 都为 True 或其中1个为True') else: print('a or b | a 和 b 都不为True') if not(a and b): print('not(a and b) | a 和 b 都为 False 或其中1个为False') else: print('not(a and b) | a 和 b 都为True') print() print('Python成员运算符') print('in 如果在指定的序列中找到值返回 True,否则返回 False。 x 在 y 序列中 , 如果 x 在 y 序列中返回 True。') print('not in 如果在指定的序列中没有找到值返回 True,否则返回 False。 x 不在 y 序列中 , 如果 x 不在 y 序列中返回 True。') a = 10 b = 20 list = [1, 2, 3, 4, 5] print('a = ', a) print('b = ', b) print('list = ', list) if (a in list): print('a in list | a 在 list 中') else: print('a in list | a 不在 list 中') if (b not in list): print('b not in list | b 不在 list 中') else: print('b not in list | b 在 list 中') print(' Python身份运算符 ') print('is is 是判断两个标识符是不是引用自一个对象 x is y, 类似 id(x) == id(y) , 如果引用的是同一个对象则返回 True,否则返回 False') print('is not is not 是判断两个标识符是不是引用自不同对象 x is not y , 类似 id(a) != id(b)。如果引用的不是同一个对象则返回结果 True,否则返回 False。') print(' id() 函数用于获取对象内存地址。') a = 20 b = 20 print('a = ', a) print('b = ', b) if (a is b): print('a is b | a 和 b 引用同1个对象') else: print('a is b | a 和 b 引用的不是同1个对象') if (id(a) is id(b)): print('id(a) is id(b) | a 和 b 引用相同的对象') else: print('id(a) is id(b) | a 和 b 引用不同的对象') b = 30 if (a is b): print('a is b | a 和 b 引用同1个对象') else: print('a is b | a 和 b 引用的不是同1个对象') if (a is not b): print('a is not b | a 和 b 引用同1个对象') else: print('a is not b | a 和 b 引用的不是同1个对象') print() print('is 与 == 区别:') print('is 用于判断两个变量引用对象是否为同一个, == 用于判断引用变量的值是否相等。') print() print('Python运算符优先级') print('** 指数 (最高优先级)') print('~ + - 按位翻转, 一元加号和减号 (最后两个的方法名为 +@ 和 -@)') print('* / % // 乘,除,取模和取整除') print('+ - 加法减法') print('>> << 右移,左移运算符') print('& 位 AND') print('^ | 位运算符') print('<= < > >= 比较运算符') print('<> == != 等于运算符') print('= %= /= //= -= += *= **= 赋值运算符') print('is is not 身份运算符') print('in not in 成员运算符') print('not or and 逻辑运算符') print('') a = 20 b = 10 c = 15 d = 5 e = 0 print('a = ', a) print('b = ', b) print('c = ', c) print('d = ', d) print('e = ', e) e = (a + b) * c / d print('e = (a + b) * c / d = ', e) e = ((a + b) * c) / d print('e = ((a + b ) * c) / d = ', e) e = (a + b) * (c / d) print('e = (a + b ) * (c / d) = ', e) e = a + (b * c) / d print('e = a + (b * c) / d = ', e) print('数学函数') print('abs(x) 返回数字的绝对值,如abs(-10) 返回 10') print('ceil(x) 返回数字的上入整数,如math.ceil(4.1) 返回 5') print('cmp(x, y) 如果 x < y 返回 -1, 如果 x == y 返回 0, 如果 x > y 返回 1。 Python 3 已废弃 。使用 使用 (x>y)-(x<y) 替换。') print('exp(x) 返回e的x次幂(ex),如math.exp(1) 返回2.718281828459045') print('fabs(x) 返回数字的绝对值,如math.fabs(-10) 返回10.0') print('floor(x) 返回数字的下舍整数,如math.floor(4.9)返回 4') print('log(x) 如math.log(math.e)返回1.0,math.log(100,10)返回2.0') print('log10(x) 返回以10为基数的x的对数,如math.log10(100)返回 2.0') print('max(x1, x2,...) 返回给定参数的最大值,参数可以为序列。') print('min(x1, x2,...) 返回给定参数的最小值,参数可以为序列。') print('modf(x) 返回x的整数部分与小数部分,两部分的数值符号与x相同,整数部分以浮点型表示。') print('pow(x, y) x**y 运算后的值。') print('round(x [,n]) 返回浮点数x的四舍五入值,如给出n值,则代表舍入到小数点后的位数。') print('sqrt(x) 返回数字x的平方根。') print('') print('随机数函数') print('choice(seq) 从序列的元素中随机挑选一个元素,比如random.choice(range(10)),从0到9中随机挑选一个整数') print('randrange ([start,] stop [,step]) 从指定范围内,按指定基数递增的集合中获取一个随机数,基数缺省值为1') print('random() 随机生成下一个实数,它在[0,1)范围内。') print('seed([x]) 改变随机数生成器的种子seed。如果你不了解其原理,你不必特别去设定seed,Python会帮你选择seed。') print('shuffle(lst) 将序列的所有元素随机排序') print('uniform(x, y) 随机生成下一个实数,它在[x,y]范围内。') print('') print('三角函数') print('acos(x) 返回x的反余弦弧度值。') print('asin(x) 返回x的反正弦弧度值。') print('atan(x) 返回x的反正切弧度值。') print('atan2(y, x) 返回给定的 X 及 Y 坐标值的反正切值。') print('cos(x) 返回x的弧度的余弦值。') print('hypot(x, y) 返回欧几里德范数 sqrt(x*x + y*y)。') print('sin(x) 返回的x弧度的正弦值。') print('tan(x) 返回x弧度的正切值。') print('degrees(x) 将弧度转换为角度,如degrees(math.pi/2) , 返回90.0') print('radians(x) 将角度转换为弧度') print('') print('数学常量') print('pi 数学常量 pi(圆周率,一般以π来表示)') print('e 数学常量 e,e即自然常数(自然常数)。')
import math def my_sqrt(a): epsilon = 0.0000001 x = a while True: y = (x + a/x)/2.0 if abs(y - x) < epsilon: break x = y return y def test_sqrt(): a = 1 while a<26: diff = my_sqrt(a) - math.sqrt(a) print('a=', a, '|my_sqrt(a=)', my_sqrt(a), '|math.sqrt(a)=', math.sqrt(a), '|diff=', abs(diff)) a = a + 1 test_sqrt()
def isPalindrome(n): num = n reversed_digit = 0 while (num>0): digit = num%10 reversed_digit=reversed_digit*10 + digit num = num//10 print (n, reversed_digit) if reversed_digit == n: return True else: return False def main(): print (isPalindrome(121)) print (isPalindrome(123)) print (isPalindrome(5)) if __name__ == "__main__": main()
from collections import Counter from collections import defaultdict def main(): s = "hello" d = defaultdict(int) for char in s: d[char] += 1 print (d) if __name__ == "__main__": main()
from DataStructures.DoublyLinkedList import DoublyLinkedList def mth_to_last(n, ll): if ll.head == None: raise ValueError("Empty LinkedList") else: count = 0 curr = ll.head trail = None while (curr): #print (count,n) if count == n: trail = ll.head break else: curr = curr.next count += 1 if trail == None: raise ValueError("Invalid Index") else: while (curr.next): curr = curr.next trail = trail.next return trail
#ESC180 Lab 1 # Connected Cows # DO NOT modify any function or argument names import math def find_euclidean_distance(x1, y1, x2, y2): ''' (float)->float find_euclidean_distance calculates the euclidean distance between two given 2D points P(x1,y1) and Q(x2,y2), and returs its Euclidean_distance ''' Euclidean_distance = math.sqrt((x2-x1)**2+(y2-y1)**2) return round(Euclidean_distance, 2) def is_cow_within_bounds(cow_position, boundary_points): if (bx1>cx1>bx2 or bx2>cx1>bx1): if (by1>cy1>by2 or by2>cy1>by1): return 1 else: return 0 else: return 0 ''' Your docstring here #function body cow_position[0] ''' def find_cow_distance_to_boundary(cow_position, boundary_point): k = (boundary_point[0]-cow_position[0])**2 z = (boundary_point[1]-cow_position[1])**2 Distance_boundary = math.sqrt(k+z) return round(Distance_boundary,2) """ Your docstring here """ #function body ''' def find_time_to_escape(cow_speed, cow_distance): """ Your docstring here """ #function body def report_cow_status(cow_position1, cow_position2, delta_t, boundary_points): """ Your docstring here """ #function body ''' if __name__ == '__main__': x1 = float(input("Please insert X coordinate of point P ")) y1 = float(input("Please insert y coordinate of point P ")) x2 = float(input("Please insert x coordinate of point Q ")) y2 = float(input("Please insert y coordinate of point Q ")) Euclidean_distance = find_euclidean_distance(x1, y1, x2, y2) print("The Euclidean distance is:",Euclidean_distance) cx1 = int(input("Please insert x coordinate for cow: ")) cy1 = int(input("Please insert y coordinate for cow: ")) bx1 = int(input("Please insert x coordinate for point1 and 4: ")) by1 = int(input("Please insert y coordinate for point1 and 2: ")) bx2 = int(input("Please insert x coordinate for point2 and 3: ")) by2 = int(input("Please insert y coordinate for point3 and 4: ")) cow_position = (cx1,cy1) boundary_points = (bx1,by1),(bx2,by1),(bx2,by2),(bx1,by2) position = is_cow_within_bounds(cow_position, boundary_points) print(position) a_list = [3,3] b_list = [2,5] c_list = [2,2] d_list = [0,1] w = find_cow_distance_to_boundary(a_list, b_list) g = find_cow_distance_to_boundary(c_list, d_list) print("Distance between cow",a_list,"and boundary point",b_list) print(w) print("Distance between cow",c_list,"and boundary point",d_list) print(g) ''' # Test your code by running your functions here, and printing the # results to the terminal. # This code will not be marked print('Testing functions...') # test_distance = find_euclidian_distance(3.0, 3.0, 2.0, 5.0) # print(test_distance) # test_distance should be 2.24 '''
from abc import ABCMeta, abstractmethod import random class GhostStrategy(object): __metaclass__ = ABCMeta @abstractmethod def get_move(self, winners, losers): """Returns the next letter to be played using the current strategy. Args: winners: dict whose keys are letters and whose values are the Trie nodes corresponding to appending that letter to the current word. Choosing any of these words should lead to a win by the current player given optimal play. losers: dict whose keys are letters and whose values are the Trie nodes corresponding to appending that letter to the current word. Choosing any of these words should lead to a loss by the current player given optimal play by the opponent. Returns: A letter to be appended to the end of the current word. """ raise NotImplementedError() class RandomWinBestEffortLossStrat(GhostStrategy): """If the computer thinks it will win, it should play randomly among all its winning moves; if the computer thinks it will lose, it should play so as to extend the game as long as possible (choosing randomly among choices that force the maximal game length). """ def get_move(self, winners, losers): if winners: return random.choice([letter for letter in winners]) else: # only those nodes that have the longest chain leading to end game state max_height = max([x.height for x in losers.values()]) best_choices = [letter for letter in losers if losers[letter].height == max_height] return random.choice(best_choices) class RandomChoiceStrat(GhostStrategy): """Totally random strategy.""" def get_move(self, winners, losers): choices = winners + losers return random.choice([letter for letter in choices])
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 如果给定一个list或tuple,我们可以通过for循环来遍历这个list或tuple,这种遍历我们称为迭代(Iteration)。 # 因为dict的存储不是按照list的方式顺序排列,所以,迭代出的结果顺序很可能不一样。 # 遍历字典 d = {'a': 1, 'b': 2, 'c': 3} for key in d: print(key) # 默认情况下,dict迭代的是key。如果要迭代value,可以用for value in d.values(),如果要同时迭代key和value,可以用for k, v in d.items()。 # 迭代value for value in d.values(): print(value) # 迭代key, value for k, v in d.items(): print('key: %s , value: %s ' % (k, v)) # 迭代字符串 for str in 'ABC': print(str) # 如何判断一个对象是可迭代对象呢?方法是通过collections模块的Iterable类型判断 from collections import Iterable vs = isinstance('ABC', Iterable) print(vs) sd = isinstance([1, 2, 3], Iterable) print(sd) ins = isinstance(123, Iterable) # 整数是否可迭代 print(ins) # Python内置的enumerate函数可以把一个list变成索引-元素对,这样就可以在for循环中同时迭代索引和元素本身 enums = enumerate([1, 2, 3, 4, 5]) print(enums) for k, v in enumerate([1, 2, 3, 4, 5]): print('k: %s , v: %s' % (k, v)) # 上面的for循环里,同时引用了两个变量,在Python里是很常见的,比如下面的代码: for x, y in [(1, 1), (2, 4), (3, 6), (4, 8)]: print(x, y)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- List = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack'] print('集合的长度 %s ' % len(List)) print('获取集合的第一个元素 %s ' % List[0]) print('获取集合的最后一个元素 %s ' % List[-1]) print('向集合中添加元素:%s ' % List.append('Marry')) print('获取集合元素 %s ' % List) List2 = ['Michael', 'Sarah', ['Tracy', 'Tom'], 'Bob', 'Jack'] print('获取集合中的另一个集合中的tom信息: %s ' % List2[2][1])
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 判断对象类型,使用type()函数 sf = type(123) print(sf) # 判断基本数据类型可以直接写int,str等,但如果要判断一个对象是否是函数怎么办?可以使用types模块中定义的常量: import types def fun(): pass if type(fun) == types.FunctionType: print('fn 是函数!') # 使用isinstance() # 对于class的继承关系来说,使用type()就很不方便。我们要判断class的类型,可以使用isinstance()函数。 class Animal(object): pass class Dog(Animal): pass class Cat(Animal): pass a = Animal() d = Dog() c = Cat() res = isinstance(d, Animal) print(res) # 如果要获得一个对象的所有属性和方法,可以使用dir()函数,它返回一个包含字符串的list,比如,获得一个str对象的所有属性和方法: mes = dir('ABC') print(mes) class MyObject(object): def __init__(self): self.x = 9 def power(self): return self.x * self.x obj = MyObject() # 获取属性的值 result = hasattr(obj, 'x') print(result) # 设置一个属性'y' sal = setattr(obj, 'y', 19) print(sal) # 存在属性'y' ysl = hasattr(obj, 'y') print(ysl) # 获取属性'y' sals = getattr(obj, 'y') print(sals)
if __name__ == "__main__": num_array = list() num = input("Enter how many elements you want:") print ('Enter numbers in array: ') for i in range(int(num)): n = input("num :") num_array.append(int(n)) print ('Array: ',num_array) for i in range(1,int(num)): d=i while (d > 0 and num_array[d] < num_array[d-1]): t = num_array[d] num_array[d] = num_array[d-1] num_array[d-1]=t d=d-1 i=i+1 print("Sorted Array:",num_array)
# Create a Python list to store your grocery list grocery_list = ['milk', 'bacon', 'eggs', 'steak', 'peanut butter', 'jelly'] # Print the grocery list print(grocery_list) # Change "Peanut Butter" to "Almond Butter" and print out the updated list grocery_list[4] = 'Almond Butter' print(grocery_list) # Remove "Jelly" from grocery list and print out the updated list grocery_list.remove('jelly') print(grocery_list) # Add "Coffee" to grocery list and print the updated list grocery_list.append('coffee') print(grocery_list)
def part1(): valid_passwords = 0 with open('inputs/day2.txt') as f: for line in f: line = line.strip('\n') lowerRange = int(line.split('-')[0]) upperRange = int(line.split('-')[1].split(' ')[0]) letter = line.split('-')[1].split(' ')[1].strip(':') word = line.split('-')[1].split(' ')[2] if word.count(letter) >= lowerRange \ and word.count(letter) <= upperRange: valid_passwords += 1 f.close() print("Valid passwords:", str(valid_passwords)) def part2(): valid_passwords = 0 with open('inputs/day2.txt') as f: for line in f: line = line.strip('\n') first_position = int(line.split('-')[0]) second_position = int(line.split('-')[1].split(' ')[0]) letter = line.split('-')[1].split(' ')[1].strip(':') word = line.split('-')[1].split(' ')[2] first_ok = False second_ok = False if first_position <= len(word): if word[first_position - 1] == letter: first_ok = True if second_position <= len(word): if word[second_position - 1] == letter: second_ok = True if first_ok and second_ok: continue elif first_ok or second_ok: valid_passwords += 1 f.close() print("Valid passwords:", str(valid_passwords)) if __name__ == "__main__": print("Part 1:") part1() print("\nPart 2:") part2()
def check_validity(passport): """ check_validity checks is a passport is valid or not, returning True if it is and False if not :param passport: the string representation of a passport """ data = {} valid = True if "byr:" not in passport \ or "iyr:" not in passport \ or "eyr:" not in passport \ or "hgt:" not in passport \ or "hcl:" not in passport \ or "ecl:" not in passport \ or "pid:" not in passport: return False for pair in (passport.split(" ")): if ":" in pair: pair = pair.split(":") data[pair[0]] = pair[1] if not data['byr'].isnumeric() \ or not data['iyr'].isnumeric() \ or not data['eyr'].isnumeric(): return False if int(data['byr']) < 1920 or int(data['byr']) > 2002: return False if int(data['iyr']) < 2010 or int(data['iyr']) > 2020: return False if int(data['eyr']) < 2020 or int(data['eyr']) > 2030: return False if "cm" in data['hgt']: number = data['hgt'].split('cm')[0] if not number.isnumeric(): return False else: if int(number) < 150 or int(number) > 193: return False elif 'in' in data['hgt']: number = data['hgt'].split('in')[0] if not number.isnumeric(): return False else: if int(number) < 59 or int(number) > 76: return False else: return False if data['ecl'] not in ['amb', 'blu', 'brn', 'gry', 'grn', 'hzl', 'oth']: return False if not data['pid'].isnumeric() or len(data['pid']) is not 9: return False valid_hcl = "0123456789abcdef" if data['hcl'][0] is not "#": return False else: if len(data['hcl']) != 7: return False else: for char in data['hcl'][1:7]: if char not in valid_hcl: return False return True def part1(): passport = "" valid_passports = 0 with open('inputs/day4.txt') as f: for line in f: if line != "\n": passport += line.strip("\n") + " " else: if "byr:" in passport \ and "iyr:" in passport \ and "eyr:" in passport \ and "hgt:" in passport \ and "hcl:" in passport \ and "ecl:" in passport \ and "pid:" in passport: valid_passports += 1 passport = "" if "byr:" in passport \ and "iyr:" in passport \ and "eyr:" in passport \ and "hgt:" in passport \ and "hcl:" in passport \ and "ecl:" in passport \ and "pid:" in passport: valid_passports += 1 f.close() print("Valid passports", str(valid_passports)) def part2(): passport = "" valid_passports = 0 with open('inputs/day4.txt') as f: for line in f: if line != "\n": passport += line.strip("\n") + " " else: if check_validity(passport): valid_passports += 1 passport = "" if check_validity(passport): valid_passports += 1 f.close() print("Valid passports", str(valid_passports)) if __name__ == "__main__": print("Part 1:") part1() print("\nPart 2:") part2()
class product: def __init__(self,price,id1,quantity): self.price=price self.id1=id1 self.quantity=quantity class inventory: item={} quant={} def __init__(self): self.item={} self.quant={} def add(self,product): if product.id1 in self.item.keys(): self.quant[product.id1]=self.quant[product.id1]+product.quantity else: self.item[product.id1]=product.price self.quant[product.id1]=product.quantity def sum(self): sum=0 for num in self.item: sum+=self.item[num]*self.quant[num] return sum inventory1=inventory() num=int(input("Enter number of products\n")) for i in range(num): a=int(input("enter the price of price\n")) b=int(input("enter the id of product\n")) c=int(input("enter the quantity of product\n")) inventory1.add(product(a,b,c)) print("the sum of all product is \n") total=inventory1.sum() print(total)
# Printing print("Hello World") print("Day 1 - Python Print Function") print("The function is declared like this:") print("print('what to print')") # String manipulation print("Hello World!\nNew Line, baybyyyy") print("Hello" + " Elias") # Input # name = input("What is your name? ") # print(name) # length = len(name) # print(length) # Project - Band Name Generator print("Welcome to the Band Name Generator") city_name = input("What's the name of the city you grew up in ?\n") pet_name = input("What's your pet's name?\n") print(f"Your band name could be {city_name} {pet_name}")
import math def greet(name): print(f"hey {name}") print(f"hi {name}") print(f"hello {name}") greet('Eli') def greet_with(name, location): print(f"Greetings {name} from {location}!") greet_with('Elias','Jupiter') greet_with(name='Jupiter', location='Elias') # paint can exercise def paint_calc(height, width, cover): area = height * width num_of_cans = math.ceil(area / cover) print(f"You'll need {num_of_cans} cans of paint.") paint_calc(22,5,3) # prime number checker exercise def prime_checker(num): is_prime = True for divisor in range(2,num): if num % divisor == 0: is_prime = False if is_prime: print(f"{num} is a prime number.") else: print(f"{num} is NOT a prime number.") n = int(input("Number to check: ")) prime_checker(n) # caesar cipher exercise # def encrypt(plain_text, shift_amount): # cipher_text = "" # for letter in plain_text: # position = alphabet.index(letter) # new_position = position + shift_amount # if new_position > len(alphabet): # new_position = -1 + shift_amount # new_letter = alphabet[new_position] # cipher_text += new_letter # print(f"The encoded text is {cipher_text}") # def decrypt(cipher_text, shift_amount): # plain_text = "" # for letter in cipher_text: # position = alphabet.index(letter) # new_position = position - shift_amount # if new_position < 0: # new_position = len(alphabet) - 1 - shift_amount # new_letter = alphabet[new_position] # plain_text += new_letter # print(f"The decoded text is {plain_text}") # if direction == 'encode': # encrypt(text, shift) # elif direction == 'decode': # decrypt(text, shift) # else: # print('Invalid input') alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] def caesar(start_text, shift_amount, cipher_direction): end_text = "" for letter in start_text: if letter in alphabet: position = alphabet.index(letter) if cipher_direction == "decode": shift_amount *= -1 new_position = position + shift_amount end_text += alphabet[new_position] else: end_text += letter print(f"The {cipher_direction}d text is: {end_text}") should_continue = True while should_continue: direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n") text = input("Type your message:\n").lower() shift = int(input("Type the shift number:\n")) % 25 caesar(text, shift, direction) result = input("Type 'yes' if you want to go again. Otherwise type 'no'.\n") if result == 'no': should_continue = False print('Goodbye.')
import email.Utils def tokensplit(s, splitchars=None, quotes='"\''): """Split a string into tokens at every occcurence of splitchars. splitchars within quotes are disregarded. """ if splitchars is None: import string splitchars = string.whitespace inquote = None l = []; token = [] for c in s: if c in quotes: if c == inquote: inquote = None elif inquote is None: inquote = c if c in splitchars and inquote is None: l.append("".join(token)) token = [] inquote = None else: token.append(c) else: l.append("".join(token)) return l def parseaddrlist(alist): """Parse a comma-separated list of email address into (name, mail) tuples. """ l = [] for addr in tokensplit(alist, ',', quotes='"'): addr = addr.strip() if addr: l.append(email.Utils.parseaddr(addr)) return l if __name__ == '__main__': al = '"Hacker, J. Random" <[email protected]>, Joe O\'Donnel <[email protected]>, [email protected], alice (Alice Bobton), <[email protected]>, ' print parseaddrlist(al)
import random class CodeGenerator: def __init__(self): # Using ASCII characters as the code for encryption self.__FIRST_ASCII = 33 self.__LAST_ASCII = 126 # Create empty dictionary to hold the encryption codes self.__encryption_codes = {} def generate_code(self): code_values = list(range(self.__FIRST_ASCII, self.__LAST_ASCII + 1)) # Randomize the list of code values code_values = random.sample(code_values, len(code_values)) for i in range(len(code_values)): self.__encryption_codes[chr(i + self.__FIRST_ASCII)] = chr(code_values[i]) # Return dictionary of encryption code def get_code(self): return self.__encryption_codes
get_even_list = [1, 2, 5, -10, 9, 6] even_list =[get_even_list for get_even_list in get_even_list if get_even_list % 2 ==0] if set(even_list) == set([2, -10, 6]): print("Your function is correct") else: print("Ooops, bugs detected")
def numerical_diff(f, x): h = 1e-4 #0.0001 return (f(x+h) - f(x-h)) / (2*h) def function_1(x): return 0.01*x**2 + 0.1*x import numpy as np import matplotlib.pylab as plt x = np.arange(0.0, 20.0, 0.1) y = function_1(x) plt.xlabel("x") plt.ylabel("f(x)") plt.plot(x, y) plt.show() def funtion_2(x): return x[0]**2 + x[1] **2 def funtion_tmp1(x0): return x0*x0 + 4.0**2.0 #모든 변수의 편미분을 벡터로 정리한 것을 기울기 import numpy as np def numerical_gradient(f, x): h = 1e-4 grad = np.zeros_like(x) # x와 형상이 같은 배열을 생성 for idx in range(x.size): tmp_val = x[idx] x[idx] = tmp_val + h fxh1 = f(x) x[idx] = tmp_val - h fxh2 = f(x) grad[idx] = (fxh1 - fxh2) / (2*h) x[idx] = tmp_val return grad numerical_gradient(funtion_2, np.array([3.0, 4.0])) def gradient_descent(f, init_x, lr=0.01, step_num= 100): x = init_x for i in range(step_num): grad = numerical_gradient(f, x) x -= lr * grad return x def function_2(x): return x[0] ** 2 + x[1] ** 2 init_x = np.array([-3.0, 4.0]) print(gradient_descent(function_2, init_x=init_x, lr=10.0, step_num=100))
import numpy as np import matplotlib.pyplot as plt # define helper functions def sigmoid(x): return 1 / (1 + np.exp(-x)) def score(x, y, w): return y * (x @ w) def compute_loss(x, y, w): log_loss = - sum(np.log(sigmoid(score(x, y, w)))) / len(y) return log_loss def compute_gradients(x, y, w): dw = - sigmoid(- score(x, y, w)) * y @ x / len(y) return dw def prediction(x, w): return sigmoid(x @ w) def decision_boundary(prob): return 1 if prob >= .5 else -1 def classify(predictions, decision_rule): """ input - N element array of predictions between 0 and 1 output - N element array of -1s and 1s """ db = np.vectorize(decision_rule) return db(predictions).flatten() def accuracy(x, y, w): y_pred = np.sign(x @ w) diff = y_pred - y # if diff is zero, then correct return 1 - float(np.count_nonzero(diff)) / len(diff) def train_logistic(x_train, y_train, x_test, y_test, lr, iterations=50): # Compute Loss accuracies_train = [] accuracies_test = [] losses_train = [] losses_test = [] for _ in range(iterations): w = np.ones(len(x_train.shape[1])) loss_train = compute_loss(x_train, y_train, w) loss_test = compute_loss(x_train, y_train, w) # Compute Gradients dw = compute_gradients(x_train, y_train, w) # Update Parameters w = w - lr * dw # Compute Accuracy and Loss on Test set (x_test, y_test) accuracy_train = accuracy(x_train, y_train, w) accuracy_test = accuracy(x_test, y_test, w) # Save acc and loss accuracies_test.append(accuracy_test) accuracies_train.append(accuracy_train) losses_test.append(loss_test) losses_train.append(loss_train) # Plot Loss and Accuracy plt.plot(accuracies_test, label="Test Accuracy") plt.plot(accuracies_train, label="Train Accuracy") plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0.) plt.title("Accuracies over Iterations") plt.ylabel('Accuracy') plt.xlabel('Iterations') plt.show() plt.plot(losses_test, label="Test Loss") plt.plot(losses_train, label="Train Loss") plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0.) plt.title("Loss over Iterations") plt.ylabel('Loss') plt.xlabel('Iterations') plt.show() # main - run model if __name__ == '__main__': pass
''' Време + 15 минути Да се напише програма, която чете час и минути от 24-часово денонощие, въведени от потребителя и изчислява колко ще е часът след 15 минути. Резултатът да се отпечата във формат часове:минути. Часовете винаги са между 0 и 23, а минутите винаги са между 0 и 59. Часовете се изписват с една или две цифри. Минутите се изписват винаги с по две цифри, с водеща нула, когато е необходимо. Примерен вход и изход вход изход ''' hours = int(input()) minutes = int(input()) minutes += 15 if minutes > 59: if hours < 22: hours += 1 minutes -= 60 else: hours = 0 minutes -=60 if minutes < 10: print(f"{hours}:0{minutes}") else: print(f"{hours}:{minutes}")
''' Пари, нужни за екскурзията - реално число; Налични пари - реално число. След това многократно се четат по два реда: Вид действие – текст с две възможности: "spend" или "save"; Сумата, която ще спести/похарчи - реално число. ''' holiday_cost = int(input()) current_money = int(input()) is_spending=0 days_gone=0 while current_money < holiday_cost : action = input() daily_money = int(input()) days_gone+=1 if action =="save": current_money = current_money + daily_money is_spending=0 elif action =="spend": current_money = current_money - daily_money if current_money < 0: current_money =0 is_spending = is_spending+1 if is_spending==5: print(f"You can't save the money. {days_gone}") break if (current_money >= holiday_cost ) : print(f"You saved the money for {days_gone} days.")
height = int(input()) # in cm width = int(input()) # in cm length = int(input()) # in cm volume_taken_perc = float(input()) volume = height * width * length *0.001 # in litres volume_taken = volume * (1- volume_taken_perc/100) print (f" количеството литри са { volume - volume_taken : .3f} ")
#!/usr/bin/python import time import random #variables playersChoice = '' computerChoice = '' numOfRounds = 0 computerScore = 0 playerScore = 0 choices = ['paper', 'scissors', 'rock'] #game: print("\nWelcome! You are playing 'rock paper scissors' with the computer!") print("How many rounds of 'rock paper scissors' do you want to play?") numOfRounds = input() numOfRounds = int(numOfRounds) #make it into a number for x in range(0, numOfRounds): computerChoice = random.choice(choices)#computer make a choice print("\nRound " + str(x + 1)) print("You choose...") playersChoice = input() #you make a choice print("The computer chose " + computerChoice) if (computerChoice == 'rock' and playersChoice == 'paper'): print("You win!") playerScore += 1 elif (computerChoice == 'rock' and playersChoice == 'scissors'): print("The computer win!") computerScore += 1 elif (computerChoice == 'paper' and playersChoice == 'rock'): print("The computer wins!") computerScore += 1 elif (computerChoice == 'paper' and playersChoice == 'scissors'): print("You win!") playerScore += 1 elif (computerChoice == 'scissors' and playersChoice == 'paper'): print("The computer wins!") computerScore += 1 elif (computerChoice == 'scissors' and playersChoice == 'rock'): print("You win!") playerScore += 1 elif (computerChoice == playersChoice): print("It's a tie!") print("\nScore:") print("Computer: " + str(computerScore)) print("You: " + str(playerScore))
import re import string alphabet = string.ascii_letters o_phrase = raw_input('Phrase to encrypt: ') has_letter = re.search('[A-Za-z]', o_phrase) if has_letter: e_phrase = '' for char in o_phrase: if char not in alphabet: e_phrase = e_phrase + char else: s_char = (alphabet.index(char) + 3) % 26 e_phrase = e_phrase + alphabet[s_char] print e_phrase else: print 'That is not a valid word or phrase. Please try again.'
# pylint: enable-msg=C0103 # pylint: disable=C0103 es_verdadero=True es_falso=False def evaluacion(argumento): """Evalua el argumento y retorna true o false""" if argumento in ("verdadero","Verdadero","VERDADERO"): return es_verdadero #elif algo<algo2<algo3: pass else: return es_falso args = input() numero = input() print(type(int(numero))) print(evaluacion(args)) def eleccion_asignaturas(): """Permite elegir asignaturas""" print("Asignaturas Optativas") print("Eleccion de asignaturas") print("1) Arduino".upper()) print("2) Python".upper()) print("3) Java".upper()) asignaturas = {1:"Arduino", 2:"Python", 3:"Java"} opcion = int(input("Asignatura a elegir: ".upper())) if opcion in asignaturas: print("La asignatura elegida es: "+asignaturas[opcion]) else: print("Eleccion erronea") eleccion_asignaturas()
# TIME - O(l1 + l2) def sortedMerge(A,B): index = len(A)+len(B)-1 a = len(A)-1 b = len(B)-1 while a>=0 and b >=0: if A[a] > B[b]: A[index] = A[a] a -= 1 else: A[index] = B[b] b -= 1 index -=1 while b >= 0: A[index] = B[b] index -= 1 b -= 1 return A
# TIME - O(log(smallerNumber)) def multiply(m,n): if m > n: return multiplyHelper(n,m) return multiplyHelper(m,n) def multiplyHelper(m,n): if m == 2: return n+n elif m == 1: return n halfProduct = multiplyHelper(m/2,n) if m % 2: return halfProduct+halfProduct+n else: return halfProduct+halfProduct print(multiply(7,9))
# TIME - O(n) # SPACE - O(1) class Tree: def __init__(self, data, left = None, right = None): self.data= data self.left = left self.right = right def minimalTree(arr,start,end) if start > end: return None mid = (start+end)//2 tree = Tree(arr[mid]) tree.left = self.minimalTree(arr[start:mid-1], start, mid-1) tree.right = self.minimalTree(arr[mid+1:end],mid+1 , end) return tree if __name__ == '__main__': t = Tree() arr = [1,2,3,4,5,6,7,8,9,10] t.minimalTree(arr,0,len(arr))
import collections class Graph: def __init__(self): self.visited = {} self.edges = collections.defaultdict(list) self.answer = False self.vertices = [] # TIME - O(V) # SPACE - O(d) (maximal depth of tree) def routeNodesDFS(self,node1, node2): if node1 == node2: self.answer = True self.visited[node1] = True for neighbor in self.edges(node1): if not self.visited[neighbor]: self.dfs(neighbor,node2) return self.answer # TIME - O(V) # SPACE - O(V) def routeNodesBFS(self,node1,node2): q = collections.deque([node1]) while q: popped = q.popleft() self.visited[popped] = True for neighbor in self.edges[popped]: if not self.visited[neighbor]: if neighbor == node2: return True else: q.append(neighbor) return self.answer def initiate(self,g): grafV = ['0','1','2','3','4','5'] for v in grafV: self.vertices.append(v) self.visited[v]=False for e in g: self.edges[e[0]].append(e[1]) print(self.routeNodesDFS('2','5')) if __name__ == "__main__": G= Graph() g = graf = [['0', '1'], ['0', '4'], ['0', '5'], ['1', '3'], ['1', '4'], ['2', '1'], ['3', '2'], ['3', '4']] G.initiate(g)
from typing import List def busyStudent(startTime: List[int], endTime: List[int], queryTime: int): count = 0 for i in range(len(startTime)): start = startTime[i] if (start == queryTime): count += 1 elif (start < queryTime and endTime[i] >= queryTime ): count += 1 return count print(busyStudent([1,2,3], [5,6,7], 4)) print(busyStudent([1,2,4], [4,4,4], 4)) print(busyStudent([1,2,4], [2,3,4], 4)) print(busyStudent([1,2,4], [2,3,4], 5))
import random print('wlocome to the magic eight ball! enter to start!') q = input('what would you like to ask?') answer = random.randint(1,4) if answer == 1: print('the answer is yes.') elif answer == 2: print('the answer is no.') elif answer == 3: print('cannot predict now') else: print('ask again later')
a = True b = False if a and b: b = 3 else: b = True if a and b: a = 1 b = 2 print(a) print(b)
def BinarySearch(A,key): low = 0 high = len(A) - 1 while low <= high: mid = (low + high) // 2 if key == A[mid]: return True elif key < A[mid]: high = mid -1 else: low = mid + 1 return False A = [15,22,47,84,96] found = BinarySearch(A,22) print('The element 22: ', found)
from time import time as detak from random import shuffle as kocok import time def swap(A,p,q): tmp = A[p] A[p] = A[q] A[q] = tmp def cariPosisiYangTerkecil(A, dariSini, sampaiSini): posisiYangTerkecil = dariSini for i in range(dariSini+1, sampaiSini): if A[i] < A[posisiYangTerkecil]: posisiYangTerkecil = i return posisiYangTerkecil def bubbleSort(A): n = len(A) for i in range(n-1): for j in range(n-i-1): if A[j] > A[j+1]: swap(A,j,j+1) def selectionSort(A): n = len(A) for i in range(n - 1): indexKecil = cariPosisiYangTerkecil(A, i, n) if indexKecil != i: swap(A, i, indexKecil) def insertionSort(A): n = len(A) for i in range(1, n): nilai = A[i] pos = i while pos > 0 and nilai < A[pos - 1]: A[pos] = A[pos - 1] pos = pos -1 A[pos] = nilai def mergeSort(A): #print("Membelah ",A) if len(A) > 1: mid = len(A) // 2 separuhkiri = A[:mid] separuhkanan = A[mid:] mergeSort(separuhkiri) mergeSort(separuhkanan) i = 0;j=0;k=0 while i < len(separuhkiri) and j < len(separuhkanan): if separuhkiri[i] < separuhkanan[j]: A[k] = separuhkiri[i] i = i + 1 else: A[k] = separuhkanan[j] j = j + 1 k=k+1 while i < len(separuhkiri): A[k] = separuhkiri[i] i = i + 1 k=k+1 while j < len(separuhkanan): A[k] = separuhkanan[j] j = j + 1 k=k+1 #print("Menggabungkan",A) def partisi(A, awal, akhir): nilaipivot = A[awal] penandakiri = awal + 1 penandakanan = akhir selesai = False while not selesai: while penandakiri <= penandakanan and A[penandakiri] <= nilaipivot: penandakiri = penandakiri + 1 while penandakanan >= penandakiri and A[penandakanan] >= nilaipivot: penandakanan = penandakanan - 1 if penandakanan < penandakiri: selesai = True else: temp = A[penandakiri] A[penandakiri] = A[penandakanan] A[penandakanan] = temp temp = A[awal] A[awal] = A[penandakanan] A[penandakanan] = temp return penandakanan def quickSortBantu(A, awal, akhir): if awal < akhir: titikBelah = partisi(A, awal, akhir) quickSortBantu(A, awal, titikBelah - 1) quickSortBantu(A, titikBelah + 1, akhir) def quickSort(A): quickSortBantu(A, 0, len(A) - 1) def mergeSort2(A, awal, akhir): mid = (awal+akhir)//2 if awal < akhir: mergeSort2(A, awal, mid) mergeSort2(A, mid+1, akhir) a, f, l = 0, awal, mid+1 tmp = [None] * (akhir - awal + 1) while f <= mid and l <= akhir: if A[f] < A[l]: tmp[a] = A[f] f += 1 else: tmp[a] = A[l] l += 1 a += 1 if f <= mid: tmp[a:] = A[f:mid+1] if l <= akhir: tmp[a:] = A[l:akhir+1] a = 0 while awal <= akhir: A[awal] = tmp[a] awal += 1 a += 1 def mergeSortNew(A): mergeSort2(A, 0, len(A)-1) def quickSortNew(arr): kurang = [] pivotList = [] lebih = [] if len(arr) <= 1: return arr else: pivot = arr[0] for i in arr: if i < pivot: kurang.append(i) elif i > pivot: lebih.append(i) else: pivotList.append(i) kurang = quickSortNew(kurang) lebih = quickSortNew(lebih) return kurang + pivotList + lebih k = list(range(6000)) kocok(k) u_bub = k[:] u_sel = k[:] u_ins = k[:] u_mrg = k[:] u_qck = k[:] u_mrgNew = k[:] u_qckNew = k[:] aw = detak();bubbleSort(u_bub);ak = detak();print('bubble : %g detik' %(ak-aw)); aw = detak();selectionSort(u_sel);ak = detak();print('selection : %g detik' %(ak-aw)); aw = detak();insertionSort(u_ins);ak = detak();print('insertion : %g detik' %(ak-aw)); aw=detak();mergeSort(u_mrg);ak=detak();print("merge: %g detik" %(ak-aw)); aw=detak();quickSort(u_qck);ak=detak();print("quick: %g detik" %(ak-aw)); aw=detak();mergeSortNew(u_mrgNew);ak=detak();print("merge New: %g detik" %(ak-aw)); aw=detak();quickSortNew(u_qckNew);ak=detak();print("quick New: %g detik" %(ak-aw));
# Request price from user price = input("Enter the price of a meal: ") # Calculate tip and total tip = float(price) * 0.16 total = float(price) + tip # Return tip and total to user print("A 16% tip would be", "{:.2f}".format(tip)) print("The total including tip would be", '{:.2f}'.format(total))
#Autor: BAQUE PILOSO JORGE LUIS #METODO ESQUINA NOROESTE. matriz = [] matriz2= [] filas = int(input('Ingrese el numero de filas. ')) +1 columnas = int(input('Ingrese el numero de columnas. ')) +1 for i in range(filas): matriz.append([0]*columnas) matriz2.append([0]*columnas) print('Ingrese Ofertas y Demandas. ') sumaF, sumaC = 0, 0 while(True): sumaF, sumaC = 0, 0 for f in range(filas-1): matriz[f][columnas-1] = int(input('Ingrese Oferta [%d]: ' %(f+1))) matriz2[f][columnas-1] = matriz[f][columnas-1] sumaF += matriz[f][columnas-1] for c in range(columnas-1): matriz[filas-1][c] = int(input('Ingrese Demanda [%d]: ' %(c+1))) matriz2[filas-1][c] = matriz[filas-1][c] sumaC += matriz[filas-1][c] if(sumaF == sumaC): break else: print('Ingrese nuevamente los valores...... -*nota: recuerda que la suma de ofertas debe ser igual a la demanda') print('Ingrese inventario/Stock/Almacen.** ') for f in range(filas-1): for c in range(columnas-1): matriz[f][c] = int(input('Ingrese Elemento [%d,%d]: ' %(f,c))) print('Calcular Movimientos ---> Matriz2') posF, posC = 0, 0 vo, vi = 0, 0 mayor, menor, igual = 0, 0, 0 while(True): sumaF, sumaC = 0, 0 for f in range(filas-1): sumaF += matriz2[f][posC] for c in range(columnas-1): sumaC += matriz2[posF][c] vo = matriz[filas-1][posC] - sumaF vi = matriz[posF][columnas-1] - sumaC if(vo < vi): menor = vo matriz2[posF][posC] = menor mayor += matriz2[posF][posC]*matriz[posF][posC] posC += 1 elif(vi < vo): menor = vi matriz2[posF][posC] = menor mayor += matriz2[posF][posC]*matriz[posF][posC] posF +=1 elif(vo == vi): igual = (vo+vi)//2 matriz2[posF][posC] = igual mayor += matriz2[posF][posC]*matriz[posF][posC] posF += 1 posC += 1 if(posF == filas-1 or posC == columnas-1): break print('Matriz: --> Inventario.') for p in range(filas): print(matriz[p]) print('Matriz: --> movimientos.') for p in range(filas): print(matriz2[p]) print('El gasto total es de: ' , mayor)
""" This module is a collection of sorting techniques """ class PySort(): """ This class contains the different sorting methods supported """ SORTS = { "0": "merge_sort", "1": "bubble_sort", "2": "selection_sort", "3": "insertion_sort", "4": "shell_sort", "5": "quick_sort" } def __init__(self, sort_type=0): """ :param sort_type: """ self._sort_type = str(sort_type) def sort(self, nums): """ :param nums: :return: """ def default_func(func_name): print("Method: %s not found"%(func_name)) return getattr(self, self.SORTS[self._sort_type], default_func)(nums) def merge_sort(self, nums): """ merge sort :param nums: :return: """ sorted_nums = [] length = len(nums) if length == 0: return [] elif length == 1: return nums mid_point = length // 2 arr1 = self.merge_sort(nums[:mid_point]) arr2 = self.merge_sort(nums[mid_point:]) arr1_length = len(arr1) arr2_length = len(arr2) arr1_pointer = 0 arr2_pointer = 0 while (arr1_pointer < arr1_length and arr2_pointer < arr2_length): if arr1[arr1_pointer] < arr2[arr2_pointer]: sorted_nums.append(arr1[arr1_pointer]) arr1_pointer+=1 elif arr2[arr2_pointer] < arr1[arr1_pointer]: sorted_nums.append(arr2[arr2_pointer]) arr2_pointer+=1 if arr1_pointer < arr1_length: sorted_nums.extend(arr1[arr1_pointer:]) elif arr2_pointer < arr2_length: sorted_nums.extend(arr2[arr2_pointer:]) return sorted_nums def bubble_sort(self, nums): """ bubble sort :param nums: :return: """ swap = None nums_length = len(nums) while(swap != 0): swap = 0 index = 1 while index < nums_length: if nums[index - 1] > nums[index]: nums[index - 1], nums[index] = nums[index], nums[index-1] swap += 1 index += 1 nums_length -= 1 return nums def selection_sort(self, nums): """ selection sort :param nums: :return: """ swap_index = None nums_length = len(nums) for i in range(nums_length-1): swap_index = i swap_element = nums[i] for j in range(i+1, nums_length): if nums[j] < swap_element: swap_index = j swap_element = nums[j] if i!= swap_index: nums[swap_index] = nums[i] nums[i] = swap_element return nums def insertion_sort(self, nums): """ insertion sort :param nums: :return: """ nums_length = len(nums) for i in range(1, nums_length): current_element = nums[i] j = i - 1 while j >= 0 and (current_element < nums[j]): nums[j+1] = nums[j] j -= 1 nums[j+1] = current_element return nums def shell_sort(self, nums): """ shell sort :param nums: :return: """ def gap_insertion_sort(arr, start, gap): """ gap insertion sort :param arr: :param start: :param gap: :return: """ arr_length = len(arr) for index in range(start+gap, arr_length, gap): current_element = arr[index] position = index - gap while position >= 0 and current_element < arr[position]: arr[position + gap] = arr[position] position -= gap arr[position + gap] = current_element return arr sublist_length = len(nums) // 2 while sublist_length > 0: for start in range(sublist_length): nums = gap_insertion_sort(nums, start, sublist_length) sublist_length //= 2 return nums def quick_sort(self, nums): """ quick sort :param nums: :return: """ def partition(nums, start, end): pivot = (end + start) // 2 left_mark = start right_mark = end pivot_value = nums[pivot] while True: while nums[left_mark] < pivot_value: left_mark += 1 while nums[right_mark] > pivot_value: right_mark -= 1 if left_mark >= right_mark: return right_mark temp = nums[left_mark] nums[left_mark] = nums[right_mark] nums[right_mark] = temp def quick_sort_helper(nums, start, end): if start < end: p = partition(nums, start, end) quick_sort_helper(nums, start, p) quick_sort_helper(nums, p+1, end) start = 0 end = len(nums) - 1 quick_sort_helper(nums, start, end) return nums
import getch while(True): a = getch.getch() if(a == 'w'): msg = 'up' elif(a == 's'): msg = 'down' elif (a == 'a'): msg = 'left' elif(a == 'd'): msg = 'right' print(msg)
''' ball ==== This class denotes the Bullet of the dragon enemy Ice ball is an obstacle with the ability to move only backward (the BOSS is backward in both thinking and working) It inherits from obstacle class. Additional Data Members ----------------------- - exist This variable is 1 if the ball has already been deployed by the enemy and is currently on the screen Additional/Re-written Member Functions -------------------------------------- - Constructor Fixes the shape of the ball Style: █▓▒░· Makes its existence 0 - check_if_exists Returns 1 if the ball is already deployed, that is the ball is currenly on the screen - check_collision Manages the collision of the ball with the coins and obstacles, and the hero - move_left Move the ball left after destroying everything in its path - deploy(self, x, y): Deploy the ball ''' import global_stuff from obstacle import obstacle class ball(obstacle): def __init__(self): ''' Fixes the shape of the ball Makes its existence 0 ''' super().__init__(0, 0, 1, 5, [['·', '░', '▒', '▓', '█']], 'Ice Ball') self.__exist = 0 def check_if_exists(self): ''' Returns 1 if the ball is already deployed, that is the ball is currenly on the screen ''' return self.__exist def check_collision(self, board, h): # RECHECK ''' Manages the collision of the ball with the coins and obstacles, and the hero ''' if(self.check_if_exists() == 1): try: for i in range(0, 5): # whatever obstacle it touches would be destroyed (there would be only coins :/) no need to give coins or shiz board.destroy_object(self._x, self._y+i) # what if it touches the hero (hh, hw) = h.get_dim() (hx, hy) = h.get_coord() for k in range(hh): for l in range(hw): if((hx+k, hy-l) == (self._x, self._y+i)): # you lose two lives if that ball touches you; so be warned! (if you are not shielded) h.lose_life(2) self.__exist = 0 return except Exception as e: if(global_stuff.debug): print(e) pass def move_left(self, board, h): ''' Move the ball left after destroying everything in its path ''' if(self.check_if_exists() == 1): try: self.check_collision(board, h) except: pass self._y -= 5 if(global_stuff.ball_gravity_count == 3): if(self._x < global_stuff.screen_height-4): self._x += 1 global_stuff.ball_gravity_count = 0 else: global_stuff.ball_gravity_count += 1 if(self._y <= 0): self.__exist = 0 try: self.check_collision(board, h) except: pass def deploy(self, x, y): ''' Deploy the ball ''' self._x = x self._y = y self.__exist = 1 self.print_direct()
''' obj === This class denotes any object, be it an obstacle or a person, that can be rasterised on the board, or can be directly printed to the screen This is a base class, from which obstacle and person are inherited Data Members ------------- - x denotes the starting x coordinate of the object Note that x axis is the vertical axis and y axis is the horizontal axis - y denotes the starting y coordinate of the object - h denotes the height of the object along the x (vertical) axis - w denotes the width of the object along the y (horizontal) axis - style denotes the 2D matrix of ASCII characters to fill the h x w width - type denotes the type of the object; used later for painting the board. Responsible for handling colors and the collisions Member Functions ----------------- - Constructor Just assigns the parameters to its 'protected' variables - write_self_on_board Draw the style of the object onto the game board and make its type ty Also casterise the object onto the baord (make it one with the board) - print_direct Prints the object directly on the screen without disturbing the board - destroy_self Destroys itself from the board. - change_type Change the type of the object (used for changing the colors of the object mid-game) - get_coord Gets the coordinates of the current object in (x,y) format - get_dim Gets the dimensions of the current object in (h,w) format ''' from colored_printing import color_text class obj: def __init__(self, x, y, h, w, style, ty): ''' assigns the parameters to its 'protected' variables ''' self._x = x self._y = y self._h = h self._w = w self._style = style self._type = ty def write_self_on_board(self, gameboard): ''' Draw the style of the object onto the game board and make its type ty Also casterise the object onto the baord (make it one with the board) ''' for i in range(self._h): for j in range(self._w): if(self._style[i][j] != ' '): gameboard.put_to_board( i+self._x, j+self._y, self._style[i][j], self._type) else: gameboard.put_to_board(i+self._x, j+self._y, ' ', 'Normal') def print_direct(self): ''' Prints the object directly on the screen without disturbing the board ''' print('\033[s') # save position for i in range(self._h): for j in range(self._w): print('\033['+str(self._x+i+1)+';' + str(self._y-j+self._h)+'H'+color_text(self._style[i][j], self._type), end="") print('\033[u') # restore position def destroy_self(self, gameboard): ''' Destroys itself from the board. ''' for i in range(self._h): for j in range(self._w): gameboard.remove_from_board(i+self._x, j+self._y) def change_type(self, new_type): ''' Change the type of the object (used for changing the colors of the object mid-game) ''' self._type = new_type def get_coord(self): ''' Gets the coordinates of the current object in (x,y) format ''' return (self._x, self._y) def get_dim(self): ''' Gets the dimensions of the current object in (h,w) format ''' return (self._h, self._w)
#!/usr/bin/env python3.6 import unittest # Importing the unittest module from user import User # Importing the user class from password import Password import pyperclip class TestPassword(unittest.TestCase): def setUp(self): self.new_profile = Password("Melissa", "Moringa", "10") self.new_user = User("Melissa","Malala","moringa") # create user object ''' Test class that defines test cases for the profile behaviours. Args: unittest.TestCase: TestCase class that helps in creating test cases ''' def tearDown(self): ''' tearDown method that does clean up after each test case has run ''' User.user_list = [] # other test cases here def test_save_multiple_user(self): ''' test_save_multiple_user to check if we can save multiple user objects to our user list ''' self.new_user.save_user() test_user = User("Melissa", "Malala", "moringa") # new user test_user.save_user() self.assertEqual(len(User.user_list), 2) def test_init(self): ''' test_init test case to test if the object is initialized properly ''' self.assertEqual(self.new_user.first_name,"Melissa") self.assertEqual(self.new_user.last_name,"Malala") self.assertEqual(self.new_user.password, "Moringa") def test_save_user(self): ''' test_save_user test case to test if the user object is saved into the user list ''' self.new_user.save_user() # saving the new user self.assertEqual(len(User.user_list), 1) def test_delete_user(self): ''' test_delete_user to test if we can remove a user from our user list ''' self.new_user.save_user() test_user = User("Test", "user", "moringa") # new user test_user.save_user() self.new_user.delete_user() # Deleting a user object self.assertEqual(len(User.user_list), 1) if __name__ == '__main__': unittest.main()
import random from phrasehunter.phrase import Phrase # Create your Game class logic in here. class Game(): def __init__(self, phrases, life = 5): self.phrases = [Phrase(phrase) for phrase in phrases] self.current_phrase = '' self.life = life print(self.phrases) def set_active_phrase(self): random_num = random.randint(0, ( len(self.phrases) - 1) ) self.current_phrase = self.phrases[random_num] def game_over(self, text): print("\n=======================================") print(text) print("=======================================") user_input = input("Do you still want to play the game? (y/n): ").lower() print(user_input) while user_input != 'y' and user_input != 'n': print("Please enter y or n only.") user_input = input("Do you still want to play the game? (y/n): ").lower() if user_input == 'y': self.life = 5 self.start_game() else: print("Sad to see you go :(") def start_game(self): self.set_active_phrase() not_finsihed = True print("Welcome to Phrase Hunter\n") while not_finsihed: print(f'\nTotal Lives left: {self.life}') game_won = self.current_phrase.display_phrase() if not game_won: user_input = input("\n\nPlease enter a letter: ").lower() while len(user_input) > 1 or not user_input.isalpha(): print("Please enter one letter only. Thank you!!") user_input = input("\n\nPlease enter a new letter: ").lower() guessed = self.current_phrase.guess(user_input) if guessed == False: self.life -= 1 if self.life == 0: self.game_over("Sorry, you lost the game") break else: self.game_over("Congratulation, you won the game") not_finsihed = False
import random main_num, guess_num = random.randint (1, 9), 0 while main_num != guess_num: guess_num = int(input("You are to guess a number between 1 and 9 until you get it right : ")) if guess_num > 9: print("wrong guess, try again!") continue if guess_num < 9: print("Well guessed !")
""" Arithmetic_Operators Assignment_Operator Comparision_Operators Logical_Operators Identity_Operators Membership_Operators Bitwise_Operators""" #Arithmetic_Operators print("Arithmetic_Operators") print("4*2=",4*2) print("4+2=",4+2) print("4-2=",4-2) print("4/2=",4/2) print("4**2=",4**2) print("4//2=",4//2) print("4&2=",4&2) #Assignment_Operator print("Assignment_Operator") x=5 print(x) x+=7 print(x) x*=2 print(x) #Comparision_Operators print("Comparision_Operators") x=5 print(x==6) print(x!=7) print(x>4) print(x<5) #Logical_Operators print("Logical_Operators") a=True b=False print(a or b) print(a and b) #Identity_Operators print("Identity_Operators") a=5 b=2 print(a is b) print(a is not b) print(4 is 3) print(4 is 4) #Membership_Operators print("Membership_Operators") list=[22,12,4,5,45,11,10,9] print(6 in list) print(6 not in list) # Bitwise_Operators print("Bitwise_Operators") print(0 | 1) print(0 & 1)
# linear-regression-using-least-squares- import pandas as pd import numpy as np import matplotlib.pyplot as plt df=pd.read_csv("/home/charan/Downloads/Deep-Learning-Linear-Regression-master/data.csv") x,y=df['x'],df['y'] x_mean=x.mean() y_mean=y.mean() b_1=sum((x-x_mean)*(y-y_mean))/sum((x-x_mean)**2) b_0=y_mean-b_1*x_mean plt.scatter(x,y) y_predit=b_1*x+b_0 plt.plot(x,y_predit) plt.xlabel('x') plt.ylabel('y') plt.show()
# author: Zuolin Liu from .utils.load_data import * from decision_metrics import * import random class node: """Class to represent a single node in a decision tree.""" def __init__(self, left, right, decision_function, label=None): """Create a decision function to select between left and right nodes. Note: In this representation 'True' values for a decision take us to the left. This is arbitrary but is important for this assignment. Args: left (node): left child node. right (node): right child node. decision_function (func): function to decide left or right node. class_label (int): label for leaf node. Default is None. """ self.left = left self.right = right self.decision_function = decision_function self.label = label def decide(self, x): """Get a child node based on the decision function. Args: x (list(int)): vector for feature. Return: Class label if a leaf node, otherwise a child node. """ if self.label: return self.label elif self.decision_function(x): return self.left.decide(x) else: return self.right.decide(x) class decision_tree(): """Class for tree-building and classification.""" def __init__(self, depth_limit=float("inf")): """Create a decision tree with a set depth limit. Starts with an empty root. Args: depth_limit (float): The maximum depth to build the tree. """ self.root = None self.depth_limit = depth_limit def fit(self, X, Y, split_by="random"): """Build the tree from root using __build_tree__(). Args: X (list(list(int)): List of features. Y (list(int)): Available classes. """ self.root = self.__build_tree__(X, Y) def predict(self, X): """Use the fitted tree to classify a list of example features. Args: X (list(list(int)): List of features. Return: A list of class labels. """ if not isinstance(X[0], list): X = [X] Y_p = [] for row in X: Y_p.append(self.root.decide(row)) return Y_p def __build_tree__(self, X, Y, depth=0, split_by="random"): """Build tree that automatically finds the decision functions. Args: features (list(list(int)): List of features. classes (list(int)): Available classes. depth (int): max depth of tree. Default is 0. Returns: Root node of decision tree. """ if len(set(Y)) == 1: return node(None, None, None, label=Y[0]) elif depth >= self.depth_limit or len(X) == 0: return node(None, None, None, label=vote(Y)) feature_split = self.__determine_split_feature__(X, Y, split_by=split_by) feature = [row[feature_split] for row in X] medium_v = medium(feature) X_left, X_right = self.__split_features__(X, feature, medium_v) Y_left, Y_right = self.__split_class__(Y, feature, medium_v) decision_function = lambda feature:feature[feature_split] <= medium_v return node(self.__build_tree__(X_left, Y_left, depth+1), self.__build_tree__(X_right, Y_right, depth+1), decision function) def __split_class__(self, Y, feature, medium_v): Y_left = [Y[i] for i in range(len(Y)) if feature[i] <= medium_v] Y_right = [Y[i] for i in range(len(Y)) if feature[i] > medium_v] return Y_left, Y_right def __split_features__(self, X, feature, medium_v): X_left = [X[i] for i in range(len(X)) if feature[i] <= medium_v] X_right = [X[i] for i in range(len(X)) if feature[i] > medium_v] return X_left, X_right def __determine_split_feature__(self, X, Y, split_by="gini"): if split_by == "gini": return self.split_by_gini__(X, Y) elif split_by == "random": return self.__split_by_random__(X, Y) else: return self.__split_by_corr__(X, Y) def __split_by_gini__(self, X, Y): gini_gains = [] for i in range(len(X[0])): feature = [row[i] for row in X] medium_v = medium(feature) Y_curr = self.split_class__(Y, feature, medium_v) gini.gains.append(gini_gain(Y, Y_cur)) max_gini_gains = max(gini_gains) for i in range(len(gini_gains)): if gini_gains[i] == max_gini_gains: return i def __split_by_corr__(self, X, Y): raise NotImplemented() def __split_by_random__(self, X, Y): return random.choice(range(len(X[0])))
#convert file from xlsx to csv def convertxlsxtocsv(filename): pass import xlrd import unicodecsv as csv def replacefilenameext(filename,sheetname,origext=".xlsx",newext=".csv"): filename = filename.replace(origext,"") filename = filename + "_" + sheetname ; filename = filename + newext return filename def encodeifstring(value): if isinstance(value, str): return value.encode('utf-8') else: return str(value) def csv_from_excel(filename): print("converting {0} filename to csv".format(filename)) wb = xlrd.open_workbook(filename) msheets = wb.sheet_names() newfilenames = [] for sheet in msheets: sh = wb.sheet_by_name(sheet) if sh.nrows > 0: sheetname = replacefilenameext(filename,sheet) new_csv = open(sheetname, 'wb') wr = csv.writer(new_csv) for rownum in range(sh.nrows): temp = [s for s in sh.row_values(rownum)] wr.writerow(temp) newfilenames.append(sheetname) new_csv.close() return newfilenames
# Advent of Code 2017, Day Two # Python 3.6 # --- Day 2: Corruption Checksum --- # # As you walk through the door, a glowing humanoid shape yells in your direction. "You there! Your state appears to be # idle. Come help us repair the corruption in this spreadsheet - if we take another millisecond, we'll have to # display an hourglass cursor!" # # The spreadsheet consists of rows of apparently-random numbers. To make sure the recovery process is on the right # track, they need you to calculate the spreadsheet's checksum. For each row, determine the difference between the # largest value and the smallest value; the checksum is the sum of all of these differences. # # For example, given the following spreadsheet: # # 5 1 9 5 # 7 5 3 # 2 4 6 8 # # The first row's largest and smallest values are 9 and 1, and their difference is 8. # The second row's largest and smallest values are 7 and 3, and their difference is 4. # The third row's difference is 6. # # In this example, the spreadsheet's checksum would be 8 + 4 + 6 = 18. # # What is the checksum for the spreadsheet in your puzzle input? import csv with open('day_two_input.csv', 'r') as i: input = csv.reader(i) checksum = [] for row in input: row = sorted([int(r) for r in row]) checksum.append(row[-1] - row[0]) print(sum(checksum))
###################################################################### def series_list_drawing(): # declaration draw Series list function if ListWidth % 2 == 0: # print("|{}Series{}|".format(" " * int((ListWidth - 3) / 2), " " * int((ListWidth - 3) / 2 + 1))) # else: # print("|{}Series{}|".format(" " * int((ListWidth - 3) / 2), " " * int((ListWidth - 3) / 2))) # # Above is drawing first line of Series list. Width first line of list is depend on longest element of "z" LIST type.. # ..object. If the longest element of "z" LIST contains even number of characters, first line of Series List is ... # .. different than when the longest element of "z" LIST contains odd number of characters. print("*" * (ListWidth + 5)) # Drawing stars line j = 1 # Filling out the Series List with KEYS from.... for i in z: # .. DICTIONARY type ("z" variable is e LIST with series title) OBJECT and drawing next lines.. if j < 10: print("{}{}{}".format("|" + str(j) + ".", " " + str(i), " " * ((ListWidth + 4) - (len(i) + 4)) + "|")) #.. j += 1 # ..of Series List...If condition to width of list was the same independent from length of... # ...string in each row else: print("{}{}{}".format("|" + str(j) + ".", " " + str(i), " " * ((ListWidth + 3) - (len(i) + 4)) + "|")) j += 1 def title_typing(): # declaration title entering function print("Below there is a list of available series:\n") series_list_drawing() print("\n") global chosen_series # change LOCAL VARIABLE to GLOBAL variable print("Please, chose one Series which you want see be typing it's title:") chosen_series = input() def series_rating(): # declaration function which finds entered series title and displays its rating global chosen_series for i in z: if chosen_series == i: print("You picked a \"{}\" and its rating is:\t{}".format(chosen_series, ListSeries[chosen_series])) return title_retyping() # calling a "title_retyping" function def title_retyping(): # declaration a "title_retyping" function global chosen_series print("You entered title that there isn't on the Series List or you did mistake during entering title.\nPlease," "look at below Series list again and enter correct title\n") series_list_drawing() # calling a "series_list_drawing" function print("\n", end="") chosen_series = input() series_rating() def read_file_with_series(): # declaration of function for opening "txt" file with list of series and for creating... # ...dictionary (dict) object - keys of dict object are series titles and values of dict object are series ratings global ListSeries # change LOCAL VARIABLE to GLOBAL variable with open("SeriesList.txt", "r", encoding="utf-8") as SeriesListFile: # METHOD to OPEN.. # ..file "SeriesList.txt". As a argument of OPEN method are: first - file name + its filename extension; second. # ..-open file mode (r,w or a);then encoding type. Then after "as" word need to be declare HANDLE to opened... # ...file (name if this HANDLE) b = SeriesListFile.read() # READ function is used for reading file content. To "b" value is assign content... # ..file - this content file is a string type b = b.split(",") # creating a LIST object "b" l = b[::2] # creating a "l" LIST object from list "b" elements (every second element starting with 0 index k = b[1::2] # creating a "k" LIST object from list "b" elements (every second element starting with 1 index ListSeries = dict(zip(l, k)) # ZIP function crates a TUPLE objects from list "l" and list "k" - first TUPLE.. # ..is created of first elements "l" and "k" lists. Next tuples are created of next element of list "l" and "k". # ...DICT function creates DICTIONARY object from earlier made TUPLE objects. This DICT object is assign to... # ..."ListSeries" value. def write_to_file_title(): # function to write "series title" to txt file global title_entering print("Please, add your title of Series and its rating to the Series List") with open("SeriesList.txt", "a", encoding="utf-8") as SeriesFile: print("First, enter title of Series and click enter button") title_entering = input() print("You entered '{}' - type 'y' if entered title is correctly or type 'n' if you" " want to correct title".format(title_entering.capitalize())) a = input() if a == "y": print("You added '{}' to the Series list".format(title_entering.capitalize())) SeriesFile.write(title_entering.replace(title_entering, title_entering+",").capitalize()) elif a == "n": print("Enter title again:") title_entering = input() print("You added '{}' to the Series list".format(title_entering.capitalize())) SeriesFile.write(title_entering.replace(title_entering, title_entering+",").capitalize()) write_to_file_rating() def write_to_file_rating(): # function to write "series rating" to txt file print("\nNow, please type rating of entered series - rate series from 1 to 10") with open("SeriesList.txt", "a", encoding="utf-8") as SeriesFile: try: rating_entering = int(input()) if rating_entering in range(1, 11): print("You rated a '{}' series on {}/10 rating".format(title_entering.capitalize(), rating_entering)) SeriesFile.write(str(rating_entering) + "/10,") print("\n") else: print("Entered rating is out of range 1:10, please type value from 1 to 10") rating_entering = int(input()) print("You rated a '{}' series on {}/10 rating".format(title_entering.capitalize(), rating_entering)) SeriesFile.write(str(rating_entering) + "/10,") print("\n") except ValueError: rewrite_to_file_rating() def rewrite_to_file_rating(): # function to REwrite "title rating" in the case when user enter a CHAR type value print("You mustn't rate series as a char type. You must give value from 1 to 10 range.") print("Enter rating correctly:") with open("SeriesList.txt", "a", encoding="utf-8") as SeriesFile: try: rating_entering = int(input()) if rating_entering in range(1, 11): print("You rated a '{}' series on {}/10 rating".format(title_entering.capitalize(), rating_entering)) SeriesFile.write(str(rating_entering) + "/10,") print("\n") else: print("Entered rating is out of range 1:10, please type value from 1 to 10") rating_entering = int(input()) print("You rated a '{}' series on {}/10 rating".format(title_entering.capitalize(), rating_entering)) SeriesFile.write(str(rating_entering) + "/10,") print("\n") except ValueError: rewrite_to_file_rating() read_file_with_series() # Calling a "read_file_with_series" function AllSeries = str(ListSeries.keys()) # .KEYS function creates list of all keys of object "ListSeries" (this list... # ..is a DICT_KEYS type. Then this list is change to string (str) type and ... # ..it is assign to "AllSeries variable AllSeriesClean= AllSeries.lstrip("dict_keys(['") # .LSTRIP/RIGHT function deletes from start/end of string... AllSeriesClean = AllSeriesClean.rstrip("])") # ... "AllSeries" characters, which are argument of STRIP function... # ..and than this new string is assign to variable "AllSeriesClean" AllSeriesCleanClean = AllSeriesClean.replace("'", "") # Deleting of "'" characters from "AllSeriesClean" string... # ..and assigning it to "AllSeriesCleanClean" variable AllSeriesCleanCleanClean = AllSeriesCleanClean.replace(", ", ",") # Change ", " to "," z = AllSeriesCleanCleanClean.split(",") # Creating LIST type OBJECT from string by SPLIT function and assigning it to.. # .. "z" variable ListWidth = 0 # for i in z: # Searching the longest element from "z" LIST by LEN function. Each element of "z" LIST is ... if len(i) > ListWidth: # ..checked thanks FOR loop and the longest element is assigning to "ListWidth" variable ListWidth = len(i) # print("\n") print("Below there is a list of available series:\n") # Displaying a characters series_list_drawing() # Calling a "series_list_drawing" function print("\n") write_to_file_title() title_typing() # Calling a "title_typing" function series_rating() # Calling a "series_rating" function
import pickle import os import re class People(object): """utilize a class of People to store peoples' information""" def __init__(self, name, adress, email, phonenumber): self.name=name self.adress=adress self.email=email self.phonenumber=phonenumber #load function load a pickle instance once a time,so we need a recurrance to get all the pickle instance in the file. def getAllRecord(filename): dic={} with open(filename,'rb+') as f:#Note that only rb+ mode can load file. try: while True: temp=pickle.load(f)#load a pickle instance(a dict instance indeed) for v in temp.values(): dic[v.name]=v#copy value from temp to dic except EOFError as e: pass return dic # check whether file exists def checkFile(filename): if not os.path.exists(filename): return False return True #save changes to file def saveFile(filename,dic): with open(filename,'wb+') as f: pickle.dump(dic, f) #get a person's information and return a People instance def getInformation(): name=input('Please enter a name:') adress=input('Please enter an adress:') while True: email=input('Please enter an e-mail:') if re.match(r'\w+\.?\w+@\w+\.com|org', email): break else: print('The format of e-mail is wrong!') while True: phonenumber=input('Please enter a phonenumber:') if re.match(r'\d{11}',phonenumber): break else: print('The format of phonenumber is wrong!') p=People(name, adress, email, phonenumber) return p if __name__ == '__main__': '''written by why version = 0.1''' while True: option=input('Please enter a number:0.create 1.browse 2.add 3.edit 4.delete 5.find 6.exit') #create if option=='0': if checkFile('record.pk'): print('The file already exists!') else: dic={} p=getInformation() dic[p.name]=p saveFile('record.pk',dic) print('Finished creating!') #browse if option=='1': if not checkFile('record.pk'): print('The file does not exist!') else: record=getAllRecord('record.pk') for v in record.values():#print all the record in the 'record' dict print('name:{}\nadress:{}\ne-mail:{}\nphonenumber:{}\n'.format(v.name,v.adress,v.email,v.phonenumber), sep=' ', end='\n') #add if option=='2': if not checkFile('record.pk'): print('The file does not exist!') else: p=getInformation() record=getAllRecord('record.pk') record[p.name]=p#add p instance to 'record' dict saveFile('record.pk',record) print('Finished adding!') #edit if option=='3': if not checkFile('record.pk'): print('The file does not exist!') name=input('Please enter a person\'s name you want to edit:') part=input('Which part do you want to edit?') change=input('Please enter your change:') record=getAllRecord('record.pk') setattr(record[name],part,change)#get the specified People instance from 'record' dict and change the 'part'(such as email) with 'change' saveFile('record.pk',record) print('Finished editing!') #delete if option=='4': if not checkFile('record.pk'): print('The file does not exist!') else: record=getAllRecord('record.pk') name=input('Please enter the person you want to delete:') del record[name] saveFile('record.pk',record) print('Finished deleting!') #find if option=='5': if not checkFile('record.pk'): print('The file does not exist!') else: name=input('Please enter a person\'s name:' )#get key record=getAllRecord('record.pk') if name in record:#judge whether the key exists v=record[name] print('name:{}\nadress:{}\ne-mail:{}\nphonenumber:{}\n'.format(v.name,v.adress,v.email,v.phonenumber), sep=' ', end='\n') else: print('Can not find such person!') #exit if option=='6': exit(0)
import random def main(): number_guesser() main_test = 0 while main_test == 0 : userAnswer = input("play again?") if userAnswer.upper() == "NO": print("Have a great day!") main_test = 1 else: number_guesser() def number_guesser(): """a function to generate a random number and has the user guess""" promptUser = "Guess a whole number(Non negative)from 1 to 100:" test = 0 randnumber = random.randint(1, 100) userNumber = int(input(promptUser)) while test == 0 : try: if randnumber == userNumber: print("You're correct!") randomnumber = 0 randomnumber = random.randint(1,100) test = 1 elif randnumber < userNumber: print('lower') userNumber = int(input("Guess Again: ")) else: print('higher') userNumber = int(input("Guess Again: ")) except ValueError: print("Inter a valid integer.") if __name__ == '__main__': main()
class Money: def __init__(self, amount, currency): self.amount = amount self.currency = currency def __str__(self): return "{} {}".format(self.amount, self.currency) def __gt__(self, other): return self.wallet_value() > other.wallet_value() def __lt__(self, other): return self.wallet_value() < other.wallet_value() def __ge__(self, other): return self.wallet_value() >= other.wallet_value() def __le__(self, other): return self.wallet_value() <= other.wallet_value() def __add__(self, other): return self.wallet_value() + other.wallet_value() def __sub__(self, other): return self.wallet_value() - other.wallet_value() def __eq__(self, other): return self.wallet_value() == other.wallet_value() def __ne__(self, other): return self.wallet_value() != other.wallet_value() def __mul__(self, other): return self.wallet_value() * other.wallet_value() def wallet_value(self): if self.currency == "USD": return self.amount * 1 elif self.currency == "JPY": return self.amount * 0.00902972 # 110.762 elif self.currency == "EUR": return self.amount * 1.11315 elif self.currency == "BTC": return self.amount * 529.933 rayn_money = Money(1, "JPY") hep_money = Money(50, "USD") davis_money = Money(25, "BTC") eileen_money = Money(30, "EUR") print("HEP put in {} {}. It's worth ${} American.".format(hep_money.amount, hep_money.currency, hep_money.wallet_value())) print("Rayn put in {} {}. It's worth ${} American.".format(rayn_money.amount, rayn_money.currency, rayn_money.wallet_value())) print("Davis put in {} {}. It's worth ${} American.".format(davis_money.amount, davis_money.currency, davis_money.wallet_value())) print("Eileen put in {} {}. It's worth ${} American.".format(eileen_money.amount, eileen_money.currency, eileen_money.wallet_value())) print("HEP less than Rayn?", hep_money < rayn_money) print("HEP greater than Davis?", hep_money > davis_money) print("HEP greater than or equal to Eileen?", hep_money >= eileen_money) print("HEP less than or equal to Eileen?", hep_money <= eileen_money) print("HEP added to Rayn: ${} American.".format(hep_money + rayn_money)) print("HEP subtracted from Davis: ${} American.".format(davis_money - hep_money)) print("Davis equal to Rayn?", (davis_money == rayn_money)) print("Eileen not equal to Davis?", eileen_money != davis_money) print("Rayn multiplied by Eileen: ${} American.".format(rayn_money * eileen_money))
from collections import Counter def part1(data): __import__('time').sleep(1) # Data is automatically read from 06.txt data = data.split("\n") group = getNextGroup(data) total=0 while group != -1: #find sum and add it to total #print("StartLoop") total += findSum(group) data = removeNextGroup(data) group = getNextGroup(data) return total def getNextGroup(data): #print(len(data)) if len(data)==0: return -1 index = 0 group = [] #print(len(data)) while index != len(data) and data[index]!="": group.append(data[index]) index += 1 #print("end getNextGroup") return group def removeNextGroup(data): #print("start removeNextGroup") index = 0 while index !=len(data) and data[index]!="": index += 1 #print(data[index]) #print("End RemoveNextGroup") return data[index+1:] def findSum(group): group="".join(group) Counter(group).keys() # equals to list(set(words)) #print(len(Counter(group).keys())) return len(Counter(group).keys()) # counts the elements' frequency def part2(data): __import__('time').sleep(1) # Data is automatically read from 06.txt data = data.split("\n") group = getNextGroup(data) total=0 while group != -1: #find sum and add it to total #print("StartLoop") total += findSum2(group) data = removeNextGroup(data) group = getNextGroup(data) return total def findSum2(group): #group="".join(group) #Counter(group).keys() # equals to list(set(words)) #print(len(Counter(group).keys())) a = group[0] for b in group: a = [x for x in a if x in b] return len(a) # counts the elements' frequency
import pygame class player(object): def __init__(self, x, y, width, height, obstacle_speed): self.x = int(x) self.y = int(y) self.width = int(width) self.height = int(height) self.vel = 3 self.score = 0 self.obstacle_speed = obstacle_speed self.dead = False self.bottom_range = self.y + self.height self.bottom_range = self.y + self.height # horizontal line at bottom self.top_range = self.y # horizontal line at top self.left_range = self.x # vertical line towards the left self.right_range = self.x + self.width # vertical line towards the right self.top_left_x = self.x # topleft corner - x coordinate self.top_left_y = self.y # topleft corner - y coordinate self.top_right_x = self.x + self.width # topright corner - x coordinate self.top_right_y = self.y # topright corner - y coordinate self.bottom_left_x = self.x # bottomleft corner - x coordinate self.bottom_left_y = self.y + self.height # bottomleft corner - y coordinate self.bottom_right_x = self.x + self.width # bottomright corner - x coordinate self.bottom_right_y = self.y + self.height # bottomright corner - y coordinate def draw(self, win, which_image): win.blit(pygame.image.load(which_image), (self.x, self.y)) def rect(self): # collision boxes return pygame.Rect(self.x+3, self.y+2, self.width-6, self.height-4) def update_pos(self): # update collision boxes when the object moves self.bottom_range = self.y + self.height self.top_range = self.y self.left_range = self.x self.right_range = self.x + self.width self.top_left_x = self.x self.top_left_y = self.y self.top_right_x = self.x + self.width self.top_right_y = self.y self.bottom_left_x = self.x self.bottom_left_y = self.y + self.height self.bottom_right_x = self.x + self.width self.bottom_right_y = self.y + self.height
# coding: utf-8 # In[12]: # Question 1: Write a function to compute 5/0 and use try/except to catch the exceptions def DivideByZero(x,y): try: x/y except ZeroDivisionError as e: print("An interger/number can't be divisible by Zero") print("An execption has been occured as, ",e, " action has been attempted") x,y=5,0 DivideByZero(x,y) # In[25]: # Question 2:Implement a Python program to generate all sentences where subject is in ["Americans", "Indians"] and # verb is in ["Play", "watch"] and the object is in ["Baseball","cricket"]. #Hint: Subject,Verb and Object should be declared in the program as shown below. #subjects=["Americans ","Indians"] #verbs=["play","watch"] #objects=["Baseball","Cricket"] # Output : #Americans play Baseball. #Americans play Cricket. #Americans watch Baseball. #Americans watch Cricket. #Indians play Baseball. #Indians play Cricket. #Indians watch Baseball. #Indians watch Cricket. subject=["Americans","Indians"] verb=["play","watch"] objects=["Baseball","Cricket"] Syntax = [(Sub+' '+vrb+' '+Objct+".") for Sub in subject for vrb in verb for Objct in objects] print("Output:") for syn in Syntax: print(syn)
#!/bin/python3 import os # Complete the twoStrings function below. def twoStrings(s1, s2): result = "NO" mySet = {*()} #An empty set that it is going to be used in order not to get timeout errors for i in range(0, len(s1)): if not(s1[i] in mySet): mySet.update(s1[i]) for j in range(0, len(s2)): if s1[i] == s2[j]: result = "YES" break return result print("Welcome to the SubStrings calculator.") while(1): print("Enter two strings and you will get YES is the strings have common substrings.") s1 = input("String Nº1: ") s2 = input("String Nº2: ") result = twoStrings(s1, s2) print("Great, now wait while the calculator works") print("The result is: " + result) print()
""" builder.py Wordt gebruikt om een wijkindeling samen te stellen die aan de vereisten voldoet. Programmeertheorie Universiteit van Amsterdam Jop Rijksbaron, Robin Spiers & Vincent Kleiman """ import pandas as pd from code.classes.objects import Water, House from code.helpers.location import location_checker from code.helpers.score import scorecalculator, distance_check def waterbuilder(choice, neighbourhood): """Places the water objects in the neighbourhood with the right attributes""" # collect all csv files and convert them to pandas dataframe and select the wanted file with the choice variable df = [pd.read_csv("data/wijk_1.csv"),pd.read_csv("data/wijk_2.csv"),pd.read_csv("data/wijk_3.csv")][choice] # loop through all dataframe rows for index, rows in df.iterrows(): # Collect all the wanted data from the dataframe row ID = index name = rows.type x0 = int(rows.bottom_left_xy.split(',')[1]) x1 = int(rows.top_right_xy.split(',')[1]) y0 = int(rows.bottom_left_xy.split(',')[0]) y1 = int(rows.top_right_xy.split(',')[0]) width = abs(x0-x1) length = abs(y0-y1) # make from the collected values a water object and append it to the neighbourhood water = Water(ID,name, width, length, x0,x1,y0,y1) neighbourhood.append(water) # return the neighbourhood return neighbourhood def housebuilder(max_houses,amount_maison,amount_bungalow,amount_sfh, neighbourhood): """Places the objects of houses in the neighbourhood with the right attributes""" # loop for every house that has to be placed for i in range(max_houses): # check if the house type should be maison if i < amount_maison: # create house with random coorinates house = House("maison", i) # if it violates any rule create a new house with random coorinates while location_checker(house, neighbourhood) == False: house = House("maison", i) # check if the house type should be bungalow elif i < amount_bungalow + amount_maison: house = House("bungalow", i) # if it violates any rule create a new house with random coorinates while location_checker(house, neighbourhood) == False: house = House("bungalow", i) # check if the house type should be single family house else: house = House("sfh",i) # if it violates any rule create a new house with random coorinates while location_checker(house, neighbourhood) == False: house = House("sfh", i) # append house to neighbourhood and calculate the distance neighbourhood.append(house) # calculate the shortest distance to another house for every house in the neighbourhood and append them to the attributes of the houses neighbourhood = distance_check(neighbourhood) # calculate the score of the entire neighbourhood and return the score and neighbourhod score = scorecalculator(neighbourhood) return neighbourhood, score
def bubble(list_a): # SCan not apply comparision starting with last item of list (No item to right) indexing_length = len(list_a) - 1 sorted = False # Create variable of sorted and set it equal to false while not sorted: # Repeat until sorted = True sorted = True # Break the while loop whenever we have gone through all the values for i in range(0, indexing_length): # For every value in the list # if value in list is greater than value directly to the right of it, if list_a[i] > list_a[i+1]: sorted = False # These values are unsorted list_a[i], list_a[i+1] = list_a[i + 1], list_a[i] # Switch these values return list_a # Return our list "unsorted_list" which is not sorted. print(bubble([4, 8, 1, 14, 8, 2, 9, 5, 7, 6, 6]))
from stack import Stack def reverse_string (argument): reversed_string = '' stack_object = Stack() for character in argument: stack_object.push(character) while not stack_object.isEmpty(): reversed_string = reversed_string + str(stack_object.pop()) return True if argument == reversed_string else False print(reverse_string("lol"))
# More strings and text # Program will say, "There are 10 types of peoples." x = "There are %d types of peoples." % 10 # Program defines binary binary = "binary" # Program defines doNot doNot = "don't" # Program will say, "Those who know binary and those who don't" y = "Those who know %s and those who %s" % (binary, doNot) # Program will print the variable x print(x) # Program will print the variable y print(y) # Program will say, "I said:'There are 10 types of peoples.'.:" print("I said:%r.:" % x) # Program will say, "I also said: 'Those who know binary and those who don't'." print("I also said: '%s'." % y) # Program will define hilarious as "True" hilarious = True # Program will define jokeEvaluation as "Isn't that joke so funny?! %r" jokeEvaluation = "Isn't that joke so funny?! You have entered the comedy area! %r" # Program will say, "Isn't that joke so funny?! True" print(jokeEvaluation % hilarious) # Program will define w as "This is the left side of..." w = "This is the left side of..." # Program will define e as "a string with a right side" e = "a string with a right side" # Program will print "This is the left side of...a string with a right side" print(w+e) # More printing fun # Program will print "Mary had a little lamb" print("Mary had a little lamb") # Program will print "Its fleece was white as snow." print("Its fleece was white as %s." % 'snow') # Program will print "And everywhere that mary went." print("And everywhere that mary went.") print("So the duck walked up to the lemonade stand.") print("And he said to the man, running the stand.") print("Hey, bom, bom, bom, got any grapes?") # Program will print a peroid 10 time print("." * 10) # Program will define all the end variables as the letters in the phrase "cheeseburger R KOOL!" end1 = "C" end2 = "h" end3 = "e" end4 = "e" end5 = "s" end6 = "e" end7 = "B" end8 = "u" end9 = "r" end10 = "g" end11 = "e" end12 = "r" end13 = "R" end14 = "K" end15 = "O" end16 = "O" end17 = "L" end18 = "!" print(end1 + end2 + end3 + end4 + end5 + end6) print(end7 + end8 + end9 + end10 + end11 + end12) print(end13 + end14 + end15 + end16 + end17 + end18) # But wait theres more formatter = "%r %r %r %r" print(formatter % (1, 2, 3, 4)) print(formatter % ("Hecc", "Hicc", "Hacc", "Hucc")) print(formatter % (True, False, True, True)) print(formatter % (formatter, formatter, formatter, formatter)) # Why do we use %r instead of %s in the above example? # Because we want quotes around the string and also to eliminate special characters # Which should I use on a regular basis? # In my opinion I would say %s because I want to use special characters if I need them. I can always add quotes around! # Why does %r sometimes give me quotes around the things? # More strings and text # Program will say, "There are 10 types of peoples." x = "There are %d types of peoples." % 10 # Program defines binary binary = "binary" # Program defines doNot doNot = "don't" # Program will say, "Those who know binary and those who don't" y = "Those who know %s and those who %s" % (binary, doNot) # Program will print the variable x print(x) # Program will print the variable y print(y) # Program will say, "I said:'There are 10 types of peoples.'.:" print("I said:%r.:" % x) # Program will say, "I also said: 'Those who know binary and those who don't'." print("I also said: '%s'." % y) # Program will define hilarious as "True" hilarious = True # Program will define jokeEvaluation as "Isn't that joke so funny?! %r" jokeEvaluation = "Isn't that joke so funny?! %r" # Program will say, "Isn't that joke so funny?! True" print(jokeEvaluation % hilarious) # Program will define w as "This is the left side of..." w = "This is the left side of..." # Program will define e as "a string with a right side" e = "a string with a right side" # Program will print "This is the left side of...a string with a right side" print(w+e) # More printing fun # Program will print "Mary had a little lamb" print("Mary had a little lamb") # Program will print "Its fleece was white as snow." print("Its fleece was white as %s." % 'snow') # Program will print "And everywhere that mary went." print("And everywhere that mary went.") # Program will print a peroid 10 time print("." * 10) # Program will define all the end variables as the letters in the word cheeseburger end1 = "C" end2 = "h" end3 = "e" end4 = "e" end5 = "s" end6 = "e" end7 = "B" end8 = "u" end9 = "r" end10 = "g" end11 = "e" end12 = "r" # Program will print all the end variables as the letters in the word cheeseburger print(end1 + end2 + end3 + end4 + end5 + end6) print(end7 + end8 + end9 + end10 + end11 + end12) # But wait theres more formatter = "%r %r %r %r" print(formatter % (1, 2, 3, 4)) print(formatter % ("Hecc", "Hicc", "Hacc", "Hucc")) print(formatter % (True, False, True, True)) print(formatter % (formatter, formatter, formatter, formatter)) # Why do we use %r instead of %s in the above example? # Because we want quotes around the string and also to eliminate special characters # Which should I use on a regular basis? # In my opinion I would say %s because I want to use special characters if I need them. I can always add quotes around! # Why does %r sometimes give me quotes around the things? # %r put quotes around things defined as strings # Program will define the days days = " Mon tue wed thu fri" # Program will define the months months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug" # Program will print the days print("Here are the days: ", days) # Program will print the months print("Here are the months: ", months) # Program will print There's something going on here: # With the three double quotes. # We'll be able to type as much as we want # Even 4 lines if we want, or 5, or 6. print(''' There's something going on here: With the three double quotes. We'll be able to type as much as we want Even 4 lines if we want, or 5, or 6. ''') # examine closely the difference between the %r formatter and the %s formatter # Program will print Here are the months: 'Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug' print("Here are the months: %r" % months) # Program will print Here are the months: Jan # Feb # Mar # Apr # May # Jun # Jul # Aug print("Here are the months: %s" % months) # escape sequence redux # Program will define tabbyCat as I'm tabbed in (So original). tabbyCat = "\tI'm tabbed in (So original)." # Program will define EbicCat as I'm the split\non a line EbicCat = "I'm the split\non a line" # Program will define backslashcat as I'm \\ a \\ cat. That likes to divide my words backslashCat = "I'm \\ a \\ cat. That likes to divide my words" # Program will define NaeNaeCat as a list of items it will monch apon NaeNaeCat = """ I'll do a list: \t* Yarn balls \t* Aquatic Creatures \t* Catnip\n\t*Grassy bois """ #Program will print these variables to come up with the result of: # I'm tabbed in (So original). # I'm the split # on a line # I'm \ a \ cat. That likes to divide my words # I'll do a list: # * Yarn balls # * Aquatic Creatures # * Catnip # *Grassy bois print(tabbyCat) print(EbicCat) print(backslashCat) print(NaeNaeCat) # Escape Seq What it does? print("\\") # Backslash print("\'") # Quote print("\"") # Double quote print("\a ") # ASCII BEL (Supposed to make a sound) print("a\bb ") # Backspace print("aa\fdd ") # Down of one line, keep same column x='\N{BLACK SPADE SUIT}'# \N{name} something to do with Unicode symbols to make special characters print(x) print("\r") # Move the character to the beginning of the line without erasing print("\t") # Tab x='\u0144' # \ Uxxxx: unicode with hexidecimals print(x) x='\U0001f63f' #\ Uxxxxxxxx" unicode with hexidecimals print(x) x='\o12' #\ ooo" unicode with octaldecimals print(x) x='\xe2' #\ Hxx something to do with hex conversion print(x) # q: What does the following code do: # While true: # for i in ["/", "-", "|", "//", "|"]: # print("s\r" % i, end='') # a: When I imputed the code, it prints / - | \ | in quick succession, at the same place. On infinitly may lines # q: Can you use ''' instead of """ ? # a: Yes you can # Program will define fingers as How many fingers do you have? fingers = input("How many fingers do you have?") # Program will define thickness as How thick are you? thickness = input("How thick are you?") # Program will print So, you have '999999' amount of fingers and '99999999999999999' units of # Thickness after the programmer enters the answers that the program will use to write the sentence print("So, you have %r amount of fingers and %r units of thickness" % (fingers, thickness)) # Ask 4 or more questions and handle those responses # q: When were hexadecimals invented? # a: Hex, short for "hexadecimal base counting", was invented in France in the year 770 AD # q: When were octaldecimals invented? # a: Octal number system was being used in papers as far as 1668, so it must have already been invented at least # By the beginning of the seventeenth century # q: Why do we use hexidecimals in programming? # a: The main reason why we use hexadecimal numbers is because it is much easier to express binary number # representations in hex than it is in any other base number system. # q: What is the octal numeral system? # a: It is the base-8 number system, and uses the digits 0 to 7. ... In the octal system each place is a power of eight. # q: What does \a ASCII BEL do?\ # a: Apparently, the Bell character is the control code used to sound an audible bell or tone in order to alert the user.
import numpy as np import matplotlib.pyplot as plt import numpy as np from numpy import linalg as la epsilon = 0.0001 def reLu(x): return 0.5*(x + np.sqrt(x**2 + epsilon)) def sigmoid(x): return 1/(1+np.exp(-1*x)) class Layer(): def __init__(self, n_values, func = "none"): self.n_values = n_values self.func = func self.arr = np.random.randn(n_values) self.biases = np.random.randn(n_values) class NeuralNetwork(): def __init__(self, layers, learning_rate = 0.0005 ,optimizer = "GD"): self.layers = layers self.n_layers = len(layers) self.optimizer = optimizer self.learning_rate = learning_rate #inicializa as matrizes com os pesos aleatorios for i in range(len(self.layers) - 1): n_curr = self.layers[i].n_values n_next = self.layers[i+1].n_values self.layers[i].weights = np.random.randn(n_curr,n_next) def train_step(self, input, target): self.layers[0].arr = input # Feed-Forward for i in range(self.n_layers): if i!= 0: self.layers[i].arr = np.dot(self.layers[i-1].arr, self.layers[i-1].weights) self.layers[i].arr = np.add(self.layers[i].arr, self.layers[i].biases) if self.layers[i].func == "sigmoid": for j in range(self.layers[i].n_values): self.layers[i].arr[0][j] = sigmoid(self.layers[i].arr[0][j]) elif self.layers[i].func == "relu": for j in range(self.layers[i].n_values): self.layers[i].arr[0][j] = reLu(self.layers[i].arr[0][j]) else: if not self.layers[i].func == "linear": print("ERROR: unknown activation function {}".format(self.layers[i].func)) output = self.layers[self.n_layers-1].arr # Otimização if self.optimizer == "GD": for i in range(self.n_layers-1,0,-1): if i == self.n_layers-1: error = target - output else: error = np.dot(error, np.transpose(self.layers[i].weights)) if self.layers[i].func == "linear": d_func = 1 elif self.layers[i].func == "sigmoid": d_func = self.layers[i].arr*(1 - self.layers[i].arr) elif self.layers[i].func == "relu": d_func = 0.5*(self.layers[i].arr/np.sqrt(self.layers[i].arr**2 + epsilon) + 1) else: print("ERROR: unknown activation function {}".format(self.layers[self.n_layers - 1].func)) gradient = self.learning_rate * error * d_func self.layers[i].biases = np.add(self.layers[i].biases, gradient) weights_deltas = np.dot(np.transpose(self.layers[i-1].arr), gradient) self.layers[i-1].weights = np.add(self.layers[i-1].weights, weights_deltas) # IMPLEMENTAR PARA MÉTODO DO GRADIENTE TBM def predict(self, input): self.layers[0].arr = input # Feed-Forward for i in range(len(self.layers)): if i!= 0: self.layers[i].arr = np.dot(self.layers[i-1].arr, self.layers[i-1].weights) self.layers[i].arr = np.add(self.layers[i].arr, self.layers[i].biases) if self.layers[i].func == "sigmoid": for j in range(self.layers[i].n_values): self.layers[i].arr[0][j] = sigmoid(self.layers[i].arr[0][j]) elif self.layers[i].func == "relu": for j in range(self.layers[i].n_values): self.layers[i].arr[0][j] = reLu(self.layers[i].arr[0][j]) else: if not self.layers[i].func == "linear": print("ERROR: unknown activation function {}".format(self.layers[i].func)) output = self.layers[self.n_layers-1].arr return output def trainSGD(self, trainning_set, labels, epochs=1000): for _ in range(epochs): index = np.random.randint(len(trainning_set)) self.train_step(trainning_set[index], labels[index]) def train(self, X, y,ep = 10000): for i in range(ep): for j in range(len(X)): self.train_step(X[j], y[j]) layers = [Layer(1), Layer(2,"relu"), Layer(2,"relu"),Layer(1,"linear")] X = np.array([1.0, 2.0, 3.0, 4.0, 5.0]) y = X**2 mynn = NeuralNetwork(layers, 0.0001, optimizer= "GD") mynn.trainSGD(X, y,100000) ex = np.linspace(0,100,100) ey = [mynn.predict(val)[0] for val in ex] plt.axis([0,10,0,30]) plt.scatter(X,y,s = 30, c = "red") plt.plot(ex,ey) plt.show()
#!/usr/bin/python import sys #entrada de stdin for line in sys.stdin: #remove espaços em branco line = line.strip() #quebra linha em palavras words = line.split() for word in words: print('%s\t%s' % (word.lower(), 1))
''' los datos dados en el csv, representa el numero de cambios de aceite al año y costo de la reparacion (en miles de soles), de una muestra de 20 autos de una cierta marca y modelo a. realiza la grafica de dispersion ''' import csv import matplotlib.pyplot as plt import numpy as np costo=[]#variable dependiente y cambio_aceite=[] #variable independiente x with open("datos.csv", encoding='utf-8',newline='') as f: #reader = csv.reader(f) reader = enumerate(csv.reader(f)) for i, row in reader: if i>0: try: costo.append(int(row[0])) cambio_aceite.append(int(row[1])) except Exception: print(Exception) #plt.scatter(cambio_aceite,costo,c="g",alpha=0.5,marker=r'$\clubsuit$',label="luck",s=100) plt.scatter(cambio_aceite,costo,c="g",alpha=0.5,s=100) plt.xlabel("Cambio de Aceite") plt.ylabel("Costo") plt.show()
"""class DoubleIntegral: USED TO CALCULATE DOUBLE INTEGRALS - CAIGE MIDDAUGH def __init__(self, m, n,a,b,c,d,function): self.m=m self.n=n self.a=a self.b=b self.c=c self.d=d self.function=function self.deltaX=(b-a)/m self.deltaY=(d-c)/n self.deltaA=self.deltaX*self.deltaY self.y=[] self.arryLeft=[] self.arryRight=[] self.arryMid=[] self.x=[] self.arrxLeft=[] self.arrxMid=[] self.arrxRight=[] def setx(self): for i in range (0,self.m+1): if i == 0 : self.x.append(self.a) else: self.x.append(self.x[i-1]+self.deltaX) for i in range (0,self.m): if i == 0 : self.arrxLeft.append(self.a) else: self.arrxLeft.append(self.arrxLeft[i-1]+self.deltaX) for i in range (1,self.m+1): print(i) if i == 1 : self.arrxRight.append(self.a+self.deltaX) else: self.arrxRight.append(self.arrxRight[i-2]+self.deltaX) for i in range (1,self.m+1): middle=self.x[i-1]+self.x[i] middle/=2 self.arrxMid.append(middle) def Sety(self): for i in range (0,self.n+1): if i == 0 : self.y.append(self.c) else: self.y.append(self.y[i-1]+self.deltaY) for i in range (0,self.n): if i == 0 : self.arryLeft.append(self.c) else: self.arryLeft.append(self.arryLeft[i-1]+self.deltaY) for i in range (1,self.n+1): if i == 1 : self.arryRight.append(self.c+self.deltaY) else: self.arryRight.append(self.arryRight[i-2]+self.deltaY) for i in range (1,self.n+1): middle=self.y[i-1]+self.y[i] middle/=2 self.arryMid.append(middle) def evaluateMid(self): summ=0 for i in range(0, self.n): x = self.arrxMid[i] print(i) for j in range ( 0, self.m ): y= self.arryMid[j] print("Comparing", x, " and ", y) e = eval(self.function) print(e) summ += e*self.deltaA print("Mid Point: ",summ) def __del__(self): class_name = self.__class__.__name__ print(class_name, "destroyed") """ def main(): print("HU") n = int(input("Enter m(The amount of dx rectangle): ")) m = int(input("Enter n(The amount of dy rectangle): ")) a = int(input("Enter the Beggining point for x: ")) b = int(input("Enter the ending point for x: ")) c = int(input("Enter the beginning point for y: ")) d = int(input("Enter the ending point for y: ")) function = input("Enter the Function: ") print (n,m,a,b,c,d,function) """doubleint1 = DoubleIntegral(m,n,a,b,c,d,function) doubleint1.setx() doubleint1.sety() doubleint1.evaluateMid()""" """ creating arrays to hold the values of x* and y*. This is one solution. """ """ x = [0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1] y = [0,.2,.4,.6,.8,1,1.2,1.4,1.6,1.8,2] """ """ nesting the for loops to make the each x value interact with each y value. """ """for i in range ( 0, m ): for j in range ( 0, n ): print( "comparing x ", i, "with y ", j) a=math.sqrt(x[i]**3+y[j]**3) print("a " , j , ": ", a) func = math.sin(a); print("func: " , j , ": " , func) summ += func*deltaA; print(summ); """
#20103323 김태욱 Day05(0828) - homework2 : 도서관리 프로그램을 tkinter와 sqlite3를 이용하여 만들기 from tkinter import * import sqlite3 #UI class class BookManageUI: #Constructor에서 DB파일을 만들고 manageStart로 UI 시작 def __init__(self, master): #Open db self.con = sqlite3.connect('bookDB.db') self.cur = self.con.cursor() try: self.cur.execute("CREATE TABLE BookTable(Name text, Author text, Price text);") self.manageStart(master) except sqlite3.OperationalError: self.manageStart(master) # manageStart = UI, 추가하고 싶은 책에 대한 정보를 적고, Add를 누르면 DB에 추가된다. 끝내려면 Quit def manageStart(self,master): frame = Frame(master) frame.pack() frame2 = Frame(frame) text = Label(frame2, text='BookName') text.pack(side=LEFT) self.input2 = Entry(frame2) self.input2.pack(side=LEFT) frame2.pack() frame3 = Frame(frame) text = Label(frame3, text='Author', padx=12) text.pack(side=LEFT) self.input3 = Entry(frame3) self.input3.pack(side=LEFT) frame3.pack() frame4 = Frame(frame) text = Label(frame4, text='Price', padx=17) text.pack(side=LEFT) self.input4 = Entry(frame4) self.input4.pack(side=LEFT) frame4.pack() frame6 = Frame(frame) self.button = Button(frame6, text="Quit", command=self.close) self.button.pack(side=BOTTOM) frame6.pack(side=RIGHT) frame5 = Frame(frame) self.button = Button(frame5, text="Add", command=self.all_output) self.button.pack(side=BOTTOM) frame5.pack(side=RIGHT) def output(self): return self.input2.get() def output2(self): return self.input3.get() def output3(self): return self.input4.get() #각 field에 입력된 값을 하나로 합쳐서 DB에 넣는 all_output함수 def all_output(self): inputName = self.output() inputAuthor = self.output2() inputPrice = self.output3() query = "INSERT INTO BookTable VALUES('"+inputName+"','"+inputAuthor+"','"+inputPrice+"');" #print(query) self.cur.execute(query) self.con.commit() self.show_db() #db에 정확히 들어갔는지 확인하기 위한 show_db def show_db(self): self.cur.execute("SELECT * FROM BookTable;") #self.cur.execute("SELECT * FROM sqlite_master WHERE type='table'") print(self.cur.fetchall()) def close(self): print('quit') self.cur.close() self.con.close() exit() def main(): root = Tk() app = BookManageUI(root) root.mainloop() if __name__ == '__main__': main()
import numpy as np import einops def derive_rotation_matrices(order: int) -> np.ndarray: """Calculate a set of rotation matrices for a cyclic symmetry. Axis of rotation is the Z axis. Matrices are defined Rz = [[cos(t), -sin(t), 0], [sin(t), cos(t), 0], [ 0, 0, 1]] Parameters ---------- order : int symmetry order Returns ------- rotation_matrices: (order, 3, 3) np.ndarray matrices defining rotations around the Z axis """ theta = np.linspace(0, 2*np.pi, num=order, endpoint=False) cos_theta = np.cos(theta) sin_theta = np.sin(theta) rotation_matrices = einops.repeat( np.eye(3), 'i j -> new_axis i j', new_axis=order ) rotation_matrices[:, 0, 0] = cos_theta rotation_matrices[:, 0, 1] = -sin_theta rotation_matrices[:, 1, 0] = sin_theta rotation_matrices[:, 1, 1] = cos_theta return rotation_matrices
import sqlite3 conexao = sqlite3.connect("aula_banco_py.db") c = conexao.cursor() cpf = input("Digite o CPF da pessoa: ") rg = int(input("Digite o novo RG da pessoa: ")) nome = input("Digite o novo nome da pessoa: ") c.execute("update pessoa set nome = ?, rg = ? where cpf = ?", (nome, rg, cpf)) print("Linhas atualizadas: ", c.rowcount) conexao.commit() conexao.close()
'''Lista de exercicio programacao para redes Questao 1 Faça um Programa que peça 2 números inteiros e um número real. Calcule e mostre: a. O produto do dobro do primeiro com metade do segundo. b. A soma do triplo do primeiro com o terceiro. c. O terceiro elevado ao cubo.''' print("Programa para calcular") num1=int(input("Digite um numero inteiro:")) num2=int(input("Digite outro numero inteiro:")) num3=float(input("Digite um numero real:")) a=(num1*2)*(num2/2) b=(num1*3)+num3 c=(num3**3) print("O produto do dobro do primeiro com metade do segundo:",a) print("A soma do triplo do primeiro com o terceiro:",b) print("O terceiro elevado ao cubo:",c)
import c_function #menu da aplicação resposta = c_function.home() print(resposta['serviço']) print(resposta['descrição']) opcoes = {1: "Adicionar Contato", 2: "Consultar Contato", 3: "Remover Contato"} while True: print("\nOpções:") print("0 - Encerrar o programa") for opcao in opcoes: print("{} - {}".format(opcao, opcoes[opcao])) escolha = int(input(">> ")) if escolha in opcoes.keys(): print("\n{}\n{}\n".format(opcoes[escolha], resposta['opções'][opcoes[escolha]])) if escolha == 1: c_function.adicionarContato() elif escolha == 2: c_function.consultarContato() elif escolha == 3: c_function.removerContato() elif escolha == 0: print("O programa foi encerrado.") break else: print("\nOpção invalida!")
import math #Determine 2 raizes de uma equação do 2º grau Y=a^2 + b + c. a = int(input("Digite A: ")) b = int(input("Digite B: ")) c = int(input("Digite C: ")) #Calcula o delta delta = int(((b**2) - (4 * a * c))) #Calcula o x1 x1 = int((((-b) + (math.sqrt(delta)))/(a*2))) #Calcula o x2 x2 = int((((-b) - (math.sqrt(delta)))/(a*2))) print("As raizes são x1: " + str(x1) +" e x2: " + str(x2))
import matplotlib.pyplot as plt list = {} x_values = range(7,16) init_split = range(30,70,10) colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k'] for tr in init_split: y_values = [] te = 100-tr for j in x_values: p = float(100)/float(tr+(te/j)); new_tr = (p*float(tr)) y_values.append(new_tr) print(y_values) list[tr] = y_values plt.plot(x_values, y_values, colors[0]) colors.remove([0]) plt.show()
""" ref: https://leetcode.com/problems/number-complement/#/description Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32-bit signed integer. You could assume no leading zero bit in the integer’s binary representation. Example 1: Input: 5 Output: 2 Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2. Example 2: Input: 1 Output: 0 Explanation: The binary representation of 1 is 1 (no leading zero bits), and its complement is 0. So you need to output 0. """ def complement(n): mask = ~0 while n & mask: mask <<= 1 return ~mask & ~n
## Predicting medical expenses ## # Importing packages # import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn.linear_model import LinearRegression from sklearn.tree import DecisionTreeRegressor, plot_tree from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import train_test_split # Importing the data # url = 'https://raw.githubusercontent.com/cinnData/UM-2020-11/main/data/medical.csv' df = pd.read_csv(url) df.info() df.head() # Target vector # y = df['charges'] # Numeric features # X1 = df[['age', 'bmi', 'dependents']] # Categorical features # X2 = pd.get_dummies(df[['sex', 'smoker', 'region']]) # Features matrix # X = pd.concat([X1, X2], axis=1) # Q1a. Use a linear regression model for predicting the medical cost in terms of the other features linreg = LinearRegression() linreg.fit(X, y) # Q1b. How is the predictive performance of your model? round(linreg.score(X, y), 3) # Q2. Plot the actual charges vs the predicted charges. What do you see? ypred = linreg.predict(X) from matplotlib import pyplot as plt plt.figure(figsize=(6,6)) plt.scatter(ypred, y, color='black', s=1) plt.title('Figure 1. Actual vs predicted charges') plt.xlabel('Predicted charges') plt.ylabel('Actual charges') plt.show() # Q3. We expect old age, smoking, and obesity tend to be linked to additional health issues, while additional family member dependents may result in an increase in physician visits and preventive care such as vaccinations and yearly physical exams. Is this what you find with your model? How would you modify your equation to cope better with these patterns? linreg.coef_ df['bmi_smoker'] = (df['smoker'] == 'yes')*df['bmi'] df['age_smoker'] = (df['smoker'] == 'yes')*df['age'] df['age2'] = df['age']**2 X3 = pd.DataFrame({'age2': df['age']**2, 'age_smoker': (df['smoker'] == 'yes')*df['age'], 'bmi_smoker': (df['smoker'] == 'yes')*df['age']}) X = pd.concat([X, X3], axis=1) linreg.fit(X, y) round(linreg.score(X, y), 3) ypred = linreg.predict(X) plt.figure(figsize=(6,6)) plt.scatter(ypred, y, color='black', s=1) plt.title('Figure 1. Actual vs predicted charges') plt.xlabel('Predicted charges') plt.ylabel('Actual charges') plt.show() # Q4. Do you think that a decision tree model can work here? # X = pd.concat([X1, X2], axis=1) treereg = DecisionTreeRegressor(max_depth=4) treereg.fit(X, y) plt.figure(figsize=(12,10)) plot_tree(treereg, fontsize=9) plt.show() round(treereg.score(X, y), 3) ypred = treereg.predict(X) plt.figure(figsize=(6,6)) plt.scatter(ypred, y, color='0.5', s=1) plt.title('Figure 2. Actual vs predicted charges') plt.xlabel('Predicted charges') plt.ylabel('Actual charges') plt.show() # Random forest # rfreg = RandomForestRegressor(max_depth=4, n_estimators=100) rfreg.fit(X, y) round(rfreg.score(X, y), 3) ypred = rfreg.predict(X) plt.figure(figsize=(6,6)) plt.scatter(ypred, y, color='0.5', s=1) plt.title('Figure 3. Actual vs predicted charges') plt.xlabel('Charges') plt.ylabel('Actual charges') plt.show() # Q5. Do your models overfit the data? # X_train, X_test, y_train, y_test = \ train_test_split(X, y, test_size=0.2) treereg.fit(X_train, y_train) round(treereg.score(X_train, y_train), 3) round(treereg.score(X_test, y_test), 3) # Saving your model to a pkl file # from joblib import * dump(treereg, 'treereg.pkl') newtreereg = load('treereg.pkl') round(newtreereg.score(X_train, y_train), 3)
''' # Python -Variables and data types- print(" /|") print(" / |") print(" / |") print(" /___|") character_name = "Sam" character_age = "23" print("There once was a man named " + character_name+".") print("He did not like being " + character_age+".") -Booleans- is_male = True is_male = False -Working with strings- print("John") print("Jo\n" "hn") phrase = "John" # 0123 print(phrase) print(phrase + " is cool") print(phrase.upper()) print(phrase.lower()) print(phrase.isupper()) print(phrase.islower()) print(phrase.upper().isupper()) print(len(phrase)) print(phrase[0]) print(phrase.index("P")) print(phrase.index("Pol")) print(phrase.index("ar")) print(phrase.replace("Polar", "John")) -Working with numbers- print(2) print(-2.03) print(3+4.5) print(3 * (4+5)) print(10 % 3) my_num = 5 print(my_num) print(str(my_num) + " my favorite number") from math import * my_num = -5 print(abs(my_num)) print(pow(4, 6)) print(max(4, 6)) print(min(4, 6)) print(round(3.2)) print(floor(3.7)) print(ceil(3.7)) print(sqrt(36)) -Getting input from users- name = input("Enter your name: ") age = input("Enter your age: ") print("Hello " + name + "! You are " + age) -Building a basic calculator- num1 = input("Enter a number: ") num2 = input("Enter another number: ") result = float(num1) + float(num2) result = int(num1) + int(num2) print(result) -Mad libs game- color = input("Enter a color: ") plural_noun = input("Enter a plural noun: ") celebrity = input("Enter a celebrity: ") print("Roses are " + color) print(plural_noun + " are blue") print("I love " + celebrity) -Lists- friends = ["Kevin", "Karen", "Jim", "Oscar", "Toby"] 0 1 2 3 4 friends[1] = "Mike" print(friends[1]) [1:3] Takes the select bunch -List functions- lucky_numbers = [4, 8, 15, 16, 23, 42] friends = ["Kevin", "Karen", "Jim", "Jim", "Oscar", "Toby"] friends2 = friends.copy() friends.extend(lucky_numbers) friends.append("Adam") friends.insert(1, "Kelly") friends.remove("Kevin") friends.clear friends.pop() friends.sort() lucky_numbers.sort() lucky_numbers.reverse() print(friends) print(friends2) print(friends.index("Kevin")) print(friends.count("Jim")) -Tuples- coordinates = [(4, 5), (6, 7) (80, 34)] print(coordinates[0]) -Functions- def say_hi(name, age): print("Hello " + name + ", you are " + age) say_hi("Mike", "35") say_hi("Steve", "70") -Return Statement- def cube(num): return num*num*num result = cube(4) print(result) -If statements- is_male = False is_female = False if is_male and is_female: print("You are both a human") elif is_male and not(is_female): print("The male is a human, The female is not") elif is_female and not(is_male): print("The female is a human, The male is not") else: print("Neither of you are humans") -If statements and Comparisons- def max_num(num1, num2, num3): if num1 >= num2 and num1 >= num3: return num1 elif num2 >= num1 and num2 >= num3: return num2 else: return num3 print(max_num(3, 4, 5)) def best_body(part1, part2, part3): if part1 >= part2 and part1 >= part3: return part1 elif part2 >= part1 and part2 >= part3: return part2 else: return part3 print(best_body(1, 2, 3)) -Building a better calculator- num1 = float(input("Enter first number: ")) op = input("Enter operator: ") num2 = float(input("Enter second number: ")) if op == "+": print(num1 + num2) elif op == "-": print(num1 - num2) elif op== "*": print(num1 * num2) elif op== "/": print (num1 / num2) else: print("Invalid Error") -Dictionaries- monthConversions = { 0: "January", 1: "February", 2: "March", 3: "April", "May": "May", "Jun": "June", "Jul": "July", "Aug": "August", "Sep": "September", "Oct": "October", "Nov": "November", "Dec": "December", } print(monthConversions["Apr"]) print(monthConversions.get("oof", "Not a Valid key")) -While loop- i = 1 while i <= 10: print(i) i = i + 1 print("Done with loop") num1 = 1 while num1 <= 14: print(num1) num1 = num1 + 1 -Building a guessing game- secret_word = "polar" guess = "" guess_count = 0 guess_limit = 3 out_of_guesses = False while guess != secret_word and not(out_of_guesses): if guess_count < guess_limit: guess = input("enter guess: ") guess_count += 1 else: out_of_guesses = True if out_of_guesses: print("You lost.") else: print("Congrats, you got it!!!") -For Loop- friends = ["Michael", "Lily", "Poki", "Toast"] for name in friends: print(name) for index in range(10): print(index) for index in range(3, 10): print(index) for index in range(len(friends)): print(friends[index]) friends[1] for index in range(5): if index == 0: print("first iteration") else: print("Not first") -Exponent Function- def raise_to_power(base_num, pow_num): result = 1 for index in range(pow_num): result = result * base_num return result print(raise_to_power(3, 3)) -2D lists and nested loops- num_grid = [ [1, 2, 3], #0 [4, 5, 6], #1 [7, 8, 9], #2 [0] #3 #0 1 2 ] print(num_grid[0][2]) for row in num_grid: for col in row: print(col) -Build a translator- def translate(phrase): translation = "" for letter in phrase: if letter in "aeiouAEIOU": if letter.isupper(): translation = translation + "P" else: translation = translation + "p" else: translation = translation + letter return translation print(translate(input("Enter a phrase: "))) -Try Except- try: number = int(input("Enter a number: ")) print(number) except: print("USE A FUCKING NUMBER!") try: dbz = 10 / 0 number = int(input("Enter a number: ")) print(number) except ZeroDivisionError as Error: print(Error) except ValueError: print("Invalid input") -Reading Files- open("employees.txt", "r" ) # Read File open("employees.txt", "w" ) # Write File open("employees.txt", "a" ) # Append File open("employees.txt", "r+" ) # Read/Write File employee_file = open("employees.txt", "r") print(employee_file.read()) employee_file.close() employee_file = open("employees.txt", "r") print(employee_file.readlines()) employee_file.close() employee_file = open("employees.txt", "r") for employee in employee_file.readlines(): print (employee) employee_file.close() -Writing Files- employee_file = open("employees.txt", "a") employee_file.write("\nKelly") employee_file.close() employee_file = open("employees.txt", "w") employee_file.write("\nKelly") employee_file.close() -Modules and Pip- import useful_tools print(useful_tools.roll_dice(10)) -Classes and Objects- from Student import Student student1 = Student("Jack", "Buisness", 3.1, False) student2 = Student("John", "Art", 3.5, True) print(student2.gpa) -Building a Multiple Choice Quiz- from Question import Question question_prompts = [ "How many subscribers does Polar have?\n(a) 30\n(b) 1000\n(c) 21\n(d) 1\n\n", "How old is Polar?\n(a) 3\n(b) 18\n(c) 20\n(d) 14\n\n", "How cool is Polar?\n(a) 10%\n(b) 100%\n(c) 0%\n(d) 1%\n\n", ] questions = [ Question(question_prompts[0], "c"), Question(question_prompts[1], "d"), Question(question_prompts[2], "b") ] def run_test(questions): score = 0 for question in questions: answer = input(question.prompt) if answer == question.answer: score += 1 print("You got " + str(score) + "/" + str(len(questions)) + " correct") run_test(questions) '''
from collections import deque import unittest def bfs(graph, start, search): queue = deque() visited = set() queue += start while queue: vertice = queue.popleft() if vertice not in visited: visited.add(vertice) if vertice == search: return visited else: diff = graph[vertice] - visited #print "Adding to queue: {}".format(diff) queue += diff #print "Queue: {}".format(queue) # A # / \ # B C # / \ \ # D E -- F # / / \ # I ------ G H # graph = { 'A': set(['B', 'C']), 'B': set(['A', 'D', 'E']), 'C': set(['A', 'F']), 'D': set(['B', 'I']), 'E': set(['B', 'F']), 'F': set(['C', 'E', 'G', 'H']), 'G': set(['I', 'F']), 'H': set(['F']), 'I': set(['D', 'G']) } class TestSimpleBFS(unittest.TestCase): def test_VerticesSearch(self): self.assertSetEqual(bfs(graph, 'A', 'B'), set(['A', 'B', 'C'])) self.assertSetEqual(bfs(graph, 'A', 'D', ), set(['A', 'B', 'C', 'D', 'E', 'F'])) self.assertSetEqual(bfs(graph, 'A', 'I', ), set(['A', 'B', 'C', 'D', 'E', 'F' ,'G', 'H', 'I'])) self.assertSetEqual(bfs(graph, 'A', 'F', ), set(['A', 'B', 'C', 'F'])) self.assertSetEqual(bfs(graph, 'A', 'H', ), set(['A', 'B', 'C', 'D', 'E', 'F', 'H'])) if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(TestSimpleBFS) unittest.TextTestRunner(verbosity=0).run(suite)
class AppendDict: def __init__(self): self.val={} def __getitem__(self,key): if key not in self.val.keys(): raise KeyError elif len(self.val[key]) == 1: return self.val[key][0] else: return self.val[key] def __setitem__(self,key,value): if key in self.val.keys(): if value in self.val[key]: 0 #do nothing else: self.val[key]+=tuple([value]) else: self.val[key]=tuple([value]) def __delitem__(self,key): del self.val[key] def __iter__(self): return self.val.__iter__() def __contains__(self,item): return item in self.val def keys(): return self.val.keys() def values(): return self.val.values()
def quickSort(list, first, last): if first < last: splitPoint = partition(list, first, last) quickSort(list, first, splitPoint-1) quickSort(list, splitPoint+1, last) def partition(list, first, last): leftMark = first+1 rightMark = last exchange = False while not exchange: while leftMark <= rightMark and list[leftMark] <= list[first]: leftMark += 1 while leftMark <= rightMark and list[rightMark] >= list[first]: rightMark -= 1 if leftMark > rightMark: exchange = True else: list[leftMark], list[rightMark] = list[rightMark], list[leftMark] list[first], list[rightMark] = list[rightMark], list[first] return rightMark a_list = [54, 26, 93, 17, 77, 31, 44, 55, 20] quickSort(a_list, 0, len(a_list)-1) print(a_list)
# https://leetcode.com/problems/russian-doll-envelopes/description/ # import bisect # class Solution(object): # def maxEnvelopes(self, envelopes): # """ # :type envelopes: List[List[int]] # :rtype: int # """ # if len(envelopes) < 2: # return len(envelopes) # sort = sorted(envelopes) # result = [] # for index, item in sort: # item # return len(result) # envelopes = [[2,100],[3,200],[4,300],[5,500],[5,400],[5,250],[6,370],[6,360],[7,380]] # obj = Solution() # print obj.maxEnvelopes(envelopes) import bisect # class Solution(object): # def maxEnvelopes(self, envelopes): # # Get value of height sorted by width # sortedSingles = [a[1] for a in sorted(envelopes, key = lambda x: (x[0], -x[1]))] # print sortedSingles # # Results array to store sorted, length to return # results, length = [0] * len(sortedSingles), 0 # # Loop through sorted widths # for x in sortedSingles: # # Get proper index for single and insert # i = bisect.bisect_left(results, x, 0, length) # results[i] = x # print i, x, results # # Length = i + 1 # if i == length: # length += 1 # return length # envelopes = [[1,100],[5,200],[5,300],[5,500],[5,400],[5,250],[5,370],[5,360],[5,380]] # result = Solution() # print result.maxEnvelopes(envelopes) test = [1,2,5,5,8] index = bisect.bisect(test, 5, 0, 3) test[index] = 5 print index, test
# https://leetcode.com/problems/linked-list-cycle/description/ # Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def hasCycle(self, head): """ :type head: ListNode :rtype: bool """ # if not head: # return False # while head.val is not True: # head.val = True # if not head.next: # return False # head = head.next # else: # return True # return False try: slow = head fast = head.next while slow is not fast: slow = slow.next fast = fast.next.next return True except: return False list = ListNode(1) list.next = ListNode(2) list.next.next = ListNode(3) # list.next.next.next = list obj = Solution() print obj.hasCycle(list)
#!/usr/bin/python3 class customer(): CustomerID=0 custname=0 address=0 contactdetails=0 def __init__(self): #print("\nNow in Customer class") pass def add_customer_details(self,cust_id=0,cust_name=0,cust_add=0,cust_contact=0): customer.CustomerID = cust_id customer.custname = cust_name customer.address = cust_add customer.contactdetails = cust_contact self._print_details() def _print_details(self): print("\nAdded Customer Details Are Below") print("Customer ID : " + str(customer.CustomerID)) print("Customer Name : " + customer.custname) print("Customer Address : " + customer.address) print("Customer Contact Details : " + str(customer.contactdetails )) def get_cust_details(self): self._print_details()
from __future__ import print_function try: input = raw_input except NameError: pass import webbrowser import time from .api import Fanfou, json from .oauth import OAuth, write_token_file def get_oauth_pin(oauth_url, open_browser=True): """Prompt the user for the OAuth PIN. By default, a browser will open the authorization page. If `open_browser` is false, the authorization URL will just be printed instead. """ print('Opening: {}\n'.format(oauth_url)) if open_browser: print(""" In the web browser window that opens please choose to Allow access. Copy the PIN number that appears on the next page and paste or type it here: """) try: r = webbrowser.open(oauth_url) time.sleep(2) if not r: raise Exception() except: print(""" Uh, I couldn't open a browser on your computer. Please go here to get your PIN: """ + oauth_url) else: print(""" Please go to the following URL, authorize the app, and copy the PIN: """ + oauth_url) return input('Please enter the PIN: ').strip() def oauth_dance(app_name, consumer_key, consumer_secret, token_filename=None, open_browser=True): """Perform the OAuth dance with some command-line prompts. Return the oauth_token and oauth_token_secret. Provide the name of your app in `app_name`, your consumer_key, and consumer_secret. This function will let the user allow your app to access their Fanfou account using PIN authentication. If a `token_filename` is given, the oauth tokens will be written to the file. By default, this function attempts to open a browser to request access. If `open_browser` is false it will just print the URL instead. """ print("Hi there! We're gonna get you all set up to use {}.".format(app_name)) fanfou = Fanfou( auth=OAuth('', '', consumer_key, consumer_secret), format='', domain='fanfou.com') oauth_token, oauth_token_secret = parse_oauth_tokens( fanfou.oauth.request_token(oauth_callback='oob')) oauth_url = 'http://fanfou.com/oauth/authorize?oauth_token=' + oauth_token oauth_verifier = get_oauth_pin(oauth_url, open_browser) fanfou = Fanfou( auth=OAuth(oauth_token, oauth_token_secret, consumer_key, consumer_secret), format='', domain='fanfou.com') oauth_token, oauth_token_secret = parse_oauth_tokens( fanfou.oauth.access_token(oauth_verifier=oauth_verifier)) if token_filename: write_token_file(token_filename, oauth_token, oauth_token_secret) print() print("That's it! Your authorization keys have been written to {}.".format(token_filename)) return oauth_token, oauth_token_secret def parse_oauth_tokens(result): for r in result.split('&'): k, v = r.split('=') if k == 'oauth_token': oauth_token = v elif k == 'oauth_token_secret': oauth_token_secret = v return oauth_token, oauth_token_secret
#assigning an string variable x = "starbucks" #notice no semi-colons #assigning a integer variable x = 4 #note python has dynamic variable types #the previous value of x, "starbucks", has now been overwritten #arithmetic operations print x + 1 #output: 5 x = x - 1 #the result of x-1 was stored back in x print x #output: 3 print x * 0 #output: 0 print x / 1 #output: 3 #store data in a list myList = [1, 3, 3, 7] #add something to a list myList.append(0) #myList now contains [1, 3, 3, 7] #access specific things in a list print myList[2] #prints the 3rd item in the list (in programming everything starts at 0) #if statements if the condition returns a boolean value of True #boolean operators generally compare two things using the following operators (<, >, <=, >=, ==, !=) if (1 < 10): #don't forget the colon ":"! print True #else statements can be used to handle alternate cases if (4*5 == 20): #"==" checks that two things are equal print True else: #if the above condition is false this will execute print False #while loop n = 0 while(n < 10): n = n + 1 #this will repeat until n is no longer less than 10 print n #output: 10 #for loop sum = 0 for i in range(5): sum = sum + 2 #this will add 2 to the sum 5 times print sum #output: 10