JRavi2 / Chat-Analyzer

A python program to analyze your Social Chats
12 stars 8 forks source link

Fix whatapp chat issue #12

Open Ravieroy opened 2 years ago

Ravieroy commented 2 years ago

Hello everyone. May I suggest a slightly different approach to resolve the issue. I believe we should not tamper with the main code too much in this case. Since the issue is with export file I propose we modify the exported file to conform to the standard of the code.

Other than the issue with the time format, the chat is not recognized if the chat consist of multiple lines with spaces between them . Changing the code to incorporate the file might break some other file with different format. As a proof of concept I have written a raw code to handle most of the whatapp exports. Kindly see the chat_formatting.py and its README file. See if you like the direction it suggests.

I have also incorporated code to handle the suggested fix in PR #11.

All we have to do is before running the main code, run the chat_formatting.py on the export file. The code presented is merely a idea and it requires more tweaking.

JRavi2 commented 2 years ago

@Ravieroy Thanks a lot for suggesting this. I really appreciate the effort you've put in.

We may (or may not) require to implement this in the future, but, as of now the current issues with date and time should be fixable by modifying the existing regex (after all that's what regex is most useful for, recognizing multiple different patterns) and a few other tweaks.

Other than the issue with the time format, the chat is not recognized if the chat consist of multiple lines with spaces between them.

I'm not aware of this issue, could you provide an example snippet for this?

Changing the code to incorporate the file might break some other file with different format.

That's why we have tests :)

Let's not close this PR as we may require to go this route in the future. But for now, I think small changes in the regex should be enough.

Ravieroy commented 2 years ago

I'm not aware of this issue, could you provide an example snippet for this?

Apologies. The code works fine for this case.

We may (or may not) require to implement this in the future,....

No problem. If this is required you can let me know and I can refine the code as desired. As of now modifying regex is the best fix.

JRavi2 commented 2 years ago

Again, thanks for suggesting this, this is definitely an interesting route. I'll ping you here whenever we need to implement this further :)