def obtain_individual_pubs(name, cid): #print 'Searching for publication data...' all_names = name.split() long_names = filter(lambda x: len(x) > 1, all_names) # search for only first and last name pubs = None pubs, gspro_nfound, gspro_names, gspro_links, real_n_expected = search(name,all_names[0][0],all_names[-1]) return pubs, gspro_nfound, gspro_names, gspro_links, real_n_expected, name, cid
def obtain_individual_pubs(name, cid, n, name_parse, kw, keywords): #print 'Searching for publication data...' # all_names = name.split() # long_names = filter(lambda x: len(x) > 1, all_names) #here - what about when there is a period?? or a comma?? if n==True: name=clean_name(name) all_names = name.split() long_names = filter(lambda x: len(x) > 1, all_names) lname=all_names[-1] fnames=' '.join(all_names[:-1]) names=fnames.replace('-',' ').split() initials='' for x in names: initials += x[0] fname=names[0] minitials = initials[1:] finitial=initials[0] if name_parse=="fname lname": name=' '.join([fname,lname]) elif name_parse=="finitial lname": name=' '.join([finitial, lname]) elif name_parse=="initials lname": name=' '.join([initials, lname]) elif name_parse=="fname minitials lname": name=' '.join([fname, minitials, lname]) name=' '.join(name.split()) elif name_parse=="clean": name=name #not necessary else: raise elif n==False: #does what it did before - should have no effect. except with name_check - but that doesn't happen for raw. all_names = name.split() long_names = filter(lambda x: len(x) > 1, all_names) #here - what about when there is a period?? or a comma?? else: raise # searches for name pubs = None if kw==True: pubs, gspro_nfound, gspro_names, gspro_links, real_n_expected = kwsearch(name,all_names[0][0],all_names[-1],keywords) else: pubs, gspro_nfound, gspro_names, gspro_links, real_n_expected = search(name,all_names[0][0],all_names[-1]) return pubs, gspro_nfound, gspro_names, gspro_links, real_n_expected, name, cid #name returned will the the searched name