content_indexer v0.2.5 ContentIndexer.TfIdf.TermCounts

Summary TermCounts is a GenServer that contains the numbers of documents that have a term ‘t’ Basically a map of all unique terms and their respective counts i.e. 1 per for each document that has this term

Link to this section Summary

Functions

If the term exists increment the count, if it’s a new term add and set count to 1

Resets the term counts

Retrieves the current set of term_counts i.e. the state

Link to this section Functions

Link to this function increment_term(term)

If the term exists increment the count, if it’s a new term add and set count to 1

## Example

iex> ContentIndexer.TfIdf.TermCounts.increment_term("bread")
{:ok, {"bread", 3}}

Resets the term counts

## Example

iex> ContentIndexer.TfIdf.TermCounts.reset
{:ok, :reset}

Retrieves the current set of term_counts i.e. the state

## Example

iex> ContentIndexer.TfIdf.TermCounts.state
{:ok, 0}
Link to this function term_count(term)