Update WhatsAppChatLoader to include the character ~ in the sender name (#4420)

Fixes #4153

If the sender of a message in a group chat isn't in your contact list,
they will appear with a ~ prefix in the exported chat. This PR adds
support for parsing such lines.
parallel_dir_loader
Rukmani 1 year ago committed by GitHub
parent f2150285a4
commit 2b14036126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,7 +44,7 @@ class WhatsAppChatLoader(BaseLoader):
)
\]?
[\s-]*
([\w\s]+)
([~\w\s]+)
[:]+
\s
(.+)

@ -16,4 +16,5 @@ def test_whatsapp_chat_loader() -> None:
"User name on 11/8/21, 9:41:32 AM: Message 123\n\n"
"User 2 on 1/23/23, 3:19 AM: Bye!\n\n"
"User 1 on 1/23/23, 3:22_AM: And let me know if anything changes\n\n"
"~ User name 2 on 1/24/21, 12:41:03 PM: Of course!\n\n"
)

@ -1,4 +1,5 @@
[05.05.23, 15:48:11] James: Hi here
[11/8/21, 9:41:32 AM] User name: Message 123
1/23/23, 3:19 AM - User 2: Bye!
1/23/23, 3:22_AM - User 1: And let me know if anything changes
1/23/23, 3:22_AM - User 1: And let me know if anything changes
[1/24/21, 12:41:03 PM] ~ User name 2: Of course!
Loading…
Cancel
Save