This pr fixes #319 by adding a comment= flag to (almost) all* data loaders. The semantics are as follows:
By default, any line starting with '#' is skipped.
A user can override the comment string with any regular expression. The regexp is constructed to only match at the beginning of the line. For example, calling with comment=';' uses the semicolon as a comment leader.
Comment skipping can be disabled by specifying comment=None. This is equivalent to the current default behavior, but I don't think it should be the default going forward. It's increasingly common for annotation tools to leave metadata in the resulting data file, and we should be encouraging of that pattern.
exceptions for wav (obviously) and pattern, the latter because the pattern format doesn't seem to have a common grammar for comments. The other formats implicitly use some flavor of CSV/TSV, which generally support comment strings.
This pr fixes #319 by adding a
comment=
flag to (almost) all* data loaders. The semantics are as follows:By default, any line starting with
'#'
is skipped.A user can override the comment string with any regular expression. The regexp is constructed to only match at the beginning of the line. For example, calling with
comment=';'
uses the semicolon as a comment leader.Comment skipping can be disabled by specifying
comment=None
. This is equivalent to the current default behavior, but I don't think it should be the default going forward. It's increasingly common for annotation tools to leave metadata in the resulting data file, and we should be encouraging of that pattern.exceptions for wav (obviously) and pattern, the latter because the pattern format doesn't seem to have a common grammar for comments. The other formats implicitly use some flavor of CSV/TSV, which generally support comment strings.