public interface InvertedIndex extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
addWordsToDoc(int doc,
List<VocabWord> words)
Adds words to the given document
|
void |
addWordToDoc(int doc,
VocabWord word)
Add word to a document
|
Collection<Integer> |
allDocs()
Returns a list of all documents
|
List<VocabWord> |
document(int index)
Returns a list of words for a document
|
List<Integer> |
documents(VocabWord vocabWord)
Returns the list of documents a vocab word is in
|
void |
finish()
Finishes saving data
|
int |
numDocuments()
Returns the number of documents
|
List<VocabWord> document(int index)
index
- List<Integer> documents(VocabWord vocabWord)
vocabWord
- the vocab word to get documents forint numDocuments()
Collection<Integer> allDocs()
void addWordToDoc(int doc, VocabWord word)
doc
- the document to add toword
- the word to addvoid addWordsToDoc(int doc, List<VocabWord> words)
doc
- the document to add towords
- the words to addvoid finish()
Copyright © 2014. All rights reserved.