use std::fs::read_to_string;
use std::path::Path;
use crate::parse_vojaq;
use crate::VojaqSet;
pub fn read_file<P>(path: P) -> Result<VojaqSet, Box<dyn std::error::Error>>
where P: AsRef<Path>
{
let content = read_to_string(path)?;
let content = if content.starts_with("\u{FEFF}") {
&content[3..]
} else {
&content[..]
};
Ok(parse_vojaq(content)?)
}