content_indexer v0.2.4 ContentIndexer.TfIdf.DocCounts
Summary DocCounts is a GenServer that contains a map of documents with their respective total number of terms in the document
Link to this section Summary
Functions
If the document exists update the count, if it’s a new document add it and it’s respective term_count
Retrieves the current term_count for this document or nil if not in the map
Initialises the Doc Counts with an empty map
Resets the document counts
Retrieves the current set of doc_counts i.e. the state
Link to this section Functions
If the document exists update the count, if it’s a new document add it and it’s respective term_count
## Example
iex> ContentIndexer.TfIdf.DocCounts.add_document("test_file_1.md", 23)
{:ok, {"test_file_1.md", 23}}
Retrieves the current term_count for this document or nil if not in the map
## Example
iex> ContentIndexer.TfIdf.DocCounts.document_term_count("test_file_1.md")
{:ok, {"test_file_1.md", 23}}
Initialises the Doc Counts with an empty map
Resets the document counts
## Example
iex> ContentIndexer.TfIdf.DocCounts.reset
{:ok, 0}
Retrieves the current set of doc_counts i.e. the state
## Example
iex> ContentIndexer.TfIdf.DocCounts.state
{:ok, 0}