sentence2vec 0.1.0

A tool to convert a sentence to a vector. It can be used to partition word2vec data. It can also be used to extract a list of words from a word2vec data file.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::{
    fs::File,
    io::{self, BufRead},
    path::Path,
};

/// Read lines from a file and return an iterator over the lines.
pub(crate) fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
where
    P: AsRef<Path>,
{
    let file = File::open(filename)?;
    Ok(io::BufReader::new(file).lines())
}