Closed darryl34 closed 5 years ago
can you try using python 2.7? this project is not tested on python 3.
Okay. So I tried with Python 2.7. But I get this error. Is there a problem with my text file?
C:\Users\Darryl\Downloads\whatsapp-parser-master\whatsapp-parser-master>py -2 wp_parser/wp_chat.py -f chat.txt -n "Darryl" -r sleepy yes
Traceback (most recent call last):
File "wp_parser/wp_chat.py", line 239, in <module>
main()
File "wp_parser/wp_chat.py", line 234, in main
c.all_features(pattern_list=args['regexes'])
File "wp_parser/wp_chat.py", line 110, in all_features
self.features.compute_response_time_and_burst(self.messages, self.root, self.senders, initiation_thrs, burst_thrs, response_thrs)
File "C:\Users\ASUS\Downloads\whatsapp-parser-master\whatsapp-parser-master\wp_parser\ChatFeatures.py", line 27, in compute_response_time_and_burst
t0 = list_of_messages[0].datetime_obj
IndexError: list index out of range
@darryl34 Yes, it looks like there is a problem in your chat history file.
Ahh I see. Okay. So I went and compared the test chat history file with my own file. Apparently, they added square brackets around the timestamp and changed the format from DD/MM/YY to DD/MM/YYYY. Did these changes affect the code?
My file: sample_chat.txt The test file: 22_OW_MT.txt
@darryl34 I don't remember the code anymore 🙈 You can try with a single line file, like this:
02/02/2019, 9:14:54 AM Darryl: hi hi!
If it works, that's the problem!
Nope, still the same problem. Oh well. Thanks for your help!
@darryl34 Huh, it's weird that it didn't work. if it works with the sample chat, it is definitely formatting on the input. Try brute forcing a little bit with some very simple examples.
@darryl34 can you post a few sample messages here? I'll try to help out in free time.
@manu-chroma @nmoya sorry i forgot to add a colon after AM. the code works.
Is there a limit to the average response time. Eg. we dont speak for a couple of days. Will that count?
And, what exactly are contact bursts and initiations?
Hey @darryl34,
Yes, there is a response time threshold. Default is 3 hours. This means that if the messages where being exchanged within this threshold, it's all being used for the response time. If it takes longer than the threshold, a new average is started.
Contact bursts are how many times a person burst messages at the other.
Hi
Are you there?
How are you?
Can you read this?
This is a burst.
Initiation is a counter of how many times a person initiated a conversation. There is also a default threshold to increment the initiations, which is 8 hours. So, messages within 8 hours apart is the same "initiation", more than that it's a "new conversation" in which the first sender-initiated it.
Ah why didn't I think of that earlier
Many thanks!
Hi, I came across this error when trying to run the program. I'm fairly new to Python so I only understand some parts of your code.
Your help will be much appreciated :)