def advs_tag_cloud(): qlabel = request.args.get('qlabel') # save the query in session session.clear() session['query'] = qlabel session.modified = True # get trials url = ctgov.form_advanced_search_url (request.args) ''' temporal method, the API needs to be updated Yingcheng Sun 05/31/2020 ''' rnct = ctgov.get_initial_nct_from_url_ad (url) nct = set () for r in rnct: tkn = r.split(';') nct.add (tkn[0]) # get randomized tags for the cloud cloud = tcloud.get_initial_cloud (nct, tagcloud_size, tag_rand) log.info ('%s -- first tag cloud' % (request.remote_addr)) return jsonify (tags = cloud , nct = rnct, q = qlabel, n = len(rnct))
def tag_cloud (): # get parameters stxt = request.args.get ('stxt') ''' handle the case that use input one quotation mark By Yingcheng Sun, 05/23/2020 ''' stxt =[i.strip('"') for i in stxt.split(' ')] stxt = ' '.join(stxt) # save the query in session session.clear() session['query'] = stxt session.modified = True # get trials and tags rnct = ctgov.get_initial_nct (stxt) nct = set () for r in rnct: tkn = r.split(';') nct.add (tkn[0]) # get tags for the first cloud cloud = tcloud.get_initial_cloud (nct, tagcloud_size, tag_rand) log.info ('%s -- first tag cloud' % (request.remote_addr)) return jsonify (tags = cloud , nct = rnct, q = stxt, n = len(rnct))
def advs_tag_cloud(): qlabel = request.args.get('qlabel') # save the query in session session.clear() session['query'] = qlabel session.modified = True # get trials url = ctgov.form_advanced_search_url (request.args) rnct = ctgov.get_initial_nct_from_url (url) nct = set () for r in rnct: tkn = r.split(';') nct.add (tkn[0]) # get randomized tags for the cloud cloud = tcloud.get_initial_cloud (nct, 20, 10) log.info ('%s -- first tag cloud' % (request.remote_addr)) return jsonify (tags = cloud , nct = rnct, q = qlabel, n = len(rnct))
def tag_cloud (): # get parameters stxt = request.args.get ('stxt') # save the query in session session.clear() session['query'] = stxt session.modified = True # get trials and tags rnct = ctgov.get_initial_nct (stxt) nct = set () for r in rnct: tkn = r.split(';') nct.add (tkn[0]) # get tags for the first cloud cloud = tcloud.get_initial_cloud (nct, 20, 10) log.info ('%s -- first tag cloud' % (request.remote_addr)) return jsonify (tags = cloud , nct = rnct, q = stxt, n = len(rnct))