Function parse_textgrid

Source
pub fn parse_textgrid<I, W>(input: I, print_warnings: W) -> Result<TextGrid>
where I: Into<Source>, W: Into<Option<bool>> + Copy,
Expand description

Parses a Praat .TextGrid file into a textgridde::Textgrid struct.

§Arguments

  • input - One of the following: * A path to a .TextGrid file. * A string containing the entire TextGrid file. * A vector of strings containing the lines of a .TextGrid file. * A stream containing the contents of a .TextGrid file.
  • 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.