Ejemplo n.º 1
0
			if p[1] == 'ns' or p[1] == 'nr' or p[1] == 'nt' or p[1] == 'n':
				if p[0] not in tags:
					tags[p[0]] = [0, 0, 0]
				tags[p[0]][0] += 1
				tags[p[0]][2] += 1


	cursor.close()





if __name__ == '__main__':
	conn = MySQLdb.connect(host="localhost", user='******', passwd='nameLR9969', db='ihome', port=3306, charset='utf8')
	SegUtil.init('.')
	load_complain(conn)

	h = []

	for k,v in tags.iteritems():
		if len(h) < 100:
			heapq.heappush(h, (v, k))
		else:
			heapq.heappushpop(h, (v, k))

	cursor = conn.cursor()
	lastid = -1
	results = []
	while len(h) > 0:
		num, word = heapq.heappop(h)