pub struct DocumentAnalyzer<IdType>{
pub documents: HashMap<IdType, Document>,
pub idf: TokenFrequency,
pub total_doc_count: u64,
}Fields§
§documents: HashMap<IdType, Document>§idf: TokenFrequency§total_doc_count: u64Implementations§
Source§impl<IdType> DocumentAnalyzer<IdType>
impl<IdType> DocumentAnalyzer<IdType>
pub fn new() -> Self
pub fn add_document( &mut self, id: IdType, content: &[&str], text: Option<&str>, ) -> Option<&Document>
pub fn get_document(&self, id: &IdType) -> Option<&Document>
pub fn del_document(&mut self, id: &IdType) -> Option<Document>
pub fn get_document_count(&self) -> u64
pub fn get_token_set_vec(&self) -> Vec<String>
pub fn get_token_set_vec_ref(&self) -> Vec<&str>
pub fn get_token_set(&self) -> HashSet<String>
pub fn get_token_set_ref(&self) -> HashSet<&str>
pub fn get_token_set_len(&self) -> usize
pub fn generate_index(&self) -> Index<IdType>
Trait Implementations§
Source§impl<IdType> Clone for DocumentAnalyzer<IdType>
impl<IdType> Clone for DocumentAnalyzer<IdType>
Source§fn clone(&self) -> DocumentAnalyzer<IdType>
fn clone(&self) -> DocumentAnalyzer<IdType>
Returns a copy 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<IdType> Debug for DocumentAnalyzer<IdType>
impl<IdType> Debug for DocumentAnalyzer<IdType>
Source§impl<'de, IdType> Deserialize<'de> for DocumentAnalyzer<IdType>
impl<'de, IdType> Deserialize<'de> for DocumentAnalyzer<IdType>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<IdType> Serialize for DocumentAnalyzer<IdType>
impl<IdType> Serialize for DocumentAnalyzer<IdType>
Auto Trait Implementations§
impl<IdType> Freeze for DocumentAnalyzer<IdType>
impl<IdType> RefUnwindSafe for DocumentAnalyzer<IdType>where
IdType: RefUnwindSafe,
impl<IdType> Send for DocumentAnalyzer<IdType>
impl<IdType> Sync for DocumentAnalyzer<IdType>
impl<IdType> Unpin for DocumentAnalyzer<IdType>where
IdType: Unpin,
impl<IdType> UnwindSafe for DocumentAnalyzer<IdType>where
IdType: 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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more