[][src]Struct claw::inverted_index::InvertedIndex

pub struct InvertedIndex { /* fields omitted */ }

Contains inverted index lists.

Methods

impl InvertedIndex[src]

pub fn from_file(file_name: &str) -> Result<Self, Error>[src]

Create a new InvertedIndex from a file.

pub fn get_lists(&self) -> &HashMap<String, Vec<IndexEntry>>[src]

Get a reference to the HashMap containing the inverted lists.

pub fn get_mut_lists(&mut self) -> &mut HashMap<String, Vec<IndexEntry>>[src]

Get a mutable reference to the HashMap containing the inverted lists.

pub fn take(self) -> HashMap<String, Vec<IndexEntry>>[src]

pub fn process_query_output(
    &self,
    queries: Vec<String>
) -> Result<String, Error>
[src]

Finds the intersection of the lists identified by the queries. Returns it as formatted output in a single String.

pub fn process_query(&self, queries: Vec<String>) -> Result<Vec<u32>, Error>[src]

Finds the intersection of the lists identified by the queries. Return as a vec of indices.

Trait Implementations

impl Display for InvertedIndex[src]

impl Debug for InvertedIndex[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]