whatsapp-parser icon indicating copy to clipboard operation
whatsapp-parser copied to clipboard

false negatives in parsing messages in tests

Open manu-chroma opened this issue 9 years ago • 4 comments

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.

manu-chroma avatar Jan 04 '17 17:01 manu-chroma

@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 :(

nmoya avatar Jan 05 '17 14:01 nmoya

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 avatar Jan 05 '17 15:01 manu-chroma

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 ?

manu-chroma avatar Jan 06 '17 06:01 manu-chroma

@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.

nmoya avatar Jan 06 '17 17:01 nmoya