pub fn parse_textgrid<I, W>(input: I, print_warnings: W) -> Result<TextGrid>Expand description
Parses a Praat .TextGrid file into a textgridde::Textgrid struct.
§Arguments
input- One of the following: * A path to a.TextGridfile. * A string containing the entireTextGridfile. * A vector of strings containing the lines of a.TextGridfile. * A stream containing the contents of a.TextGridfile.print_warnings?- An optional boolean indicating whether to print warnings.
§Returns
A Result containing a textgridde::TextGrid struct if successful, or a std::io::Error if parsing failed.
§Errors
If a TextGrid is malformed irrecoverably, an std::io::Error is returned. This can be for one of the following reasons:
* The file does not start with the correct File type and Object class ("ooTextFile" and "TextGrid" respectively).
* The xmin and xmax values are not present or cannot be parsed as floats.
* The exists value is not present or is not equal to “exists”.
* A tier type is not recognized.