If an input file starts with one or more comment lines, followed by a line containing labels, those labels are not parsed since originally labels would only be detected on line 1. Since curvec is only set when a vector row is parsed, it will always be null when the label row is parsed. This is therefore a more reliable way to detect label rows.
An alternative way to fix this would be to count non-comment line numbers in the TokenizedReader. However, this is a less elegant solution in my opinion while it also requires a closer coupling between NumberVectorLabelParser and TokenizedReader.
If an input file starts with one or more comment lines, followed by a line containing labels, those labels are not parsed since originally labels would only be detected on line 1. Since
curvec
is only set when a vector row is parsed, it will always benull
when the label row is parsed. This is therefore a more reliable way to detect label rows.An alternative way to fix this would be to count non-comment line numbers in the
TokenizedReader
. However, this is a less elegant solution in my opinion while it also requires a closer coupling betweenNumberVectorLabelParser
andTokenizedReader
.