mowolf / ChatAnalyzer

Java script webapp that analyzes your WhatsApp Chat history locally on your machine.
https://chatanalyzer.moritzwolf.com
Other
208 stars 41 forks source link

Issues with Formats with variable length #8

Closed mowolf closed 6 years ago

mowolf commented 6 years ago

Most of the bugs come back to this...

mowolf commented 6 years ago

7/31/16, 1:11 PM - Yo: Ya viste esto? 7/31/16, 1:17 PM - Copy: Jaja no donde lo sacaste?

Spinfuser commented 6 years ago

[2/28/17, 3:54:36 PM] Name1: blabla [2/28/17, 3:55:02 PM] Name2: blabla

"If you get this error even though this is no group chat search in your .txt file and replace this occurence:

ame2"

The file is quite big, over 5mb

itsbayad commented 6 years ago

I think I figured out the issue here. When you copy and paste a few messages from Whatsapp, it's the same format as the code analyzes, so if you send that as a message in a Whatsapp chat, the code will get lost because it'll see the date and contact name again after a date and contact name. Thus, it'll assume the " " in between them is the actual message, and that the new names of the pasted conversation are more people talking. That's why it reads like a group chat

Spinfuser commented 6 years ago

Seems like you fixed it sort of, but my chronological graph seems wrong, big gaps.

mowolf commented 6 years ago

@Spinfuser Yeah, there are still issues with some formats that have a variable length. Like 9:10 PM and 12:00 AM vs 09:10 PM and 12:00 AM.

anujbiyani commented 6 years ago

Using regex and libraries to parse dates+times would help a lot over the substring approach.

mowolf commented 6 years ago

@anujbiyani Yep. I work on it: https://www.debuggex.com/r/4oudOv37eWpW9NMt

mowolf commented 6 years ago

All parsing is now done via regex. I still leave this open in case there are more issues.

ryanb93 commented 6 years ago

These don't get removed:

[21/04/2018, 10:20:13] ‎You created group “Group-A”
[21/04/2018, 10:20:13] Group-A: ‎Messages to this group are now secured with end-to-end encryption.
[21/04/2018, 12:00:29] ‎You changed this group's icon
[21/04/2018, 10:50:45] ‎You added Firstname Lastname
[23/04/2018, 21:54:51] ‎You changed the group description

First 2 are because of the - in the group name I think

mowolf commented 6 years ago

@ryanb93 fixed. ;)