def solve_service_exit_all(self): res = Neo4jPrepare.get_entity('服务') ans = "\n国家图书馆提供的服务包括" for sub_result in res[:-1]: ans += sub_result['office_name'] + "," ans += res[-1]['office_name'] + "\n" return ans
def solve_open_room(self): res = Neo4jPrepare.get_entity('馆室') room_arr = [] for r in res: if r['open'] == '1': room_arr.append(r['office_name']) ans = "\n开架阅览室包括" for sub_room in room_arr[:-1]: ans += sub_room + "," ans += room_arr[-1] + "\n" return ans
def solve_card_describe(self): res = Neo4jPrepare.get_entity("证件") #print(res) ans = "\n" num = len(res) ans += "一共有" + str(num - 1) + "种读者卡\n" for r in res: if r['office_name'] == '第二代身份证': continue ans += '年龄' + r['age'] + '可以办理和使用' + r['office_name'] + "\n" return ans
def solve_library_res_a(self): area = Neo4jPrepare.get_entity("馆区") area_arr = [sub_area['office_name'] for sub_area in area] ans = "三个馆舍在资源和服务方面各有侧重。\n" for sub_area in area_arr: resource_arr = Neo4jPrepare.get_area_resource_type(sub_area) if len(resource_arr) > 0: ans += sub_area + ": " for r in resource_arr[:-1]: #print(r) ans += r['office_name'] + "," ans += resource_arr[-1]['office_name'] + "\n" return ans
def solve_library_describe(self): res = Neo4jPrepare.get_entity("国家图书馆") ans = "\n" + res[0]['describe'] return ans