diff --git a/fdb_spider_interface.py b/fdb_spider_interface.py index 50cf3e3..265cb4f 100644 --- a/fdb_spider_interface.py +++ b/fdb_spider_interface.py @@ -548,31 +548,36 @@ if __name__ == '__main__': if '_' in tag: ntags = tag.split('_') ntags_length = len(ntags) - + print(ntags) ntag_count = 0 - for nword in name_data_lower: - for ntag in ntags: - if ntag.lower() in nword and nword != '': - ntag_count += 1 + for ntag in ntags: + for nword in name_data_lower: + if ntag.lower() in nword: + if nword != '': + ntag_count += 1 + break if ntag_count == ntags_length: contains_tag = True tag_list.append(ntags.join('_') + ' in name') ntag_count = 0 - for iword in info_data_lower: - for ntag in ntags: - if ntag.lower() in iword and iword != '': - ntag_count += 1 + for ntag in ntags: + for iword in info_data_lower: + if ntag.lower() in iword: + if iword != '': + ntag_count += 1 + break if ntag_count == ntags_length: contains_tag = True tag_list.append(ntags.join('_') + ' in info') ntag_count = 0 - for tword in text_data_lower: - ntag_count = 0 - for ntag in ntags: - if ntag.lower() in tword and tword != '': - ntag_count += 1 + for ntag in ntags: + for tword in text_data_lower: + if ntag.lower() in tword: + if tword != '': + ntag_count += 1 + break if ntag_count == ntags_length: contains_tag = True tag_list.append(ntags.join('_') + ' in text') @@ -580,26 +585,40 @@ if __name__ == '__main__': else: #print('------------------') - #print(name_data_lower, info_data_lower, text_data_lower, room[0], room_tags) + print(name_data_lower, info_data_lower, text_data_lower, room[0], room_tags) + nword_contains_tag = False for nword in name_data_lower: - if tag.lower() in nword and nword != '': - contains_tag = True - if contains_tag == True: + print(tag.lower(), nword) + if tag.lower() in nword: + print('goooot heeeere') + print(nword) + if nword != '': + print('goot behind nword check') + nword_contains_tag = True + if nword_contains_tag == True: + contains_tag = True tag_list.append(tag + ' in name') + iword_contains_tag = False for iword in info_data_lower: - if tag.lower() in iword and iword != '': - contains_tag = True - if contains_tag == True: + if tag.lower() in iword: + if iword != '': + iword_contains_tag = True + print('oioiOIOIOIoioioiOIOIword', iword) + if iword_contains_tag == True: + contains_tag = True tag_list.append(tag + ' in info') - for tword in text_data_lower:: - if tag.lower() in tword and tword != '': - contains_tag = True - if contains_tag == True: + tword_contains_tag = False + for tword in text_data_lower: + if tag.lower() in tword: + if tword != '': + tword_contains_tag = True + if tword_contains_tag == True: + contains_tag = True tag_list.append(tag + ' in text') if contains_tag == True: - print('------------------') - print(name_data_lower, info_data_lower, text_data_lower) + #print('------------------') + #print(name_data_lower, info_data_lower, text_data_lower) try: url = data[room_fdb][i][key]["domain"] except: diff --git a/new_message_file.txt b/new_message_file.txt index d78cb00..c623f7a 100644 --- a/new_message_file.txt +++ b/new_message_file.txt @@ -1 +1 @@ -updaterooms 657c97e5ebb39dd248d38d51§%§%awNMcpqH8ZhCc3Cx6 \ No newline at end of file +updaterooms 657c97e5ebb39dd248d38d51§%§%kJRnyNTcJSHa8sAew \ No newline at end of file diff --git a/roomhistories/657c97e5ebb39dd248d38d51.txt b/roomhistories/657c97e5ebb39dd248d38d51.txt index b564827..ad977c3 100644 --- a/roomhistories/657c97e5ebb39dd248d38d51.txt +++ b/roomhistories/657c97e5ebb39dd248d38d51.txt @@ -1,8 +1,6 @@ - -