def create_map(): if len(sys.argv) == 1: name_trie_list, ip6_trie_list = pp.index_ip6address_4_aaaa() pp.build_map(name_trie_list, ip6_trie_list) else: name_trie_list, ip6_trie_list = pp.index_ip6address_4_aaaa(sys.argv[1]) pp.build_map(name_trie_list, ip6_trie_list, sys.argv[1])
target_trie = mt.Trie(file_target_list) name_trie = mt.Trie(file_name_list) trie_saver(indexing_result, name_trie, name_index_fn) trie_saver(indexing_result, target_trie, target_index_fn) indexing_result.trie_tuple_dict[filename] = (name_trie, target_trie) print filename print 'ncols =', len(target_trie) print 'nrows =', len(name_trie) print '\n' create_combined_index(indexing_result) return indexing_result # def build_map(filenames=['../records/aaaa.csv', '../records/cname.csv', '../records/dname.csv', '../records/a.csv'], # indexing_result): # all_name_index_trie = indexing_result.all_indexing_trie_tuple(0) # all_target_index_trie = indexing_result.all_indexing_trie_tuple(1) # for filename in filenames: indexing_result = index_field(['../records/aaaa.csv', '../records/cname.csv', '../records/dname.csv', '../records/a.csv']) all_name_index, all_target_index = indexing_result.all_indexing_trie_tuple for filename in [ '../records/cname.csv', '../records/aaaa.csv', '../records/dname.csv', '../records/a.csv']: pp.build_map(all_name_index, all_target_index, filename)