pub struct SparseRepresentation<T>(pub Vec<TokenIndexValue<T>>);Expand description
A sparse vector representation containing token indices and their BM25 values.
§Type Parameters
T: The type of token indices used
§Examples
use bm25_vectorizer::{TokenIndexValue, SparseRepresentation};
let tokens = vec![
TokenIndexValue { index: 0, value: 1.2 },
TokenIndexValue { index: 5, value: 0.8 },
];
let sparse_vector = SparseRepresentation(tokens);Tuple Fields§
§0: Vec<TokenIndexValue<T>>Trait Implementations§
Source§impl<T: Clone> Clone for SparseRepresentation<T>
impl<T: Clone> Clone for SparseRepresentation<T>
Source§fn clone(&self) -> SparseRepresentation<T>
fn clone(&self) -> SparseRepresentation<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SparseRepresentation<T>
impl<T: Debug> Debug for SparseRepresentation<T>
Source§impl<T: PartialEq> PartialEq for SparseRepresentation<T>
impl<T: PartialEq> PartialEq for SparseRepresentation<T>
Source§impl<T: PartialOrd> PartialOrd for SparseRepresentation<T>
impl<T: PartialOrd> PartialOrd for SparseRepresentation<T>
impl<T> StructuralPartialEq for SparseRepresentation<T>
Auto Trait Implementations§
impl<T> Freeze for SparseRepresentation<T>
impl<T> RefUnwindSafe for SparseRepresentation<T>where
T: RefUnwindSafe,
impl<T> Send for SparseRepresentation<T>where
T: Send,
impl<T> Sync for SparseRepresentation<T>where
T: Sync,
impl<T> Unpin for SparseRepresentation<T>where
T: Unpin,
impl<T> UnwindSafe for SparseRepresentation<T>where
T: 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