Skip to content

Instantly share code, notes, and snippets.

@evanxg852000
Created April 9, 2020 09:01
Show Gist options
  • Save evanxg852000/af4ec1ffbc80dfe3c047a17edd8b4444 to your computer and use it in GitHub Desktop.
Save evanxg852000/af4ec1ffbc80dfe3c047a17edd8b4444 to your computer and use it in GitHub Desktop.
#[derive(Debug)]
pub struct InvertedIndex {
count: u32,
docs: HashMap<u32, String>,
index: HashMap<String, HashMap<u32, u32>>,
}
impl InvertedIndex {
pub fn new() -> Self {
InvertedIndex {
count: 0,
docs: HashMap::new(),
index: HashMap::new(),
}
}
// ... other methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment