Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix whatapp chat issue #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ravieroy
Copy link

@Ravieroy Ravieroy commented Dec 8, 2021

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
Copy link
Owner

JRavi2 commented Dec 9, 2021

@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
Copy link
Author

Ravieroy commented Dec 9, 2021

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
Copy link
Owner

JRavi2 commented Dec 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants