Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

test_count_analysis.py 998B

12345678910111213141516171819202122232425262728293031323334
  1. import million.parse.fb_exports as fb
  2. import million.analyze.message_evaluation as msg_val
  3. from million.analyze.count_analysis import search_value_at
  4. DATA_PATH = "./data/"
  5. export = fb.parse_dirfiles(DATA_PATH)
  6. messages = export.messages
  7. expected = 0
  8. idx = 0
  9. total_len = len(messages)
  10. total_as_percent = 100 / total_len
  11. with open('output/analysis_breakdown.txt', 'w', encoding="utf-8") as fichier:
  12. while idx < total_len:
  13. print(f"\r{round(idx * total_as_percent, 1)}%", end="")
  14. # skip messages with no detected value
  15. if msg_val.get(messages[idx]) == None:
  16. idx += 1
  17. continue
  18. expected += 1
  19. found_index = search_value_at(messages, idx, expected)
  20. if found_index:
  21. fichier.write(f"{expected}\t⇒{messages[found_index]}\n")
  22. idx = found_index + 1
  23. else:
  24. fichier.write(f"{expected}[X]\t⇒{messages[idx]}\n")
  25. print("\nComplete analysis in: output/analysis_breakdown.txt")