def testResume(self): dict = {} dict['volk'] = reg.getVolk(self.str_text) dict['edu'] = reg.getEducations(self.str_text) dict['alias'] = reg.getAliasName(self.str_text) dict['job'] = reg.getJobsCurr(self.str_text) dict['majors'] = reg.getMajors(self.str_text) dict['schools'] = reg.getSchools(self.str_text) dict['location'] = reg.getLocation(self.str_text) print(dict)
if len(_list) > 0: return _list[0] return "" if __name__ == "__main__": resume_dict = {} dict_result = npt.analy_html(html_text, UrlUtils.parseUrl(html_url)) arr_resume = dict_result['resume'] arr_resume_dict = [] for resume in arr_resume: resume['name'] = getPersonName(resume['text']) resume['alias'] = firstInStrList(RegUtils.getAliasName(resume['text'])) resume['location'] = firstInStrList( RegUtils.getLocation(resume['text'])) resume['nid'] = firstInStrList(RegUtils.getIdNbr(resume['text'])) resume['event_descr'] = firstInStrList( RegUtils.getEventDescrs(resume['text'])) resume['birthday'] = firstInStrList( RegUtils.getBirthday(resume['text'])) resume['volk'] = firstInStrList(RegUtils.getVolk(resume['text'])) resume['gender'] = firstInStrList(RegUtils.getGender(resume['text'])) if resume['name'] != '' or resume['nid'] != '': arr_resume_dict.append(resume) arr_resume_dict = npt.clean_image_url(arr_resume_dict) print(arr_resume_dict)
def testGetLocation2(self): list = reg.getLocation('户籍地:天津市滨海新区大港太平镇六间房村。') print(list) self.assertIn('天津市滨海新区大港太平镇六间房村', list)
def testGetLocation3(self): list = reg.getLocation( '张任德(在逃人员编号:T8432009999992015090170),男,汉族,1963年12月15日生,户籍地:广西自治区防城港市港口区企沙镇赤沙村赤东组28号' ) print(list) self.assertIn('广西自治区防城港市港口区企沙镇赤沙村赤东组28号', list)
def testGetLocation(self): list = reg.getLocation(self.str_text7) print(list) self.assertIn('浙江龙游', list)