cjdoris / ARFFFiles.jl

Load and save ARFF files
MIT License
5 stars 2 forks source link

Allow parsing of empty lines #1

Closed davnn closed 3 years ago

davnn commented 3 years ago

Hi!

I stumbled into this problem while trying to reading in the ARFF files from https://www.dbs.ifi.lmu.de/research/outlier-evaluation/DAMI/, which always contain a couple of empty lines at the end of each file.

Best David

cjdoris commented 3 years ago

Thanks for this.

Can you change @info to @debug and break to continue please?

cjdoris commented 3 years ago

Actually I'm a bit confused, blank lines should already be ignored because x will be empty.

davnn commented 3 years ago

Well, call stack was parse_data_line, parse_datum, parse_string and parse string throws at line 185. Not sure if this is unexpected?

Edit: Actually trivial to reproduce by adding an empty line to the end of an ARFF file

@RELATION 'repro'

@ATTRIBUTE 'var_0000' real
@ATTRIBUTE 'var_0001' real
@ATTRIBUTE 'var_0002' real

@DATA
1,2,3
4,5,6
davnn commented 3 years ago

Added the proposed changes.

cjdoris commented 3 years ago

It turns out there was a bug elsewhere in the parser preventing empty lines from parsing, which I've now fixed. I've just registered it as v1.0.0.