with open('final_test(1).txt', 'r', encoding='utf-8') as f: with open('对对对队_addr_parsing_runid.txt', 'w', encoding='utf-8') as f_out: for line in f: # 获取地址信息 id_, info = line.strip().split('\u0001') # 解析地址要素和标签 province, city, district, street,community ,devzone, houseno, cellno,floorno,intersection,subpoi,assist, tags = parse_address(info) # 将结果写入文件 tags_str = ' '.join(tags) f_out.write(id_ + '\u0001' + info + '\u0001' + tags_str + '\n'

with openfinal_test1txt r encoding=utf-8 as f with open对对对队_addr_parsing_runidtxt w encoding=utf-8 as f_out for line in f # 获取地址信息 id_ info = linestripsplitu0001

原文地址: http://www.cveoy.top/t/topic/hsX2 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录