def testGetEventDescrs3(self): list = reg.getEventDescrs(self.str_text3) print(list) self.assertEqual(0, len(list))
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 testGetEventDescrs4(self): list = reg.getEventDescrs(self.str_text4) print(list) self.assertIn('1995年11月因故持猎枪将沧州市新华区居民吴某杀死', list)