mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
Fix whatsappchatloader - enable parsing new datetime format on WhatsApp chat (#6555)
- Description: observed new format on WhatsApp exported chat - example:
`[2023/5/4, 16:17:13] ~ Carolina: 🥺`
- Dependencies: no additional dependencies required
- Tag maintainer: @rlancemartin, @eyurtsev
This commit is contained in:
parent
5322bac5fc
commit
14b9418cc5
@ -29,11 +29,11 @@ class WhatsAppChatLoader(BaseLoader):
|
||||
message_line_regex = r"""
|
||||
\[?
|
||||
(
|
||||
\d{1,2}
|
||||
\d{1,4}
|
||||
[\/.]
|
||||
\d{1,2}
|
||||
[\/.]
|
||||
\d{2,4}
|
||||
\d{1,4}
|
||||
,\s
|
||||
\d{1,2}
|
||||
:\d{2}
|
||||
|
@ -17,4 +17,5 @@ def test_whatsapp_chat_loader() -> None:
|
||||
"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"
|
||||
"~ User 2 on 2023/5/4, 16:13:23: See you!\n\n"
|
||||
)
|
||||
|
@ -2,4 +2,5 @@
|
||||
[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/24/21, 12:41:03 PM] ~ User name 2: Of course!
|
||||
[1/24/21, 12:41:03 PM] ~ User name 2: Of course!
|
||||
[2023/5/4, 16:13:23] ~ User 2: See you!
|
Loading…
Reference in New Issue
Block a user