pub fn from_str(input: &str) -> Result<Self> {
        let mut parser = Parser::new(input);
        let header = parser.parse_header()?;

        let mut columns = Vec::new();

        for attr in header.attrs.into_iter() {
            columns.push(Column::from_attr(attr)?);
        }

        let mut n_rows = 0;

        parser.skip_empty();
        while !parser.is_eof() {
            let mut cit = columns.iter_mut();

            match cit.next() {
                None => {}
                Some(col) => {
                    col.parse_value(&mut parser)?;
                }
            }

            for col in cit {
                parser.parse_column_delimiter()?;
                col.parse_value(&mut parser)?;
            }
            parser.parse_row_delimiter()?;
            parser.skip_empty();

            n_rows += 1;
        }

        Ok(DataSet {
            relation: header.name,
            columns,
            n_rows,
        })
    }
/// Deserialize an instance of type `DataSet` from an ARFF formatted string.
Deserialize an instance of type `DataSet` from an ARFF formatted string.
Deserialize an instance of type ` DataSet ` from an ARFF formatted string .
pub fn from_str(input: &str) -> Result<Self> {
        let mut parser = Parser::new(input);
        let header = parser.parse_header()?;
        let mut columns = Vec::new();
        for attr in header.attrs.into_iter() {
            columns.push(Column::from_attr(attr)?);
        }
        let mut n_rows = 0;
        parser.skip_empty();
        while !parser.is_eof() {
            let mut cit = columns.iter_mut();
            match cit.next() {
                None => {}
                Some(col) => {
                    col.parse_value(&mut parser)?;
                }
            }
            for col in cit {
                parser.parse_column_delimiter()?;
                col.parse_value(&mut parser)?;
            }
            parser.parse_row_delimiter()?;
            parser.skip_empty();
            n_rows += 1;
        }
        Ok(DataSet {
            relation: header.name,
            columns,
            n_rows,
        })
    }
pub fn from_str ( input : & str ) -> Result < Self > { let mut parser = Parser :: new ( input ) ; let header = parser . parse_header ( ) ? ; let mut columns = Vec :: new ( ) ; for attr in header . attrs . into_iter ( ) { columns . push ( Column :: from_attr ( attr ) ? ) ; } let mut n_rows = 0 ; parser . skip_empty ( ) ; while ! parser . is_eof ( ) { let mut cit = columns . iter_mut ( ) ; match cit . next ( ) { None => { } Some ( col ) => { col . parse_value ( & mut parser ) ? ; } } for col in cit { parser . parse_column_delimiter ( ) ? ; col . parse_value ( & mut parser ) ? ; } parser . parse_row_delimiter ( ) ? ; parser . skip_empty ( ) ; n_rows += 1 ; } Ok ( DataSet { relation : header . name , columns , n_rows , } ) }
Deserialize an instance of type `DataSet` from an ARFF formatted string.
Deserialize an instance of type ` DataSet ` from an ARFF formatted string .
input
&str
input
&str