pub struct Exporter<W> { /* private fields */ }Expand description
Exporter for vectors
Implementations§
Source§impl<W> Exporter<W>
impl<W> Exporter<W>
Sourcepub fn new(w: W) -> Self
pub fn new(w: W) -> Self
Create a new vector exporter with default configurations and a writer to which the vectors will be written to.
Sourcepub fn use_binary(self) -> Self
pub fn use_binary(self) -> Self
Exports the data into binary word2vec format.
Source§impl<W: Write> Exporter<W>
impl<W: Write> Exporter<W>
Sourcepub fn export_space_filtered<F>(
self,
space: &VecSpace,
filter: F,
) -> Result<usize, Error>
pub fn export_space_filtered<F>( self, space: &VecSpace, filter: F, ) -> Result<usize, Error>
Exports all vectors from a VecSpace for which the given filter function returns
true
Sourcepub fn export_vectors<'a, 'b, I>(&mut self, iter: I) -> Result<usize, Error>where
I: IntoIterator<Item = Vector<'a, 'b>>,
pub fn export_vectors<'a, 'b, I>(&mut self, iter: I) -> Result<usize, Error>where
I: IntoIterator<Item = Vector<'a, 'b>>,
Export all given vectors. You have to call write_header first.
§Panics:
Panics if write_header is true but none has been written
Trait Implementations§
impl<W: Copy> Copy for Exporter<W>
Auto Trait Implementations§
impl<W> Freeze for Exporter<W>where
W: Freeze,
impl<W> RefUnwindSafe for Exporter<W>where
W: RefUnwindSafe,
impl<W> Send for Exporter<W>where
W: Send,
impl<W> Sync for Exporter<W>where
W: Sync,
impl<W> Unpin for Exporter<W>where
W: Unpin,
impl<W> UnwindSafe for Exporter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.