nmoya / whatsapp-parser

Parser to the What's App log file.
MIT License
47 stars 23 forks source link

false negatives in parsing messages in tests #10

Open manu-chroma opened 7 years ago

manu-chroma commented 7 years ago

hey, the program wasn't working for me until i commented this loop https://github.com/nmoya/whatsapp-parser/blob/master/parsers/whatsapp.py#L23

it gives false negatives when running with tests/testChat3.txt can you please fix the loop. i think the len() comparison is not quite right.

thanks.

nmoya commented 7 years ago

@manu-chroma yeah, I will remove this if. I think this doesn't make sense anymore since the messages formatting may have changed slightly. I wish I have written unit tests :(

manu-chroma commented 7 years ago

I was wondering how to check if the given line is valid or not. should we use regex for that or something else. given the date change based on locale, len check won't work.

this would be needed in the new parser also.

manu-chroma commented 7 years ago

should i remove the len() check and put parsing of message in try/except block. it'll give an error when it won't be able to generate a datetime object. it's dirty hack for this version, which i'll fix in the new parser. thoughts ?

nmoya commented 7 years ago

@manu-chroma Yeah, I think this is a good approach, since I don't remember what is an invalid line anymore to write the regex.