Example #1
0
	def update_assertion(self, concept, num_assertions=30):
		if concept not in self.concept_assertions.keys():
			assertions = get_assertions(concept, num_assertions=num_assertions)
			self.concept_assertions[concept] = assertions
			self.store_assertions()
			return assertions
		else:
			return self.concept_assertions[concept]
Example #2
0
	def get_action_for_venue(self, chinese_name):
		"""
		Get actions that can be done in this venue.
		Arguments (Required):
			``chinese_name'': Chinese name of the venue
		"""
		if chinese_name is None or chinese_name.strip() == '':
			return []
		action = []
		for assertion in get_assertions(chinese_name):
			if assertion[0] == 'HasSubevent':
				if assertion[1] == chinese_name:
					action.append(assertion[2])
		return action
Example #3
0
	def get_concept_for_venue(self, chinese_name):
		"""
		Get related concepts of this venue.
		Arguments (Required):
			``chinese_name'': Chinese name of the venue
		"""
		if chinese_name is None or chinese_name.strip() == '':
			return []
		concepts = set()
		for assertion in get_assertions(chinese_name):
			if assertion[1] == chinese_name:
				concept2 = assertion[2]
			else:
				concept2 = assertion[1]
			concepts.add(concept2)
		return list(concepts)