pub(crate) fn sparse(&self, i: usize, word: &[u8]) -> Option<u32> {
        if let Some(is_dense) = &self.is_dense {
            if is_dense.get(i).copied().unwrap_or(false) {
                return None;
            }
            let hash = Identity64::from(hash(word));
            return self.feature_idxs[i].get(&hash).copied();
        }
        if !not_space(word) {
            return None;
        }
        let word = strip_value(word);
        let hash = Identity64::from(hash(word));
        self.sparse.get(&hash).copied()
    }
/// If the given word is a sparse feature, returns its feature index, else None.
/// The index should be the index of the feature in the line (used for tsv).
If the given word is a sparse feature, returns its feature index, else None.
The index should be the index of the feature in the line (used for tsv).
If the given word is a sparse feature returns its feature index else None . The index should be the index of the feature in the line ( used for tsv ) .
pub(crate) fn sparse(&self, i: usize, word: &[u8]) -> Option<u32> {
        if let Some(is_dense) = &self.is_dense {
            if is_dense.get(i).copied().unwrap_or(false) {
                return None;
            }
            let hash = Identity64::from(hash(word));
            return self.feature_idxs[i].get(&hash).copied();
        }
        if !not_space(word) {
            return None;
        }
        let word = strip_value(word);
        let hash = Identity64::from(hash(word));
        self.sparse.get(&hash).copied()
    }
pub ( crate ) fn sparse ( & self , i : usize , word : & [ u8 ] ) -> Option < u32 > { if let Some ( is_dense ) = & self . is_dense { if is_dense . get ( i ) . copied ( ) . unwrap_or ( false ) { return None ; } let hash = Identity64 :: from ( hash ( word ) ) ; return self . feature_idxs [ i ] . get ( & hash ) . copied ( ) ; } if ! not_space ( word ) { return None ; } let word = strip_value ( word ) ; let hash = Identity64 :: from ( hash ( word ) ) ; self . sparse . get ( & hash ) . copied ( ) }
If the given word is a sparse feature, returns its feature index, else None.
If the given word is a sparse feature returns its feature index else None .
&self
i
usize
word
&[u8]
&self
i
usize
word
&[u8]