12345678910111213141516171819202122232425262728293031323334 |
- import million.parse.fb_exports as fb
- import million.analyze.message_evaluation as msg_val
- from million.analyze.count_analysis import search_value_at
-
-
- DATA_PATH = "./data/"
- export = fb.parse_dirfiles(DATA_PATH)
- messages = export.messages
-
- expected = 0
- idx = 0
- total_len = len(messages)
- total_as_percent = 100 / total_len
-
- with open('output/analysis_breakdown.txt', 'w', encoding="utf-8") as fichier:
- while idx < total_len:
- print(f"\r{round(idx * total_as_percent, 1)}%", end="")
-
- # skip messages with no detected value
- if msg_val.get(messages[idx]) == None:
- idx += 1
- continue
-
- expected += 1
-
- found_index = search_value_at(messages, idx, expected)
-
- if found_index:
- fichier.write(f"{expected}\t⇒{messages[found_index]}\n")
- idx = found_index + 1
- else:
- fichier.write(f"{expected}[X]\t⇒{messages[idx]}\n")
-
- print("\nComplete analysis in: output/analysis_breakdown.txt")
|