content_indexer v0.2.5 ContentIndexer.TfIdf.TermCounts.Impl

Summary functions used by the ContentIndexer.TfIdf.TermCounts.Server

Link to this section Summary

Functions

If the term exists get the count else zero

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 get_term_count(term, terms)

If the term exists get the count else zero

## Example

iex> ContentIndexer.TfIdf.TermCounts.Impl.get_term_count("bread")
      3
Link to this function increment_term_count(term, terms)

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_count("bread")
      {"bread", 3}

Resets the term counts

## Example

iex> ContentIndexer.TfIdf.TermCounts.Impl.reset
      %{}

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

## Example

iex> ContentIndexer.TfIdf.TermCounts.Impl.state(%{})
      %{}